homebridge-xbox-tv 3.3.7-beta.3 → 3.3.7

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
@@ -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.7] - (02.06.2025)
14
+
15
+ ## Changes
16
+
17
+ - cleanup and optimizations of web api control
18
+
13
19
  ## [3.3.6] - (02.06.2025)
14
20
 
15
21
  ## Changes
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "Xbox TV",
3
3
  "name": "homebridge-xbox-tv",
4
- "version": "3.3.7-beta.3",
4
+ "version": "3.3.7",
5
5
  "description": "Homebridge plugin to control Xbox game consoles.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",
package/src/xboxdevice.js CHANGED
@@ -164,7 +164,7 @@ class XboxDevice extends EventEmitter {
164
164
  let set = false
165
165
  switch (key) {
166
166
  case 'Power':
167
- switch (this.webApiPowerOnOff) {
167
+ switch (this.webApiControl && this.webApiPowerOnOff) {
168
168
  case true:
169
169
  switch (value) {
170
170
  case true: //off
@@ -188,30 +188,30 @@ class XboxDevice extends EventEmitter {
188
188
  break;
189
189
  case 'App':
190
190
  const payload = [{ 'oneStoreProductId': value }];
191
- set = await this.xboxWebApi.send('Shell', 'ActivateApplicationWithOneStoreProductId', payload);
191
+ set = !this.webApiControl ? false : await this.xboxWebApi.send('Shell', 'ActivateApplicationWithOneStoreProductId', payload);
192
192
  break;
193
193
  case 'Volume':
194
194
  switch (value) {
195
195
  case 'up': //Up
196
- set = await this.xboxWebApi.send('Volume', 'Up');
196
+ set = !this.webApiControl ? false : await this.xboxWebApi.send('Volume', 'Up');
197
197
  break;
198
198
  case 'down': //Down
199
- set = await this.xboxWebApi.send('Volume', 'Down');
199
+ set = !this.webApiControl ? false : await this.xboxWebApi.send('Volume', 'Down');
200
200
  break;
201
201
  }
202
202
  break;
203
203
  case 'Mute':
204
204
  switch (value) {
205
205
  case true: //Mute
206
- set = await this.xboxWebApi.send('Audio', 'Mute');
206
+ set = !this.webApiControl ? false : await this.xboxWebApi.send('Audio', 'Mute');
207
207
  break;
208
208
  case false: //Unmute;
209
- set = await this.xboxWebApi.send('Audio', 'Unmute');
209
+ set = !this.webApiControl ? false : await this.xboxWebApi.send('Audio', 'Unmute');
210
210
  break;
211
211
  }
212
212
  break;
213
213
  case 'RcControl':
214
- set = await this.xboxWebApi.send('Shell', 'InjectKey', [{ 'keyType': value }]);
214
+ set = !this.webApiControl ? false : await this.xboxWebApi.send('Shell', 'InjectKey', [{ 'keyType': value }]);
215
215
  break;
216
216
  default:
217
217
  this.emit('warn', `${integration}, received key: ${key}, value: ${value}`);
@@ -428,6 +428,7 @@ class XboxDevice extends EventEmitter {
428
428
  })
429
429
  .onSet(async (activeIdentifier) => {
430
430
  if (!this.webApiControl) {
431
+ this.emit('warn', `web api control not enabled`);
431
432
  return;
432
433
  }
433
434
 
@@ -571,6 +572,7 @@ class XboxDevice extends EventEmitter {
571
572
  this.televisionService.getCharacteristic(Characteristic.PowerModeSelection)
572
573
  .onSet(async (powerModeSelection) => {
573
574
  if (!this.webApiControl) {
575
+ this.emit('warn', `web api control not enabled`);
574
576
  return;
575
577
  }
576
578
 
@@ -610,6 +612,7 @@ class XboxDevice extends EventEmitter {
610
612
  this.speakerService.getCharacteristic(Characteristic.VolumeSelector)
611
613
  .onSet(async (volumeSelector) => {
612
614
  if (!this.webApiControl) {
615
+ this.emit('warn', `web api control not enabled`);
613
616
  return;
614
617
  }
615
618
 
@@ -644,6 +647,7 @@ class XboxDevice extends EventEmitter {
644
647
  })
645
648
  .onSet(async (state) => {
646
649
  if (!this.webApiControl) {
650
+ this.emit('warn', `web api control not enabled`);
647
651
  return;
648
652
  }
649
653