From 2f173296560a6e577c32f4db7d72c8207306a71f Mon Sep 17 00:00:00 2001 From: Grzegorz Date: Sun, 18 Aug 2024 22:39:42 +0200 Subject: [PATCH] release v5.0.2 --- CHANGELOG.md | 6 ++++++ package.json | 2 +- src/denon.js | 6 +++--- src/mainzone.js | 8 ++++---- src/surround.js | 8 ++++---- src/zone2.js | 8 ++++---- src/zone3.js | 8 ++++---- 7 files changed, 26 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eeeba5c..7647ceb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Note - after update to 3.15.x need remove the accessory frome Home app and add it again +## [5.0.2] - (18.08.2024) + +## Changes + +- fix correct catch error + ## [5.0.1] - (14.08.2024) ## Changes diff --git a/package.json b/package.json index f981f7a..a979867 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "displayName": "Denon TV", "name": "homebridge-denon-tv", - "version": "5.0.1", + "version": "5.0.2", "description": "Homebridge plugin to control Denon/Marantz AV Receivers.", "license": "MIT", "author": "grzegorz914", diff --git a/src/denon.js b/src/denon.js index f43b09b..ac9e590 100644 --- a/src/denon.js +++ b/src/denon.js @@ -307,7 +307,7 @@ class DENON extends EventEmitter { return true; } catch (error) { - this.emitDeviceInfo('error', error); + throw new Error( error); }; }; @@ -417,7 +417,7 @@ class DENON extends EventEmitter { return inputsArr; } catch (error) { - this.emitDeviceInfo('error', error); + throw new Error( error); } }; @@ -427,7 +427,7 @@ class DENON extends EventEmitter { await this.axiosInstance(path); return true; } catch (error) { - this.emitDeviceInfo('error', error); + throw new Error( error); }; }; }; diff --git a/src/mainzone.js b/src/mainzone.js index 81bd7fe..0df2243 100644 --- a/src/mainzone.js +++ b/src/mainzone.js @@ -401,7 +401,7 @@ class MainZone extends EventEmitter { this.televisionService.setCharacteristic(Characteristic.DisplayOrder, Encode(1, displayOrder).toString('base64')); return true; } catch (error) { - this.emitDeviceInfo('error', error); + throw new Error( error); }; } @@ -411,7 +411,7 @@ class MainZone extends EventEmitter { const debug = !this.enableDebugMode ? false : this.emit('debug', `Saved data: ${JSON.stringify(data, null, 2)}`); return true; } catch (error) { - this.emitDeviceInfo('error', error); + throw new Error( error); }; } @@ -420,7 +420,7 @@ class MainZone extends EventEmitter { const data = await fsPromises.readFile(path); return data; } catch (error) { - this.emitDeviceInfo('error', `Read saved data error: ${error}`); + throw new Error( `Read saved data error: ${error}`); }; } @@ -1002,7 +1002,7 @@ class MainZone extends EventEmitter { return accessory; } catch (error) { - this.emitDeviceInfo('error', error) + throw new Error( error) }; } }; diff --git a/src/surround.js b/src/surround.js index 610582d..ee74ac7 100644 --- a/src/surround.js +++ b/src/surround.js @@ -369,7 +369,7 @@ class Surround extends EventEmitter { this.televisionService.setCharacteristic(Characteristic.DisplayOrder, Encode(1, displayOrder).toString('base64')); return true; } catch (error) { - this.emitDeviceInfo('error', error); + throw new Error( error); }; } @@ -379,7 +379,7 @@ class Surround extends EventEmitter { const debug = !this.enableDebugMode ? false : this.emit('debug', `Saved data: ${JSON.stringify(data, null, 2)}`); return true; } catch (error) { - this.emitDeviceInfo('error', error); + throw new Error( error); }; } @@ -388,7 +388,7 @@ class Surround extends EventEmitter { const data = await fsPromises.readFile(path); return data; } catch (error) { - this.emitDeviceInfo('error', `Read saved data error: ${error}`); + throw new Error( `Read saved data error: ${error}`); }; } @@ -857,7 +857,7 @@ class Surround extends EventEmitter { return accessory; } catch (error) { - this.emitDeviceInfo('error', error) + throw new Error( error) }; } }; diff --git a/src/zone2.js b/src/zone2.js index e44f97c..2f0c583 100644 --- a/src/zone2.js +++ b/src/zone2.js @@ -399,7 +399,7 @@ class Zone2 extends EventEmitter { this.televisionService.setCharacteristic(Characteristic.DisplayOrder, Encode(1, displayOrder).toString('base64')); return true; } catch (error) { - this.emitDeviceInfo('error', error); + throw new Error( error); }; } @@ -409,7 +409,7 @@ class Zone2 extends EventEmitter { const debug = !this.enableDebugMode ? false : this.emit('debug', `Saved data: ${JSON.stringify(data, null, 2)}`); return true; } catch (error) { - this.emitDeviceInfo('error', error); + throw new Error( error); }; } @@ -418,7 +418,7 @@ class Zone2 extends EventEmitter { const data = await fsPromises.readFile(path); return data; } catch (error) { - this.emitDeviceInfo('error', `Read saved data error: ${error}`); + throw new Error( `Read saved data error: ${error}`); }; } @@ -915,7 +915,7 @@ class Zone2 extends EventEmitter { return accessory; } catch (error) { - this.emitDeviceInfo('error', error) + throw new Error( error) }; } }; diff --git a/src/zone3.js b/src/zone3.js index f0774d3..601cccf 100644 --- a/src/zone3.js +++ b/src/zone3.js @@ -399,7 +399,7 @@ class Zone3 extends EventEmitter { this.televisionService.setCharacteristic(Characteristic.DisplayOrder, Encode(1, displayOrder).toString('base64')); return true; } catch (error) { - this.emitDeviceInfo('error', error); + throw new Error( error); }; } @@ -409,7 +409,7 @@ class Zone3 extends EventEmitter { const debug = !this.enableDebugMode ? false : this.emit('debug', `Saved data: ${JSON.stringify(data, null, 2)}`); return true; } catch (error) { - this.emitDeviceInfo('error', error); + throw new Error( error); }; } @@ -418,7 +418,7 @@ class Zone3 extends EventEmitter { const data = await fsPromises.readFile(path); return data; } catch (error) { - this.emitDeviceInfo('error', `Read saved data error: ${error}`); + throw new Error( `Read saved data error: ${error}`); }; } @@ -914,7 +914,7 @@ class Zone3 extends EventEmitter { return accessory; } catch (error) { - this.emitDeviceInfo('error', error) + throw new Error( error) }; } };