homebridge-zwave-usb 2.6.0 → 2.8.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.
|
@@ -93,6 +93,13 @@ class ZWaveAccessory {
|
|
|
93
93
|
if (!infoService.testCharacteristic(this.platform.Characteristic.Name)) {
|
|
94
94
|
infoService.addOptionalCharacteristic(this.platform.Characteristic.Name);
|
|
95
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
|
+
});
|
|
96
103
|
infoService.updateCharacteristic(this.platform.Characteristic.Name, newName);
|
|
97
104
|
// Update the Model and Serial if they were using the generic name
|
|
98
105
|
const model = this.node.deviceConfig?.label || newName;
|
|
@@ -26,9 +26,13 @@ class BaseFeature {
|
|
|
26
26
|
*/
|
|
27
27
|
rename(newName) {
|
|
28
28
|
const serviceName = this.endpoint.index > 0 ? `${newName} ${this.endpoint.index}` : newName;
|
|
29
|
+
this.platform.log.debug(`Feature Rename [Node ${this.node.nodeId}]: Updating ${this.managedServices.length} services to "${serviceName}"`);
|
|
29
30
|
for (const service of this.managedServices) {
|
|
30
31
|
if (service.testCharacteristic(this.platform.Characteristic.Name)) {
|
|
31
|
-
service.
|
|
32
|
+
service.updateCharacteristic(this.platform.Characteristic.Name, serviceName);
|
|
33
|
+
}
|
|
34
|
+
if (service.testCharacteristic(this.platform.Characteristic.ConfiguredName)) {
|
|
35
|
+
service.updateCharacteristic(this.platform.Characteristic.ConfiguredName, serviceName);
|
|
32
36
|
}
|
|
33
37
|
}
|
|
34
38
|
}
|
|
@@ -78,15 +82,28 @@ class BaseFeature {
|
|
|
78
82
|
this.accessory.addService(new serviceType(serviceName));
|
|
79
83
|
}
|
|
80
84
|
// Explicitly set the name characteristic to ensure it's displayed correctly
|
|
81
|
-
|
|
82
|
-
|
|
85
|
+
service
|
|
86
|
+
.getCharacteristic(this.platform.Characteristic.Name)
|
|
87
|
+
.setProps({
|
|
88
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
89
|
+
format: settings_1.HAPFormat.STRING,
|
|
90
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
91
|
+
perms: [settings_1.HAPPerm.PAIRED_READ, settings_1.HAPPerm.NOTIFY],
|
|
92
|
+
});
|
|
93
|
+
service.updateCharacteristic(this.platform.Characteristic.Name, serviceName);
|
|
94
|
+
// Also set ConfiguredName which many HomeKit versions prioritize for plugin-side renaming
|
|
95
|
+
if (!service.testCharacteristic(this.platform.Characteristic.ConfiguredName)) {
|
|
96
|
+
service.addOptionalCharacteristic(this.platform.Characteristic.ConfiguredName);
|
|
97
|
+
}
|
|
98
|
+
service
|
|
99
|
+
.getCharacteristic(this.platform.Characteristic.ConfiguredName)
|
|
83
100
|
.setProps({
|
|
84
101
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
85
102
|
format: settings_1.HAPFormat.STRING,
|
|
86
103
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
87
|
-
perms: [settings_1.HAPPerm.PAIRED_READ],
|
|
88
|
-
})
|
|
89
|
-
|
|
104
|
+
perms: [settings_1.HAPPerm.PAIRED_READ, settings_1.HAPPerm.NOTIFY],
|
|
105
|
+
});
|
|
106
|
+
service.updateCharacteristic(this.platform.Characteristic.ConfiguredName, serviceName);
|
|
90
107
|
// Add Service Label Index for multi-endpoint devices to help with ordering/naming
|
|
91
108
|
if (this.endpoint.index > 0) {
|
|
92
109
|
if (!service.testCharacteristic(this.platform.Characteristic.ServiceLabelIndex)) {
|
|
@@ -344,7 +344,8 @@ class ZWaveUsbPlatform {
|
|
|
344
344
|
if (existing || this.discoveryInFlight.has(node.nodeId)) {
|
|
345
345
|
if (existing) {
|
|
346
346
|
existing.updateNode(node);
|
|
347
|
-
if
|
|
347
|
+
// Force sync names on every ready event if we have a friendly name
|
|
348
|
+
if (node.name) {
|
|
348
349
|
existing.rename(nodeName);
|
|
349
350
|
}
|
|
350
351
|
existing.refresh();
|
|
@@ -355,10 +356,9 @@ class ZWaveUsbPlatform {
|
|
|
355
356
|
try {
|
|
356
357
|
const accessory = AccessoryFactory_1.AccessoryFactory.create(this, node, homeId);
|
|
357
358
|
this.zwaveAccessories.set(node.nodeId, accessory);
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
accessory.initialize();
|
|
359
|
+
accessory.initialize(); // Initialize first to create functional services
|
|
360
|
+
// Force sync names immediately after initialization
|
|
361
|
+
accessory.rename(nodeName);
|
|
362
362
|
}
|
|
363
363
|
finally {
|
|
364
364
|
this.discoveryInFlight.delete(node.nodeId);
|
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.
|
|
4
|
+
"version": "2.8.1",
|
|
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": {
|