From 11785ae5face2321eb31438a2611e4c72f22b6c5 Mon Sep 17 00:00:00 2001 From: Grzegorz Date: Sun, 8 Sep 2024 07:07:31 +0200 Subject: [PATCH] fix #282 --- CHANGELOG.md | 7 +++++++ package.json | 2 +- src/mainzone.js | 4 ++-- src/surround.js | 4 ++-- src/zone2.js | 4 ++-- src/zone3.js | 4 ++-- 6 files changed, 16 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8811969..d91efbb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - after update to 4.7.x buttons, sensors, volume display type need to be configure again using config UI - after update to 3.15.x need remove the accessory frome Home app and add it again +## [5.1.11] - (07.09.2024) + +## Changes + +- fix [#282](https://github.com/grzegorz914/homebridge-denon-tv/issues/282) +- cleanup + ## [5.1.5] - (06.09.2024) ## Changes diff --git a/package.json b/package.json index a82a418..26bad89 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "displayName": "Denon TV", "name": "homebridge-denon-tv", - "version": "5.1.10", + "version": "5.1.11", "description": "Homebridge plugin to control Denon/Marantz AV Receivers.", "license": "MIT", "author": "grzegorz914", diff --git a/src/mainzone.js b/src/mainzone.js index db7bc05..6e299e4 100644 --- a/src/mainzone.js +++ b/src/mainzone.js @@ -252,7 +252,7 @@ class MainZone extends EventEmitter { this.pictureMode = pictureModeHomeKit; if (!this.disableLogInfo) { - const name = index !== -1 ? this.inputsConfigured[index].name : reference; + const name = input ? input.name : reference; this.emit('message', `Power: ${power ? 'ON' : 'OFF'}`); this.emit('message', `Input Name: ${name}`); this.emit('message', `Reference: ${reference}`); @@ -388,7 +388,7 @@ class MainZone extends EventEmitter { return true; } catch (error) { - await this.denon.impulseGenerato.stop(); + await this.denon.impulseGenerator.stop(); throw new Error(`Start error: ${error.message || error}, check again in 15s.`); }; }; diff --git a/src/surround.js b/src/surround.js index 874a43d..3d511bd 100644 --- a/src/surround.js +++ b/src/surround.js @@ -220,7 +220,7 @@ class Surround extends EventEmitter { this.pictureMode = pictureModeHomeKit; if (!this.disableLogInfo) { - const name = index !== -1 ? this.inputsConfigured[index].name : reference; + const name = input ? input.name : reference; this.emit('message', `Power: ${power ? 'ON' : 'OFF'}`); this.emit('message', `Surround Name: ${name}`); this.emit('message', `Reference: ${reference}`); @@ -356,7 +356,7 @@ class Surround extends EventEmitter { return true; } catch (error) { - await this.denon.impulseGenerato.stop(); + await this.denon.impulseGenerator.stop(); throw new Error(`Start error: ${error.message || error}, check again in 15s.`); }; }; diff --git a/src/zone2.js b/src/zone2.js index 88ae137..d35bbb8 100644 --- a/src/zone2.js +++ b/src/zone2.js @@ -250,7 +250,7 @@ class Zone2 extends EventEmitter { this.pictureMode = pictureModeHomeKit; if (!this.disableLogInfo) { - const name = index !== -1 ? this.inputsConfigured[index].name : reference; + const name = input ? input.name : reference; this.emit('message', `Power: ${power ? 'ON' : 'OFF'}`); this.emit('message', `Input Name: ${name}`); this.emit('message', `Reference: ${reference}`); @@ -386,7 +386,7 @@ class Zone2 extends EventEmitter { return true; } catch (error) { - await this.denon.impulseGenerato.stop(); + await this.denon.impulseGenerator.stop(); throw new Error(`Start error: ${error.message || error}, check again in 15s.`); }; }; diff --git a/src/zone3.js b/src/zone3.js index d3c3205..f057aca 100644 --- a/src/zone3.js +++ b/src/zone3.js @@ -250,7 +250,7 @@ class Zone3 extends EventEmitter { this.pictureMode = pictureModeHomeKit; if (!this.disableLogInfo) { - const name = index !== -1 ? this.inputsConfigured[index].name : reference; + const name = input ? input.name : reference; this.emit('message', `Power: ${power ? 'ON' : 'OFF'}`); this.emit('message', `Input Name: ${name}`); this.emit('message', `Reference: ${reference}`); @@ -386,7 +386,7 @@ class Zone3 extends EventEmitter { return true; } catch (error) { - await this.denon.impulseGenerato.stop(); + await this.denon.impulseGenerator.stop(); throw new Error(`Start error: ${error.message || error}, check again in 15s.`); }; };