homebridge-xbox-tv 3.4.0 → 3.4.1

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "Xbox TV",
3
3
  "name": "homebridge-xbox-tv",
4
- "version": "3.4.0",
4
+ "version": "3.4.1",
5
5
  "description": "Homebridge plugin to control Xbox game consoles.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",
package/src/xboxdevice.js CHANGED
@@ -942,15 +942,15 @@ class XboxDevice extends EventEmitter {
942
942
  try {
943
943
  switch (buttonMode) {
944
944
  case 0: case 1: case 2:
945
- const send = state ? await this.xboxWebApi.send('Shell', 'InjectKey', [{ 'keyType': buttonCommand }]) : false;
945
+ const send = this.consoleAuthorized && state ? await this.xboxWebApi.send('Shell', 'InjectKey', [{ 'keyType': buttonCommand }]) : false;
946
946
  break;
947
947
  case 3:
948
948
  switch (buttonCommand) {
949
949
  case 'reboot':
950
- const send1 = this.power && state ? await this.xboxLocalApi.recordGameDvr() : false;
950
+ const send = this.consoleAuthorized && this.power && state ? await this.xboxWebApi.send('Power', 'Reboot') : false;
951
951
  break;
952
952
  case 'recordGameDvr':
953
- const send2 = this.consoleAuthorized && this.power && state ? await this.xboxWebApi.send('Power', 'Reboot') : false;
953
+ const send1 = this.power && state ? await this.xboxLocalApi.recordGameDvr() : false;
954
954
  break;
955
955
  }
956
956
  break;