homebridge-denon-tv 3.22.3 → 3.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
 
7
7
  ## Note - after update to 3.15.x need remove the accessory frome Home app and add it again.
8
8
 
9
+ ## [3.23.0] - (08.02.2023)
10
+ ## Changes
11
+ - added possibility to disable log device connect error
12
+ - config.schema updated
13
+
9
14
  ## [3.22.0] - (07.02.2023)
10
15
  ## Changes
11
16
  - added possibility load inputs from device (release)
package/README.md CHANGED
@@ -63,18 +63,6 @@ This plugin is based upon the official documentation for communicating with and
63
63
  | `host` | Here set the *Hsostname or Address IP* of TV. |
64
64
  | `port` | Here set the API communication port, if `8080` is not working try to use port `80` which some receivers use alternatively. |
65
65
  | `zoneControl` | Selects which zone will be controlled by this section (`0` - Main Zone, `1` - Zone 2, `2` - Zone 3, `3` - Surround Mode) or choice from the configurations GUI |
66
- | `masterPower` | If enabled, then the Power switch for that zone (typically you would only use this for the Main Zone) will turn the entire receiver `ON` or `OFF/STANDBY` rather than just the zone itself |
67
- | `masterVolume`| If enabled, then the Volume for that zone (typically you would only use this for the Main Zone) will set the entire receiver `UP` or `DOWN` rather than just the zone itself |
68
- | `masterMute`| If enabled, then the Mute switch for that zone (typically you would only use this for the Main Zone) will muted the entire receiver `ON` or `OFF` rather than just the zone itself |
69
- | `sensorPower`| If enabled, then the Power will be exposed as a `Motion Sensor` (active on Power ON) to use with automations. |
70
- | `sensorVolume`| If enabled, then the Volume will be exposed as a `Motion Sensor` (active on every Volume change) to use with automations. |
71
- | `sensorMute`| If enabled, then the Mute will be exposed as a `Motion Sensor` (active on Mute ON) to use with automations. |
72
- | `sensorInput`| If enabled, then the Input will be exposed as a `Motion Sensor` (active on every Input change) to use with automations. |
73
- | `sensorInputs.name` | Here set own *Name* which You want expose to the *Homebridge/HomeKit* for this sensor. |
74
- | `sensorInputs.reference` | Here set *Reference* like `CBL/SAT`, `GAME` to be exposed as sensor (active on switch to this Input). |
75
- | `sensorInputs.displayType` | Here select sensor type to be exposed in HomeKit app, possible `None`, `Motion Sensor`, `Occupancy Sensor`, `Contact Sensor`. |
76
- | `volumeControl` | Here choice what a additional volume control mode You want to use (None, Lightbulb, Fan). |
77
- | `infoButtonCommand` | Here select the function of `I` button in RC app. |
78
66
  | `getInputsFromDevice` | This enable load inputs and quick select direct from device. |
79
67
  | `inputs.name` | Here set *Input Name* which You want expose to the *Homebridge/HomeKit*. |
80
68
  | `inputs.reference` | Choose from available inputs, the inputs that should be published to and appear in HomeKit app in the device tile as inputs list |
@@ -89,12 +77,25 @@ This plugin is based upon the official documentation for communicating with and
89
77
  | `buttonsZone3.name` | Here set *Button Name* which You want expose to the *Homebridge/HomeKit*. |
90
78
  | `buttonsZone3.reference` | Here choice function for additional control button for Zone 3. |
91
79
  | `buttonsZone3.displayType` | Here select display type in HomeKit app, possible `None`, `Button`, `Switch`.|
80
+ | `sensorPower`| If enabled, then the Power will be exposed as a `Motion Sensor` (active on Power ON) to use with automations. |
81
+ | `sensorVolume`| If enabled, then the Volume will be exposed as a `Motion Sensor` (active on every Volume change) to use with automations. |
82
+ | `sensorMute`| If enabled, then the Mute will be exposed as a `Motion Sensor` (active on Mute ON) to use with automations. |
83
+ | `sensorInput`| If enabled, then the Input will be exposed as a `Motion Sensor` (active on every Input change) to use with automations. |
84
+ | `sensorInputs.name` | Here set own *Name* which You want expose to the *Homebridge/HomeKit* for this sensor. |
85
+ | `sensorInputs.reference` | Here set *Reference* like `CBL/SAT`, `GAME` to be exposed as sensor (active on switch to this Input). |
86
+ | `sensorInputs.displayType` | Here select sensor type to be exposed in HomeKit app, possible `None`, `Motion Sensor`, `Occupancy Sensor`, `Contact Sensor`. |
92
87
  | `surrounds.name` | Here set *Surround Mode Name* which You want expose to the *Homebridge/HomeKit*. |
93
88
  | `surrounds.reference` | Here choice *Surround Mode*, the mode that should be published to and appear in HomeKit app in the extra tile as Surrounds List. |
94
89
  | `surrounds.displayType` | Here select display type in HomeKit app, possible `None`, `Button`, `Switch`.|
95
90
  | `enableDebugMode` | If enabled, deep log will be present in homebridge console. |
96
91
  | `disableLogInfo` | If enabled, disable log info, all values and state will not be displayed in Homebridge log console. |
97
92
  | `disableLogDeviceInfo` | If enabled, add ability to disable log device info by every connections device to the network. |
93
+ | `disableLogConnectError` | If enabled, disable logging device connect error. |
94
+ | `masterPower` | If enabled, then the Power switch for that zone (typically you would only use this for the Main Zone) will turn the entire receiver `ON` or `OFF/STANDBY` rather than just the zone itself |
95
+ | `masterVolume`| If enabled, then the Volume for that zone (typically you would only use this for the Main Zone) will set the entire receiver `UP` or `DOWN` rather than just the zone itself |
96
+ | `masterMute`| If enabled, then the Mute switch for that zone (typically you would only use this for the Main Zone) will muted the entire receiver `ON` or `OFF` rather than just the zone itself |
97
+ | `volumeControl` | Here choice what a additional volume control mode You want to use (None, Lightbulb, Fan). |
98
+ | `infoButtonCommand` | Here select the function of `I` button in RC app. |
98
99
  | `refreshInterval` | Here set the data refresh interval. |
99
100
  | `enableMqtt` | If enabled, MQTT Broker will start automatically and publish all awailable PV installation data. |
100
101
  | `mqttHost` | Here set the *IP Address* or *Hostname* for MQTT Broker. |
@@ -158,6 +159,7 @@ This plugin is based upon the official documentation for communicating with and
158
159
  "enableDebugMode": false,
159
160
  "disableLogInfo": false,
160
161
  "disableLogDeviceInfo": false,
162
+ "disableLogConnectError": false,
161
163
  "infoButtonCommand": "MNINF",
162
164
  "refreshInterval": 5,
163
165
  "enableMqtt": false,
@@ -214,6 +216,7 @@ This plugin is based upon the official documentation for communicating with and
214
216
  "enableDebugMode": false,
215
217
  "disableLogInfo": false,
216
218
  "disableLogDeviceInfo": false,
219
+ "disableLogConnectError": false,
217
220
  "infoButtonCommand": "MNINF",
218
221
  "refreshInterval": 5,
219
222
  "enableMqtt": false,
@@ -270,6 +273,7 @@ This plugin is based upon the official documentation for communicating with and
270
273
  "enableDebugMode": false,
271
274
  "disableLogInfo": false,
272
275
  "disableLogDeviceInfo": false,
276
+ "disableLogConnectError": false,
273
277
  "infoButtonCommand": "MNINF",
274
278
  "refreshInterval": 5,
275
279
  "enableMqtt": false,
@@ -309,6 +313,7 @@ This plugin is based upon the official documentation for communicating with and
309
313
  "enableDebugMode": false,
310
314
  "disableLogInfo": false,
311
315
  "disableLogDeviceInfo": false,
316
+ "disableLogConnectError": false,
312
317
  "refreshInterval": 5,
313
318
  "infoButtonCommand": "MNINF",
314
319
  "enableMqtt": false,
@@ -239,6 +239,13 @@
239
239
  "description": "This disable log device info by every connections device to the network.",
240
240
  "required": false
241
241
  },
242
+ "disableLogConnectError": {
243
+ "title": "Disable Log Connect Error",
244
+ "type": "boolean",
245
+ "default": false,
246
+ "description": "This disable logging device connect error.",
247
+ "required": false
248
+ },
242
249
  "enableDebugMode": {
243
250
  "title": "Debug",
244
251
  "type": "boolean",
@@ -3665,6 +3672,7 @@
3665
3672
  "devices[].enableDebugMode",
3666
3673
  "devices[].disableLogInfo",
3667
3674
  "devices[].disableLogDeviceInfo",
3675
+ "devices[].disableLogConnectError",
3668
3676
  "devices[].masterPower",
3669
3677
  "devices[].masterVolume",
3670
3678
  "devices[].masterMute",
package/index.js CHANGED
@@ -78,6 +78,7 @@ class denonTvDevice {
78
78
  this.sensorInputs = config.sensorInputs || [];
79
79
  this.disableLogInfo = config.disableLogInfo || false;
80
80
  this.disableLogDeviceInfo = config.disableLogDeviceInfo || false;
81
+ this.disableLogConnectError = config.disableLogConnectError || false;
81
82
  this.enableDebugMode = config.enableDebugMode || false;
82
83
  this.getInputsFromDevice = config.getInputsFromDevice || false;
83
84
  this.inputs = config.inputs || [];
@@ -171,6 +172,7 @@ class denonTvDevice {
171
172
  host: this.host,
172
173
  port: this.port,
173
174
  debugLog: this.enableDebugMode,
175
+ disableLogConnectError: this.disableLogConnectError,
174
176
  zoneControl: this.zoneControl,
175
177
  refreshInterval: this.refreshInterval,
176
178
  mqttEnabled: this.mqttEnabled
@@ -346,8 +348,8 @@ class denonTvDevice {
346
348
  }
347
349
 
348
350
  if (!this.getInputsFromDevice && this.inputSwitchButtonServices) {
349
- const switchServicesCount = this.inputSwitchButtonServices.length;
350
- for (let i = 0; i < switchServicesCount; i++) {
351
+ const switchButtonServicesCount = this.inputSwitchButtonServices.length;
352
+ for (let i = 0; i < switchButtonServicesCount; i++) {
351
353
  const index = this.inputsSwitchesButtons[i];
352
354
  const state = power ? (this.inputsReference[index] === reference) : false;
353
355
  const displayType = this.inputsDisplayType[index];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "Denon TV",
3
3
  "name": "homebridge-denon-tv",
4
- "version": "3.22.3",
4
+ "version": "3.23.0",
5
5
  "description": "Homebridge plugin (https://github.com/homebridge/homebridge) to control Denon/Marantz AV Receivers.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",
@@ -30,7 +30,7 @@
30
30
  "dependencies": {
31
31
  "async-mqtt": "^2.6.3",
32
32
  "axios": "^1.3.2",
33
- "xml2js": ">=0.4.23"
33
+ "xml2js": "^0.4.23"
34
34
  },
35
35
  "keywords": [
36
36
  "homebridge",
package/src/denon.js CHANGED
@@ -22,6 +22,7 @@ class DENON extends EventEmitter {
22
22
  const host = config.host;
23
23
  const port = config.port;
24
24
  const debugLog = config.debugLog;
25
+ const disableLogConnectError = config.disableLogConnectError;
25
26
  const zoneControl = config.zoneControl;
26
27
  const mqttEnabled = config.mqttEnabled;
27
28
  this.refreshInterval = config.refreshInterval;
@@ -74,7 +75,7 @@ class DENON extends EventEmitter {
74
75
  await new Promise(resolve => setTimeout(resolve, 1000));
75
76
  this.emit('checkState');
76
77
  } catch (error) {
77
- this.emit('error', `Info error: ${error}, reconnect in 15s.`)
78
+ const debug = disableLogConnectError ? false : this.emit('error', `Info error: ${error}, reconnect in 15s.`)
78
79
  this.checkDeviceInfo();
79
80
  };
80
81
  })
@@ -110,7 +111,7 @@ class DENON extends EventEmitter {
110
111
  const mqtt2 = mqttEnabled && zoneControl === 3 ? this.emit('mqtt', 'Sound Mode', JSON.stringify({ 'surround': zoneControl === 3 ? reference : '' }, null, 2)) : false;
111
112
  this.checkState();
112
113
  } catch (error) {
113
- this.emit('error', `State error: ${error}, reconnect in 15s.`);
114
+ const debug = disableLogConnectError ? false : this.emit('error', `State error: ${error}, reconnect in 15s.`);
114
115
  const firstRun = this.checkStateOnFirstRun ? this.checkDeviceInfo() : this.emit('disconnect');
115
116
  };
116
117
  })
@@ -139,7 +140,7 @@ class DENON extends EventEmitter {
139
140
  await this.axiosInstance(apiUrl);
140
141
  resolve(true);
141
142
  } catch (error) {
142
- this.emit('error', `Send command error: ${error}`);
143
+ this.emit('error', error);
143
144
  reject(error);
144
145
  };
145
146
  });