homebridge-xbox-tv 2.13.26 → 2.13.28

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.
@@ -188,7 +188,7 @@
188
188
  ]
189
189
  }
190
190
  ],
191
- "required": false
191
+ "required": true
192
192
  }
193
193
  }
194
194
  },
@@ -405,7 +405,7 @@
405
405
  }
406
406
  ],
407
407
  "description": "Here select the command or mode of button.",
408
- "required": false
408
+ "required": true
409
409
  },
410
410
  "oneStoreProductId": {
411
411
  "title": "Product Id",
@@ -441,7 +441,7 @@
441
441
  }
442
442
  ],
443
443
  "description": "Here select display type in HomeKit app.",
444
- "required": false
444
+ "required": true
445
445
  },
446
446
  "namePrefix": {
447
447
  "title": "Prefix",
@@ -525,7 +525,7 @@
525
525
  }
526
526
  ],
527
527
  "description": "Here select sensor type to be exposed in HomeKit app.",
528
- "required": false
528
+ "required": true
529
529
  },
530
530
  "namePrefix": {
531
531
  "title": "Prefix",
@@ -597,27 +597,6 @@
597
597
  },
598
598
  "required": false
599
599
  },
600
- "enableDebugMode": {
601
- "title": "Debug",
602
- "type": "boolean",
603
- "default": false,
604
- "description": "This enable debug mode.",
605
- "required": false
606
- },
607
- "disableLogInfo": {
608
- "title": "Disable Log Info",
609
- "type": "boolean",
610
- "default": false,
611
- "description": "This disable logging values and states on every it change.",
612
- "required": false
613
- },
614
- "disableLogDeviceInfo": {
615
- "title": "Disable Log Device Info",
616
- "type": "boolean",
617
- "default": false,
618
- "description": "This disable log device info by every connections device to the network.",
619
- "required": false
620
- },
621
600
  "infoButtonCommand": {
622
601
  "title": "Info Button",
623
602
  "type": "string",
@@ -698,6 +677,27 @@
698
677
  ],
699
678
  "required": true
700
679
  },
680
+ "enableDebugMode": {
681
+ "title": "Debug",
682
+ "type": "boolean",
683
+ "default": false,
684
+ "description": "This enable debug mode.",
685
+ "required": false
686
+ },
687
+ "disableLogInfo": {
688
+ "title": "Disable Log Info",
689
+ "type": "boolean",
690
+ "default": false,
691
+ "description": "This disable logging values and states on every it change.",
692
+ "required": false
693
+ },
694
+ "disableLogDeviceInfo": {
695
+ "title": "Disable Log Device Info",
696
+ "type": "boolean",
697
+ "default": false,
698
+ "description": "This disable log device info by every connections device to the network.",
699
+ "required": false
700
+ },
701
701
  "enableRestFul": {
702
702
  "title": "Enable",
703
703
  "type": "boolean",
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.26",
4
+ "version": "2.13.28",
5
5
  "description": "Homebridge plugin to control Xbox game consoles.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",
@@ -34,13 +34,13 @@
34
34
  "dependencies": {
35
35
  "@homebridge/plugin-ui-utils": "^1.0.3",
36
36
  "async-mqtt": "^2.6.3",
37
- "elliptic": "^6.5.5",
37
+ "elliptic": "^6.5.6",
38
38
  "hex-to-binary": "^1.0.1",
39
39
  "jsrsasign": "^11.1.0",
40
40
  "uuid": "^10.0.0",
41
41
  "ping": "^0.4.4",
42
42
  "express": "^4.19.2",
43
- "axios": "^1.7.2"
43
+ "axios": "^1.7.3"
44
44
  },
45
45
  "keywords": [
46
46
  "homebridge",
package/src/xboxdevice.js CHANGED
@@ -876,8 +876,7 @@ class XboxDevice extends EventEmitter {
876
876
  //get input name
877
877
  const name = input.name ?? `Input ${inputIdentifier}`;
878
878
  const savedInputsNames = this.savedInputsNames[inputReference] ?? false;
879
- const inputName = !savedInputsNames ? name : savedInputsNames;
880
- input.name = inputName;
879
+ input.name = savedInputsNames ? savedInputsNames.substring(0, 64) : name.substring(0, 64);
881
880
 
882
881
  //get input type
883
882
  const inputSourceType = 0;
@@ -886,24 +885,23 @@ class XboxDevice extends EventEmitter {
886
885
  const isConfigured = 1;
887
886
 
888
887
  //get visibility
889
- const currentVisibility = this.savedInputsTargetVisibility[inputReference] ?? 0;
890
- input.visibility = currentVisibility;
888
+ input.visibility = this.savedInputsTargetVisibility[inputReference] ?? 0;
891
889
 
892
890
  //add identifier to the input
893
891
  input.identifier = inputIdentifier;
894
892
 
895
893
  //input service
896
- const inputService = accessory.addService(Service.InputSource, inputName, `Input ${inputIdentifier}`);
894
+ const inputService = accessory.addService(Service.InputSource, input.name, `Input ${inputIdentifier}`);
897
895
  inputService
898
896
  .setCharacteristic(Characteristic.Identifier, inputIdentifier)
899
- .setCharacteristic(Characteristic.Name, inputName.substring(0, 64))
897
+ .setCharacteristic(Characteristic.Name, input.name)
900
898
  .setCharacteristic(Characteristic.InputSourceType, inputSourceType)
901
899
  .setCharacteristic(Characteristic.IsConfigured, isConfigured)
902
- .setCharacteristic(Characteristic.CurrentVisibilityState, currentVisibility)
900
+ .setCharacteristic(Characteristic.CurrentVisibilityState, input.visibility)
903
901
 
904
902
  inputService.getCharacteristic(Characteristic.ConfiguredName)
905
903
  .onGet(async () => {
906
- return inputName;
904
+ return input.name;
907
905
  })
908
906
  .onSet(async (value) => {
909
907
  if (value === this.savedInputsNames[inputReference]) {
@@ -911,9 +909,10 @@ class XboxDevice extends EventEmitter {
911
909
  }
912
910
 
913
911
  try {
912
+ input.name = value;
914
913
  this.savedInputsNames[inputReference] = value;
915
914
  await this.saveData(this.inputsNamesFile, this.savedInputsNames);
916
- const debug = !this.enableDebugMode ? false : this.emit('debug', `Saved Input Name: ${value}, Reference: ${nameIdentifier}.`);
915
+ const debug = !this.enableDebugMode ? false : this.emit('debug', `Saved Input Name: ${value}, Reference: ${inputReference}.`);
917
916
 
918
917
  //sort inputs
919
918
  const index = this.inputsConfigured.findIndex(input => input.reference === inputReference);
@@ -926,7 +925,7 @@ class XboxDevice extends EventEmitter {
926
925
 
927
926
  inputService.getCharacteristic(Characteristic.TargetVisibilityState)
928
927
  .onGet(async () => {
929
- return currentVisibility;
928
+ return input.visibility;
930
929
  })
931
930
  .onSet(async (state) => {
932
931
  if (state === this.savedInputsTargetVisibility[inputReference]) {
@@ -934,9 +933,10 @@ class XboxDevice extends EventEmitter {
934
933
  }
935
934
 
936
935
  try {
937
- this.savedInputsTargetVisibility[inputReference] = state;
936
+ input.visibility = state,
937
+ this.savedInputsTargetVisibility[inputReference] = state;
938
938
  await this.saveData(this.inputsTargetVisibilityFile, this.savedInputsTargetVisibility);
939
- const debug = !this.enableDebugMode ? false : this.emit('debug', `Saved Input: ${inputName} Target Visibility: ${state ? 'HIDEN' : 'SHOWN'}`);
939
+ const debug = !this.enableDebugMode ? false : this.emit('debug', `Saved Input: ${input.name} Target Visibility: ${state ? 'HIDEN' : 'SHOWN'}`);
940
940
  } catch (error) {
941
941
  this.emit('error', `save Target Visibility error: ${error}`);
942
942
  }