Skip to content

Commit

Permalink
bump 3.23.0
Browse files Browse the repository at this point in the history
  • Loading branch information
grzegorz914 committed Feb 8, 2023
1 parent 5984ce9 commit b4ec78a
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 7 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ 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.

## [3.23.0] - (08.02.2023)
## Changes
- added possibility to disable log device connect error
- config.schema updated

## [3.22.0] - (07.02.2023)
## Changes
- added possibility load inputs from device (release)
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ This plugin is based upon the official documentation for communicating with and
| `enableDebugMode` | If enabled, deep log will be present in homebridge console. |
| `disableLogInfo` | If enabled, disable log info, all values and state will not be displayed in Homebridge log console. |
| `disableLogDeviceInfo` | If enabled, add ability to disable log device info by every connections device to the network. |
| `disableLogConnectError` | If enabled, disable logging device connect error. |
| `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 |
| `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 |
| `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 |
Expand Down Expand Up @@ -158,6 +159,7 @@ This plugin is based upon the official documentation for communicating with and
"enableDebugMode": false,
"disableLogInfo": false,
"disableLogDeviceInfo": false,
"disableLogConnectError": false,
"infoButtonCommand": "MNINF",
"refreshInterval": 5,
"enableMqtt": false,
Expand Down Expand Up @@ -214,6 +216,7 @@ This plugin is based upon the official documentation for communicating with and
"enableDebugMode": false,
"disableLogInfo": false,
"disableLogDeviceInfo": false,
"disableLogConnectError": false,
"infoButtonCommand": "MNINF",
"refreshInterval": 5,
"enableMqtt": false,
Expand Down Expand Up @@ -270,6 +273,7 @@ This plugin is based upon the official documentation for communicating with and
"enableDebugMode": false,
"disableLogInfo": false,
"disableLogDeviceInfo": false,
"disableLogConnectError": false,
"infoButtonCommand": "MNINF",
"refreshInterval": 5,
"enableMqtt": false,
Expand Down Expand Up @@ -309,6 +313,7 @@ This plugin is based upon the official documentation for communicating with and
"enableDebugMode": false,
"disableLogInfo": false,
"disableLogDeviceInfo": false,
"disableLogConnectError": false,
"refreshInterval": 5,
"infoButtonCommand": "MNINF",
"enableMqtt": false,
Expand Down
8 changes: 8 additions & 0 deletions config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,13 @@
"description": "This disable log device info by every connections device to the network.",
"required": false
},
"disableLogConnectError": {
"title": "Disable Log Connect Error",
"type": "boolean",
"default": false,
"description": "This disable logging device connect error.",
"required": false
},
"enableDebugMode": {
"title": "Debug",
"type": "boolean",
Expand Down Expand Up @@ -3665,6 +3672,7 @@
"devices[].enableDebugMode",
"devices[].disableLogInfo",
"devices[].disableLogDeviceInfo",
"devices[].disableLogConnectError",
"devices[].masterPower",
"devices[].masterVolume",
"devices[].masterMute",
Expand Down
6 changes: 4 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ class denonTvDevice {
this.sensorInputs = config.sensorInputs || [];
this.disableLogInfo = config.disableLogInfo || false;
this.disableLogDeviceInfo = config.disableLogDeviceInfo || false;
this.disableLogConnectError = config.disableLogConnectError || false;
this.enableDebugMode = config.enableDebugMode || false;
this.getInputsFromDevice = config.getInputsFromDevice || false;
this.inputs = config.inputs || [];
Expand Down Expand Up @@ -171,6 +172,7 @@ class denonTvDevice {
host: this.host,
port: this.port,
debugLog: this.enableDebugMode,
disableLogConnectError: this.disableLogConnectError,
zoneControl: this.zoneControl,
refreshInterval: this.refreshInterval,
mqttEnabled: this.mqttEnabled
Expand Down Expand Up @@ -346,8 +348,8 @@ class denonTvDevice {
}

if (!this.getInputsFromDevice && this.inputSwitchButtonServices) {
const switchServicesCount = this.inputSwitchButtonServices.length;
for (let i = 0; i < switchServicesCount; i++) {
const switchButtonServicesCount = this.inputSwitchButtonServices.length;
for (let i = 0; i < switchButtonServicesCount; i++) {
const index = this.inputsSwitchesButtons[i];
const state = power ? (this.inputsReference[index] === reference) : false;
const displayType = this.inputsDisplayType[index];
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"displayName": "Denon TV",
"name": "homebridge-denon-tv",
"version": "3.22.3",
"version": "3.23.0",
"description": "Homebridge plugin (https://github.com/homebridge/homebridge) to control Denon/Marantz AV Receivers.",
"license": "MIT",
"author": "grzegorz914",
Expand Down Expand Up @@ -30,7 +30,7 @@
"dependencies": {
"async-mqtt": "^2.6.3",
"axios": "^1.3.2",
"xml2js": ">=0.4.23"
"xml2js": "^0.4.23"
},
"keywords": [
"homebridge",
Expand Down
4 changes: 4 additions & 0 deletions sample-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
"enableDebugMode": false,
"disableLogInfo": false,
"disableLogDeviceInfo": false,
"disableLogConnectError": false,
"infoButtonCommand": "MNINF",
"refreshInterval": 5,
"enableMqtt": false,
Expand Down Expand Up @@ -119,6 +120,7 @@
"enableDebugMode": false,
"disableLogInfo": false,
"disableLogDeviceInfo": false,
"disableLogConnectError": false,
"infoButtonCommand": "MNINF",
"refreshInterval": 5,
"enableMqtt": false,
Expand Down Expand Up @@ -175,6 +177,7 @@
"enableDebugMode": false,
"disableLogInfo": false,
"disableLogDeviceInfo": false,
"disableLogConnectError": false,
"infoButtonCommand": "MNINF",
"refreshInterval": 5,
"enableMqtt": false,
Expand Down Expand Up @@ -214,6 +217,7 @@
"enableDebugMode": false,
"disableLogInfo": false,
"disableLogDeviceInfo": false,
"disableLogConnectError": false,
"infoButtonCommand": "MNINF",
"refreshInterval": 5,
"enableMqtt": false,
Expand Down
7 changes: 4 additions & 3 deletions src/denon.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class DENON extends EventEmitter {
const host = config.host;
const port = config.port;
const debugLog = config.debugLog;
const disableLogConnectError = config.disableLogConnectError;
const zoneControl = config.zoneControl;
const mqttEnabled = config.mqttEnabled;
this.refreshInterval = config.refreshInterval;
Expand Down Expand Up @@ -74,7 +75,7 @@ class DENON extends EventEmitter {
await new Promise(resolve => setTimeout(resolve, 1000));
this.emit('checkState');
} catch (error) {
this.emit('error', `Info error: ${error}, reconnect in 15s.`)
const debug = disableLogConnectError ? false : this.emit('error', `Info error: ${error}, reconnect in 15s.`)
this.checkDeviceInfo();
};
})
Expand Down Expand Up @@ -110,7 +111,7 @@ class DENON extends EventEmitter {
const mqtt2 = mqttEnabled && zoneControl === 3 ? this.emit('mqtt', 'Sound Mode', JSON.stringify({ 'surround': zoneControl === 3 ? reference : '' }, null, 2)) : false;
this.checkState();
} catch (error) {
this.emit('error', `State error: ${error}, reconnect in 15s.`);
const debug = disableLogConnectError ? false : this.emit('error', `State error: ${error}, reconnect in 15s.`);
const firstRun = this.checkStateOnFirstRun ? this.checkDeviceInfo() : this.emit('disconnect');
};
})
Expand Down Expand Up @@ -139,7 +140,7 @@ class DENON extends EventEmitter {
await this.axiosInstance(apiUrl);
resolve(true);
} catch (error) {
this.emit('error', `Send command error: ${error}`);
this.emit('error', error);
reject(error);
};
});
Expand Down

0 comments on commit b4ec78a

Please sign in to comment.