homebridge-xbox-tv 2.13.5 → 2.13.6

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": "2.13.5",
4
+ "version": "2.13.6",
5
5
  "description": "Homebridge plugin to control Xbox game consoles.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",
@@ -29,7 +29,7 @@
29
29
  "homebridge": ">=1.6.0"
30
30
  },
31
31
  "dependencies": {
32
- "@homebridge/plugin-ui-utils": "^1.0.1",
32
+ "@homebridge/plugin-ui-utils": "^1.0.2",
33
33
  "async-mqtt": "^2.6.3",
34
34
  "elliptic": "^6.5.5",
35
35
  "hex-to-binary": "^1.0.1",
package/src/xboxdevice.js CHANGED
@@ -771,10 +771,8 @@ class XboxDevice extends EventEmitter {
771
771
  const volume = this.volume;
772
772
  return volume;
773
773
  })
774
- .onSet(async (volume) => {
775
- if (volume === 0 || volume === 100) {
776
- volume = this.volume;
777
- };
774
+ .onSet(async (value) => {
775
+ volume = (value <= 0 || value >= 100) ? this.volume : value;
778
776
  const logInfo = this.disableLogInfo ? false : this.emit('message', `set Volume: ${volume}`);
779
777
  });
780
778
 
@@ -1018,12 +1016,12 @@ class XboxDevice extends EventEmitter {
1018
1016
  const sensorInputReference = sensorInput.reference;
1019
1017
 
1020
1018
  //get sensor display type
1021
- const sensorInputDisplayType = sensorInput.displayType || false;
1019
+ const sensorInputDisplayType = sensorInput.displayType || 0;
1022
1020
 
1023
1021
  //get sensor name prefix
1024
1022
  const namePrefix = sensorInput.namePrefix || false;
1025
1023
 
1026
- if (sensorInputDisplayType) {
1024
+ if (sensorInputDisplayType > 0) {
1027
1025
  if (sensorInputName && sensorInputReference) {
1028
1026
  const serviceName = namePrefix ? `${accessoryName} ${sensorInputName}` : sensorInputName;
1029
1027
  const characteristicType = ['', Characteristic.MotionDetected, Characteristic.OccupancyDetected, Characteristic.ContactSensorState][sensorInputDisplayType];
@@ -1084,12 +1082,12 @@ class XboxDevice extends EventEmitter {
1084
1082
  const buttonOneStoreProductId = button.oneStoreProductId;
1085
1083
 
1086
1084
  //get button display type
1087
- const buttonDisplayType = button.displayType || false;
1085
+ const buttonDisplayType = button.displayType || 0;
1088
1086
 
1089
1087
  //get button name prefix
1090
1088
  const namePrefix = button.namePrefix ?? false;
1091
1089
 
1092
- if (buttonDisplayType) {
1090
+ if (buttonDisplayType > 0) {
1093
1091
  if (buttonName && buttonCommand && buttonMode >= 0) {
1094
1092
  const serviceName = namePrefix ? `${accessoryName} ${buttonName}` : buttonName;
1095
1093
  const serviceType = ['', Service.Outlet, Service.Switch][buttonDisplayType];