homebridge-zwave-usb 2.5.0 → 2.7.0

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.
@@ -88,11 +88,22 @@ class ZWaveAccessory {
88
88
  rename(newName) {
89
89
  this.platform.log.info(`Syncing HomeKit name for Node ${this.node.nodeId} -> ${newName}`);
90
90
  this.platformAccessory.displayName = newName;
91
+ // Update the Accessory Information Service (Most Authoritative)
92
+ const infoService = this.platformAccessory.getService(this.platform.Service.AccessoryInformation);
93
+ if (!infoService.testCharacteristic(this.platform.Characteristic.Name)) {
94
+ infoService.addOptionalCharacteristic(this.platform.Characteristic.Name);
95
+ }
96
+ infoService.getCharacteristic(this.platform.Characteristic.Name)
97
+ .setProps({
98
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
99
+ format: settings_1.HAPFormat.STRING,
100
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
101
+ perms: [settings_1.HAPPerm.PAIRED_READ, settings_1.HAPPerm.NOTIFY],
102
+ });
103
+ infoService.updateCharacteristic(this.platform.Characteristic.Name, newName);
91
104
  // Update the Model and Serial if they were using the generic name
92
105
  const model = this.node.deviceConfig?.label || newName;
93
- this.platformAccessory
94
- .getService(this.platform.Service.AccessoryInformation)
95
- .setCharacteristic(this.platform.Characteristic.Model, model);
106
+ infoService.setCharacteristic(this.platform.Characteristic.Model, model);
96
107
  // Update all features
97
108
  for (const feature of this.features) {
98
109
  feature.rename(newName);
@@ -28,10 +28,10 @@ class BaseFeature {
28
28
  const serviceName = this.endpoint.index > 0 ? `${newName} ${this.endpoint.index}` : newName;
29
29
  for (const service of this.managedServices) {
30
30
  if (service.testCharacteristic(this.platform.Characteristic.Name)) {
31
- service.getCharacteristic(this.platform.Characteristic.Name).updateValue(serviceName);
31
+ service.updateCharacteristic(this.platform.Characteristic.Name, serviceName);
32
32
  }
33
33
  if (service.testCharacteristic(this.platform.Characteristic.ConfiguredName)) {
34
- service.getCharacteristic(this.platform.Characteristic.ConfiguredName).updateValue(serviceName);
34
+ service.updateCharacteristic(this.platform.Characteristic.ConfiguredName, serviceName);
35
35
  }
36
36
  }
37
37
  }
@@ -87,14 +87,22 @@ class BaseFeature {
87
87
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
88
88
  format: settings_1.HAPFormat.STRING,
89
89
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
90
- perms: [settings_1.HAPPerm.PAIRED_READ],
90
+ perms: [settings_1.HAPPerm.PAIRED_READ, settings_1.HAPPerm.NOTIFY],
91
91
  })
92
92
  .updateValue(serviceName);
93
- // Also set ConfiguredName which HomeKit often prioritizes for display
93
+ // Also set ConfiguredName which many HomeKit versions prioritize for plugin-side renaming
94
94
  if (!service.testCharacteristic(this.platform.Characteristic.ConfiguredName)) {
95
95
  service.addOptionalCharacteristic(this.platform.Characteristic.ConfiguredName);
96
96
  }
97
- service.getCharacteristic(this.platform.Characteristic.ConfiguredName).updateValue(serviceName);
97
+ service
98
+ .getCharacteristic(this.platform.Characteristic.ConfiguredName)
99
+ .setProps({
100
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
101
+ format: settings_1.HAPFormat.STRING,
102
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
103
+ perms: [settings_1.HAPPerm.PAIRED_READ, settings_1.HAPPerm.NOTIFY],
104
+ })
105
+ .updateValue(serviceName);
98
106
  // Add Service Label Index for multi-endpoint devices to help with ordering/naming
99
107
  if (this.endpoint.index > 0) {
100
108
  if (!service.testCharacteristic(this.platform.Characteristic.ServiceLabelIndex)) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "homebridge-zwave-usb",
3
3
  "displayName": "Homebridge Z-Wave USB",
4
- "version": "2.5.0",
4
+ "version": "2.7.0",
5
5
  "description": "A Homebridge dynamic platform plugin for Z-Wave USB controllers using zwave-js.",
6
6
  "license": "Polyform-Noncommercial-1.0.0",
7
7
  "funding": {