homebridge-denon-tv 4.4.2-beta.2 → 4.4.2-beta.4
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/config.schema.json +15 -3
- package/package.json +1 -1
- package/src/denondevice.js +13 -5
package/config.schema.json
CHANGED
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
"title": "Inputs Display Order",
|
|
100
100
|
"type": "integer",
|
|
101
101
|
"minimum": 0,
|
|
102
|
-
"maximum":
|
|
102
|
+
"maximum": 4,
|
|
103
103
|
"default": 0,
|
|
104
104
|
"description": "Here select display order of the inputs list.",
|
|
105
105
|
"oneOf": [
|
|
@@ -110,16 +110,28 @@
|
|
|
110
110
|
]
|
|
111
111
|
},
|
|
112
112
|
{
|
|
113
|
-
"title": "
|
|
113
|
+
"title": "A>Z by Name",
|
|
114
114
|
"enum": [
|
|
115
115
|
1
|
|
116
116
|
]
|
|
117
117
|
},
|
|
118
118
|
{
|
|
119
|
-
"title": "
|
|
119
|
+
"title": "Z>A by Name",
|
|
120
120
|
"enum": [
|
|
121
121
|
2
|
|
122
122
|
]
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"title": "A>Z by Reference",
|
|
126
|
+
"enum": [
|
|
127
|
+
3
|
|
128
|
+
]
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"title": "Z>A by Reference",
|
|
132
|
+
"enum": [
|
|
133
|
+
4
|
|
134
|
+
]
|
|
123
135
|
}
|
|
124
136
|
],
|
|
125
137
|
"required": true
|
package/package.json
CHANGED
package/src/denondevice.js
CHANGED
|
@@ -308,7 +308,7 @@ class DenonDevice extends EventEmitter {
|
|
|
308
308
|
};
|
|
309
309
|
})
|
|
310
310
|
.on('stateChanged', (power, reference, volume, volumeControlType, mute, pictureMode) => {
|
|
311
|
-
const inputIdentifier = this.inputsConfigured.findIndex(
|
|
311
|
+
const inputIdentifier = this.inputsConfigured.findIndex(input => input.reference === reference) ?? -1;
|
|
312
312
|
mute = power ? mute : true;
|
|
313
313
|
pictureMode = CONSTANS.PictureModesConversionToHomeKit[pictureMode];
|
|
314
314
|
|
|
@@ -796,7 +796,7 @@ class DenonDevice extends EventEmitter {
|
|
|
796
796
|
const input = inputs[i];
|
|
797
797
|
|
|
798
798
|
//get index
|
|
799
|
-
const
|
|
799
|
+
const inputIdentifier = i + 1;
|
|
800
800
|
|
|
801
801
|
//get reference
|
|
802
802
|
const inputReference = input.reference;
|
|
@@ -820,7 +820,7 @@ class DenonDevice extends EventEmitter {
|
|
|
820
820
|
const targetVisibility = currentVisibility;
|
|
821
821
|
|
|
822
822
|
if (inputReference && inputName && inputMode) {
|
|
823
|
-
const inputService = new Service.InputSource(`${inputName} ${
|
|
823
|
+
const inputService = new Service.InputSource(`${inputName} ${inputIdentifier}`, `${this.zoneInputSurroundName} ${inputIdentifier}`);
|
|
824
824
|
inputService
|
|
825
825
|
.setCharacteristic(Characteristic.Identifier, index)
|
|
826
826
|
.setCharacteristic(Characteristic.Name, inputName)
|
|
@@ -864,7 +864,9 @@ class DenonDevice extends EventEmitter {
|
|
|
864
864
|
}
|
|
865
865
|
});
|
|
866
866
|
|
|
867
|
-
input.identifier =
|
|
867
|
+
input.identifier = inputIdentifier;
|
|
868
|
+
input.name = inputName;
|
|
869
|
+
input.visibility = currentVisibility;
|
|
868
870
|
this.inputsConfigured.push(input);
|
|
869
871
|
|
|
870
872
|
this.televisionService.addLinkedService(inputService);
|
|
@@ -879,14 +881,20 @@ class DenonDevice extends EventEmitter {
|
|
|
879
881
|
//sort inputs list
|
|
880
882
|
switch (this.inputsDisplayOrder) {
|
|
881
883
|
case 0:
|
|
882
|
-
this.inputsConfigured = this.inputsConfigured
|
|
884
|
+
this.inputsConfigured = this.inputsConfigured;
|
|
883
885
|
break;
|
|
884
886
|
case 1:
|
|
885
887
|
this.inputsConfigured.sort((a, b) => a.name.localeCompare(b.name));
|
|
886
888
|
break;
|
|
887
889
|
case 2:
|
|
890
|
+
this.inputsConfigured.sort((a, b) => b.name.localeCompare(a.name));
|
|
891
|
+
break;
|
|
892
|
+
case 3:
|
|
888
893
|
this.inputsConfigured.sort((a, b) => a.reference.localeCompare(b.reference));
|
|
889
894
|
break;
|
|
895
|
+
case 4:
|
|
896
|
+
this.inputsConfigured.sort((a, b) => b.reference.localeCompare(a.reference));
|
|
897
|
+
break;
|
|
890
898
|
}
|
|
891
899
|
const displayOrder = this.inputsConfigured.map(input => input.identifier);
|
|
892
900
|
this.televisionService.setCharacteristic(Characteristic.DisplayOrder, Encode(1, displayOrder).toString('base64'));
|