homebridge-denon-tv 3.19.0 → 3.19.2
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 +5 -0
- package/README.md +4 -4
- package/config.schema.json +6 -6
- package/index.js +24 -24
- package/package.json +2 -2
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.19.1] - (15.01.2023)
|
|
10
|
+
## Changes
|
|
11
|
+
- changed Motion Sensor to Contact Sensor
|
|
12
|
+
- fix Input/Surrounds Sensor
|
|
13
|
+
|
|
9
14
|
## [3.19.0] - (14.01.2023)
|
|
10
15
|
## Changes
|
|
11
16
|
- added Input/Surround Motion Sensor for use with automations (every Input/Surround change report motion)
|
package/README.md
CHANGED
|
@@ -64,12 +64,12 @@ This plugin is based upon the official documentation for communicating with and
|
|
|
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
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
|
-
| `sensorPower`| If enabled, then the Power will be exposed as a `
|
|
67
|
+
| `sensorPower`| If enabled, then the Power will be exposed as a `Contact Sensor` to use with automations. |
|
|
68
68
|
| `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 |
|
|
69
|
-
| `sensorVolume`| If enabled, then the Volume will be exposed as a `
|
|
69
|
+
| `sensorVolume`| If enabled, then the Volume will be exposed as a `Contact Sensor` to use with automations. |
|
|
70
70
|
| `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 |
|
|
71
|
-
| `sensorMute`| If enabled, then the Mute will be exposed as a `
|
|
72
|
-
| `sensorInput`| If enabled, then the Input will be exposed as a `
|
|
71
|
+
| `sensorMute`| If enabled, then the Mute will be exposed as a `Contact Sensor` to use with automations. |
|
|
72
|
+
| `sensorInput`| If enabled, then the Input will be exposed as a `Contact Sensor` to use with automations. |
|
|
73
73
|
| `volumeControl` | Here choice what a additional volume control mode You want to use (None, Lightbulb, Fan). |
|
|
74
74
|
| `infoButtonCommand` | Here select the function of `I` button in RC app. |
|
|
75
75
|
| `inputs.name` | Here set *Input Name* which You want expose to the *Homebridge/HomeKit*. |
|
package/config.schema.json
CHANGED
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
"title": "Power",
|
|
108
108
|
"type": "boolean",
|
|
109
109
|
"default": false,
|
|
110
|
-
"description": "This expose Power as a
|
|
110
|
+
"description": "This expose Power as a Contact Sensor to use with automations.",
|
|
111
111
|
"required": false
|
|
112
112
|
},
|
|
113
113
|
"masterVolume": {
|
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
"title": "Volume",
|
|
122
122
|
"type": "boolean",
|
|
123
123
|
"default": false,
|
|
124
|
-
"description": "This expose Volume as a
|
|
124
|
+
"description": "This expose Volume as a Contact Sensor to use with automations.",
|
|
125
125
|
"required": false
|
|
126
126
|
},
|
|
127
127
|
"masterMute": {
|
|
@@ -135,14 +135,14 @@
|
|
|
135
135
|
"title": "Mute",
|
|
136
136
|
"type": "boolean",
|
|
137
137
|
"default": false,
|
|
138
|
-
"description": "This expose Mute as a
|
|
138
|
+
"description": "This expose Mute as a Contact Sensor to use with automations.",
|
|
139
139
|
"required": false
|
|
140
140
|
},
|
|
141
141
|
"sensorInput": {
|
|
142
142
|
"title": "Input",
|
|
143
143
|
"type": "boolean",
|
|
144
144
|
"default": false,
|
|
145
|
-
"description": "This expose Input as a
|
|
145
|
+
"description": "This expose Input as a Contact Sensor to use with automations.",
|
|
146
146
|
"required": false
|
|
147
147
|
},
|
|
148
148
|
"infoButtonCommand": {
|
|
@@ -599,7 +599,7 @@
|
|
|
599
599
|
]
|
|
600
600
|
},
|
|
601
601
|
{
|
|
602
|
-
"title": "
|
|
602
|
+
"title": "Contact Sensor",
|
|
603
603
|
"enum": [
|
|
604
604
|
2
|
|
605
605
|
]
|
|
@@ -806,7 +806,7 @@
|
|
|
806
806
|
]
|
|
807
807
|
},
|
|
808
808
|
{
|
|
809
|
-
"title": "
|
|
809
|
+
"title": "Contact Sensor",
|
|
810
810
|
"enum": [
|
|
811
811
|
2
|
|
812
812
|
]
|
package/index.js
CHANGED
|
@@ -73,8 +73,8 @@ class denonTvDevice {
|
|
|
73
73
|
this.masterVolume = config.masterVolume || false;
|
|
74
74
|
this.sensorVolume = config.sensorVolume || false
|
|
75
75
|
this.masterMute = config.masterMute || false;
|
|
76
|
-
this.sensorMute = config.sensorMute || false
|
|
77
|
-
this.sensorInput = config.sensorInput || false
|
|
76
|
+
this.sensorMute = config.sensorMute || false;
|
|
77
|
+
this.sensorInput = config.sensorInput || false;
|
|
78
78
|
this.disableLogInfo = config.disableLogInfo || false;
|
|
79
79
|
this.disableLogDeviceInfo = config.disableLogDeviceInfo || false;
|
|
80
80
|
this.enableDebugMode = config.enableDebugMode || false;
|
|
@@ -109,12 +109,12 @@ class denonTvDevice {
|
|
|
109
109
|
//setup variables
|
|
110
110
|
this.startPrepareAccessory = true;
|
|
111
111
|
|
|
112
|
-
this.inputsReference =
|
|
113
|
-
this.inputsName =
|
|
114
|
-
this.inputsType =
|
|
115
|
-
this.inputsMode =
|
|
116
|
-
this.switches =
|
|
117
|
-
this.switchesDisplayType =
|
|
112
|
+
this.inputsReference = [];
|
|
113
|
+
this.inputsName = [];
|
|
114
|
+
this.inputsType = [];
|
|
115
|
+
this.inputsMode = [];
|
|
116
|
+
this.switches = [];
|
|
117
|
+
this.switchesDisplayType = [];
|
|
118
118
|
|
|
119
119
|
this.power = false;
|
|
120
120
|
this.reference = '';
|
|
@@ -275,26 +275,26 @@ class denonTvDevice {
|
|
|
275
275
|
|
|
276
276
|
if (this.sensorPowerService) {
|
|
277
277
|
this.sensorPowerService
|
|
278
|
-
.updateCharacteristic(Characteristic.
|
|
278
|
+
.updateCharacteristic(Characteristic.ContactSensorState, power)
|
|
279
279
|
}
|
|
280
280
|
|
|
281
281
|
if (this.sensorVolumeService) {
|
|
282
282
|
const state = (this.volume !== volume) ? true : false;
|
|
283
283
|
this.sensorVolumeService
|
|
284
|
-
.updateCharacteristic(Characteristic.
|
|
284
|
+
.updateCharacteristic(Characteristic.ContactSensorState, state)
|
|
285
285
|
this.sensorVolumeState = state;
|
|
286
286
|
}
|
|
287
287
|
|
|
288
288
|
if (this.sensorMuteService) {
|
|
289
289
|
const state = power ? mute : false;
|
|
290
290
|
this.sensorMuteService
|
|
291
|
-
.updateCharacteristic(Characteristic.
|
|
291
|
+
.updateCharacteristic(Characteristic.ContactSensorState, state)
|
|
292
292
|
}
|
|
293
293
|
|
|
294
294
|
if (this.sensorInputService) {
|
|
295
295
|
const state = (this.inputIdentifier !== inputIdentifier) ? true : false;
|
|
296
296
|
this.sensorInputService
|
|
297
|
-
.updateCharacteristic(Characteristic.
|
|
297
|
+
.updateCharacteristic(Characteristic.ContactSensorState, state)
|
|
298
298
|
this.sensorInputState = state;
|
|
299
299
|
}
|
|
300
300
|
|
|
@@ -304,7 +304,7 @@ class denonTvDevice {
|
|
|
304
304
|
const index = this.switches[i];
|
|
305
305
|
const state = power ? (this.inputsReference[index] === reference) : false;
|
|
306
306
|
const displayType = this.switchesDisplayType[index];
|
|
307
|
-
const characteristicType = [Characteristic.On, Characteristic.On, Characteristic.
|
|
307
|
+
const characteristicType = [Characteristic.On, Characteristic.On, Characteristic.ContactSensorState, Characteristic.OccupancyDetected][displayType];
|
|
308
308
|
this.switchServices[i]
|
|
309
309
|
.updateCharacteristic(characteristicType, state);
|
|
310
310
|
}
|
|
@@ -715,8 +715,8 @@ class denonTvDevice {
|
|
|
715
715
|
//prepare sensor service
|
|
716
716
|
if (this.sensorPower) {
|
|
717
717
|
this.log.debug('prepareSensorPowerService')
|
|
718
|
-
this.sensorPowerService = new Service.
|
|
719
|
-
this.sensorPowerService.getCharacteristic(Characteristic.
|
|
718
|
+
this.sensorPowerService = new Service.ContactSensor(`${this.sZoneName} Power Sensor`, `Power Sensor`);
|
|
719
|
+
this.sensorPowerService.getCharacteristic(Characteristic.ContactSensorState)
|
|
720
720
|
.onGet(async () => {
|
|
721
721
|
const state = this.power;
|
|
722
722
|
return state;
|
|
@@ -726,8 +726,8 @@ class denonTvDevice {
|
|
|
726
726
|
|
|
727
727
|
if (this.sensorVolume) {
|
|
728
728
|
this.log.debug('prepareSensorVolumeService')
|
|
729
|
-
this.sensorVolumeService = new Service.
|
|
730
|
-
this.sensorVolumeService.getCharacteristic(Characteristic.
|
|
729
|
+
this.sensorVolumeService = new Service.ContactSensor(`${this.sZoneName} Volume Sensor`, `Volume Sensor`);
|
|
730
|
+
this.sensorVolumeService.getCharacteristic(Characteristic.ContactSensorState)
|
|
731
731
|
.onGet(async () => {
|
|
732
732
|
const state = this.sensorVolumeState;
|
|
733
733
|
return state;
|
|
@@ -737,8 +737,8 @@ class denonTvDevice {
|
|
|
737
737
|
|
|
738
738
|
if (this.sensorMute) {
|
|
739
739
|
this.log.debug('prepareSensorMuteService')
|
|
740
|
-
this.sensorMuteService = new Service.
|
|
741
|
-
this.sensorMuteService.getCharacteristic(Characteristic.
|
|
740
|
+
this.sensorMuteService = new Service.ContactSensor(`${this.sZoneName} Mute Sensor`, `Mute Sensor`);
|
|
741
|
+
this.sensorMuteService.getCharacteristic(Characteristic.ContactSensorState)
|
|
742
742
|
.onGet(async () => {
|
|
743
743
|
const state = this.power ? this.mute : false;
|
|
744
744
|
return state;
|
|
@@ -748,8 +748,8 @@ class denonTvDevice {
|
|
|
748
748
|
|
|
749
749
|
if (this.sensorInput) {
|
|
750
750
|
this.log.debug('prepareSensorChannelService')
|
|
751
|
-
this.sensorInputService = new Service.
|
|
752
|
-
this.sensorInputService.getCharacteristic(Characteristic.
|
|
751
|
+
this.sensorInputService = new Service.ContactSensor(`${this.sZoneName} Input Sensor`, `Input Sensor`);
|
|
752
|
+
this.sensorInputService.getCharacteristic(Characteristic.ContactSensorState)
|
|
753
753
|
.onGet(async () => {
|
|
754
754
|
const state = this.sensorInputState;
|
|
755
755
|
return state;
|
|
@@ -860,7 +860,7 @@ class denonTvDevice {
|
|
|
860
860
|
const maxSwitchesCount = (availableSwitchesCount > 0) ? (availableSwitchesCount > switchesCount) ? switchesCount : availableSwitchesCount : 0;
|
|
861
861
|
if (maxSwitchesCount > 0) {
|
|
862
862
|
this.log.debug('prepareSwitchsService');
|
|
863
|
-
this.switchServices =
|
|
863
|
+
this.switchServices = [];
|
|
864
864
|
for (let i = 0; i < maxSwitchesCount; i++) {
|
|
865
865
|
//get switch
|
|
866
866
|
const inputSwitch = switches[i];
|
|
@@ -877,8 +877,8 @@ class denonTvDevice {
|
|
|
877
877
|
//get switch display type
|
|
878
878
|
const inputSwitchDisplayType = this.switchesDisplayType[inputSwitch];
|
|
879
879
|
|
|
880
|
-
const serviceType = [Service.Outlet, Service.Switch, Service.
|
|
881
|
-
const characteristicType = [Characteristic.On, Characteristic.On, Characteristic.
|
|
880
|
+
const serviceType = [Service.Outlet, Service.Switch, Service.ContactSensor, Service.OccupancySensor][inputSwitchDisplayType];
|
|
881
|
+
const characteristicType = [Characteristic.On, Characteristic.On, Characteristic.ContactSensorState, Characteristic.OccupancyDetected][inputSwitchDisplayType];
|
|
882
882
|
const switchService = new serviceType(`${this.sZoneName} ${inputSwitchName}`, `Sensor ${i}`);
|
|
883
883
|
switchService.getCharacteristic(characteristicType)
|
|
884
884
|
.onGet(async () => {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"displayName": "Denon TV",
|
|
3
3
|
"name": "homebridge-denon-tv",
|
|
4
|
-
"version": "3.19.
|
|
4
|
+
"version": "3.19.2",
|
|
5
5
|
"description": "Homebridge plugin (https://github.com/homebridge/homebridge) to control Denon/Marantz AV Receivers.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "grzegorz914",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"async-mqtt": "^2.6.3",
|
|
32
|
-
"axios": "^1.2.
|
|
32
|
+
"axios": "^1.2.3",
|
|
33
33
|
"xml2js": ">=0.4.23"
|
|
34
34
|
},
|
|
35
35
|
"keywords": [
|