homebridge-xbox-tv 3.3.9-beta.2 → 3.3.9
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 +6 -0
- package/package.json +1 -1
- package/src/xboxdevice.js +21 -23
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
10
10
|
- After update to 2.x.x the plugin settings (xboxLiveId) need to be updated
|
|
11
11
|
- After update to v3.0.0 RESTFull and MQTT config settings need to be updated
|
|
12
12
|
|
|
13
|
+
## [3.3.9] - (07.02.2025)
|
|
14
|
+
|
|
15
|
+
## Changes
|
|
16
|
+
|
|
17
|
+
- stability and improvements
|
|
18
|
+
|
|
13
19
|
## [3.3.8] - (07.02.2025)
|
|
14
20
|
|
|
15
21
|
## Changes
|
package/package.json
CHANGED
package/src/xboxdevice.js
CHANGED
|
@@ -25,8 +25,6 @@ class XboxDevice extends EventEmitter {
|
|
|
25
25
|
this.xboxLiveId = device.xboxLiveId;
|
|
26
26
|
this.webApiControl = device.webApiControl || false;
|
|
27
27
|
this.webApiPowerOnOff = this.webApiControl ? device.webApiPowerOnOff : false;
|
|
28
|
-
this.webApiRcControl = this.webApiControl ? device.webApiRcControl : false;
|
|
29
|
-
this.webApiVolumeControl = this.webApiControl ? device.webApiVolumeControl : false;
|
|
30
28
|
this.getInputsFromDevice = this.webApiControl ? device.getInputsFromDevice : false;
|
|
31
29
|
this.filterGames = device.filterGames || false;
|
|
32
30
|
this.filterApps = device.filterApps || false;
|
|
@@ -164,7 +162,7 @@ class XboxDevice extends EventEmitter {
|
|
|
164
162
|
let set = false
|
|
165
163
|
switch (key) {
|
|
166
164
|
case 'Power':
|
|
167
|
-
switch (this.
|
|
165
|
+
switch (this.consoleAuthorized && this.webApiPowerOnOff) {
|
|
168
166
|
case true:
|
|
169
167
|
switch (value) {
|
|
170
168
|
case true: //off
|
|
@@ -188,30 +186,30 @@ class XboxDevice extends EventEmitter {
|
|
|
188
186
|
break;
|
|
189
187
|
case 'App':
|
|
190
188
|
const payload = [{ 'oneStoreProductId': value }];
|
|
191
|
-
set = !this.
|
|
189
|
+
set = !this.consoleAuthorized ? false : await this.xboxWebApi.send('Shell', 'ActivateApplicationWithOneStoreProductId', payload);
|
|
192
190
|
break;
|
|
193
191
|
case 'Volume':
|
|
194
192
|
switch (value) {
|
|
195
193
|
case 'up': //Up
|
|
196
|
-
set = !this.
|
|
194
|
+
set = !this.consoleAuthorized ? false : await this.xboxWebApi.send('Volume', 'Up');
|
|
197
195
|
break;
|
|
198
196
|
case 'down': //Down
|
|
199
|
-
set = !this.
|
|
197
|
+
set = !this.consoleAuthorized ? false : await this.xboxWebApi.send('Volume', 'Down');
|
|
200
198
|
break;
|
|
201
199
|
}
|
|
202
200
|
break;
|
|
203
201
|
case 'Mute':
|
|
204
202
|
switch (value) {
|
|
205
203
|
case true: //Mute
|
|
206
|
-
set = !this.
|
|
204
|
+
set = !this.consoleAuthorized ? false : await this.xboxWebApi.send('Audio', 'Mute');
|
|
207
205
|
break;
|
|
208
206
|
case false: //Unmute;
|
|
209
|
-
set = !this.
|
|
207
|
+
set = !this.consoleAuthorized ? false : await this.xboxWebApi.send('Audio', 'Unmute');
|
|
210
208
|
break;
|
|
211
209
|
}
|
|
212
210
|
break;
|
|
213
211
|
case 'RcControl':
|
|
214
|
-
set = !this.
|
|
212
|
+
set = !this.consoleAuthorized ? false : await this.xboxWebApi.send('Shell', 'InjectKey', [{ 'keyType': value }]);
|
|
215
213
|
break;
|
|
216
214
|
default:
|
|
217
215
|
this.emit('warn', `${integration}, received key: ${key}, value: ${value}`);
|
|
@@ -405,7 +403,7 @@ class XboxDevice extends EventEmitter {
|
|
|
405
403
|
}
|
|
406
404
|
|
|
407
405
|
try {
|
|
408
|
-
switch (this.
|
|
406
|
+
switch (this.consoleAuthorized && this.webApiPowerOnOff) {
|
|
409
407
|
case true:
|
|
410
408
|
switch (this.power) {
|
|
411
409
|
case true: //off
|
|
@@ -440,8 +438,8 @@ class XboxDevice extends EventEmitter {
|
|
|
440
438
|
return inputIdentifier;
|
|
441
439
|
})
|
|
442
440
|
.onSet(async (activeIdentifier) => {
|
|
443
|
-
if (!this.
|
|
444
|
-
this.emit('warn', `
|
|
441
|
+
if (!this.consoleAuthorized) {
|
|
442
|
+
this.emit('warn', `not authorized`);
|
|
445
443
|
return;
|
|
446
444
|
}
|
|
447
445
|
|
|
@@ -584,8 +582,8 @@ class XboxDevice extends EventEmitter {
|
|
|
584
582
|
|
|
585
583
|
this.televisionService.getCharacteristic(Characteristic.PowerModeSelection)
|
|
586
584
|
.onSet(async (powerModeSelection) => {
|
|
587
|
-
if (!this.
|
|
588
|
-
this.emit('warn', `
|
|
585
|
+
if (!this.consoleAuthorized) {
|
|
586
|
+
this.emit('warn', `not authorized`);
|
|
589
587
|
return;
|
|
590
588
|
}
|
|
591
589
|
|
|
@@ -624,8 +622,8 @@ class XboxDevice extends EventEmitter {
|
|
|
624
622
|
|
|
625
623
|
this.speakerService.getCharacteristic(Characteristic.VolumeSelector)
|
|
626
624
|
.onSet(async (volumeSelector) => {
|
|
627
|
-
if (!this.
|
|
628
|
-
this.emit('warn', `
|
|
625
|
+
if (!this.consoleAuthorized) {
|
|
626
|
+
this.emit('warn', `not authorized`);
|
|
629
627
|
return;
|
|
630
628
|
}
|
|
631
629
|
|
|
@@ -659,8 +657,8 @@ class XboxDevice extends EventEmitter {
|
|
|
659
657
|
return state;
|
|
660
658
|
})
|
|
661
659
|
.onSet(async (state) => {
|
|
662
|
-
if (!this.
|
|
663
|
-
this.emit('warn', `
|
|
660
|
+
if (!this.consoleAuthorized) {
|
|
661
|
+
this.emit('warn', `not authorized`);
|
|
664
662
|
return;
|
|
665
663
|
}
|
|
666
664
|
|
|
@@ -967,24 +965,24 @@ class XboxDevice extends EventEmitter {
|
|
|
967
965
|
const send1 = this.power && state ? await this.xboxLocalApi.recordGameDvr() : false;
|
|
968
966
|
break;
|
|
969
967
|
case 4:
|
|
970
|
-
const send2 = this.
|
|
968
|
+
const send2 = this.consoleAuthorized && this.power && state ? await this.xboxWebApi.send('Power', 'Reboot') : false;
|
|
971
969
|
break;
|
|
972
970
|
case 5:
|
|
973
971
|
switch (buttonOneStoreProductId) {
|
|
974
972
|
case 'Dashboard': case 'Settings': case 'SettingsTv': case 'Accessory': case 'Screensaver': case 'NetworkTroubleshooter': case 'MicrosoftStore':
|
|
975
|
-
const send3 = this.
|
|
973
|
+
const send3 = this.consoleAuthorized && this.power && state ? await this.xboxWebApi.send('Shell', 'GoHome') : false;
|
|
976
974
|
break;
|
|
977
975
|
case 'Television':
|
|
978
|
-
const send4 = this.
|
|
976
|
+
const send4 = this.consoleAuthorized && this.power && state ? await this.xboxWebApi.send('TV', 'ShowGuide') : false;
|
|
979
977
|
break;
|
|
980
978
|
case 'XboxGuide':
|
|
981
|
-
const send5 = this.
|
|
979
|
+
const send5 = this.consoleAuthorized && this.power && state ? await this.xboxWebApi.send('Shell', 'ShowGuideTab', [{ 'tabName': 'Guide' }]) : false;
|
|
982
980
|
break;
|
|
983
981
|
case 'Not set': case 'Web api disabled':
|
|
984
982
|
this.emit('info', `trying to launch App/Game with one store product id: ${buttonOneStoreProductId}`);
|
|
985
983
|
break;
|
|
986
984
|
default:
|
|
987
|
-
const send6 = this.
|
|
985
|
+
const send6 = this.consoleAuthorized && this.power && state ? await this.xboxWebApi.send('Shell', 'ActivateApplicationWithOneStoreProductId', [{ 'oneStoreProductId': buttonOneStoreProductId }]) : false;
|
|
988
986
|
break;
|
|
989
987
|
}
|
|
990
988
|
break;
|