homebridge-xbox-tv 3.3.7-beta.0 → 3.3.7-beta.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/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.0",
4
+ "version": "3.3.7-beta.2",
5
5
  "description": "Homebridge plugin to control Xbox game consoles.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",
package/src/constants.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export const PlatformName = "XboxTv";
2
- export const PluginName = "Xbox TV";
2
+ export const PluginName = "homebridge-xbox-tv";
3
3
 
4
4
  export const DefaultInputs = [
5
5
  {
@@ -149,9 +149,8 @@ class XboxLocalApi extends EventEmitter {
149
149
  await new Promise(resolve => setTimeout(resolve, 1000));
150
150
  return true;
151
151
  }
152
- this.emit('disconnected', 'Power On failed, please try again.');
152
+ this.emit('info', 'Power On failed, please try again.');
153
153
  } catch (error) {
154
- this.emit('disconnected', 'Power On error, please try again.');
155
154
  throw new Error(error);
156
155
  };
157
156
  };
@@ -298,7 +297,7 @@ class XboxLocalApi extends EventEmitter {
298
297
  this.mediaRequestId = 0;
299
298
  await new Promise(resolve => setTimeout(resolve, 3000));
300
299
  this.emit('stateChanged', false, 0, true, 0, -1, -1);
301
- this.emit('disconnected', 'Disconnected.');
300
+ this.emit('info', 'Disconnected.');
302
301
  return true;
303
302
  } catch (error) {
304
303
  throw new Error(error);
package/src/xboxdevice.js CHANGED
@@ -733,7 +733,7 @@ class XboxDevice extends EventEmitter {
733
733
 
734
734
  inputService.getCharacteristic(Characteristic.ConfiguredName)
735
735
  .onGet(async () => {
736
- return sanitizedName
736
+ return sanitizedName;
737
737
  })
738
738
  .onSet(async (value) => {
739
739
  try {
@@ -1026,13 +1026,6 @@ class XboxDevice extends EventEmitter {
1026
1026
  //this.power = powerState;
1027
1027
  //this.mediaState = playbackState;
1028
1028
  })
1029
- .on('powerOnError', (power) => {
1030
- if (this.televisionService) {
1031
- this.televisionService
1032
- .updateCharacteristic(Characteristic.Active, power)
1033
- };
1034
- this.power = power;
1035
- })
1036
1029
  .on('success', (success) => {
1037
1030
  this.emit('success', success);
1038
1031
  })
@@ -1098,11 +1091,7 @@ class XboxDevice extends EventEmitter {
1098
1091
  //update characteristics
1099
1092
  if (this.televisionService) {
1100
1093
  this.televisionService
1101
- .updateCharacteristic(Characteristic.Active, power);
1102
- };
1103
-
1104
- if (this.televisionService) {
1105
- this.televisionService
1094
+ .updateCharacteristic(Characteristic.Active, power)
1106
1095
  .updateCharacteristic(Characteristic.ActiveIdentifier, inputIdentifier);
1107
1096
  };
1108
1097
 
@@ -1200,9 +1189,6 @@ class XboxDevice extends EventEmitter {
1200
1189
  .on('error', (error) => {
1201
1190
  this.emit('error', error);
1202
1191
  })
1203
- .on('disconnected', (info) => {
1204
- this.emit('info', info);
1205
- })
1206
1192
  .on('restFul', (path, data) => {
1207
1193
  const restFul = this.restFulConnected ? this.restFul1.update(path, data) : false;
1208
1194
  })