homebridge-zwave-usb 2.9.7 → 3.0.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.
|
@@ -61,21 +61,11 @@ class ZWaveAccessory {
|
|
|
61
61
|
const model = this.node.deviceConfig?.label || `Node ${this.node.nodeId}`;
|
|
62
62
|
const serial = `Node ${this.node.nodeId}`;
|
|
63
63
|
const infoService = this.platformAccessory.getService(this.platform.Service.AccessoryInformation);
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
if (infoService.getCharacteristic(this.platform.Characteristic.SerialNumber).value !== serial) {
|
|
71
|
-
infoService.updateCharacteristic(this.platform.Characteristic.SerialNumber, serial);
|
|
72
|
-
}
|
|
73
|
-
// Add ServiceLabelNamespace to help with naming multi-service accessories
|
|
74
|
-
if (!infoService.testCharacteristic(this.platform.Characteristic.ServiceLabelNamespace)) {
|
|
75
|
-
infoService.addOptionalCharacteristic(this.platform.Characteristic.ServiceLabelNamespace);
|
|
76
|
-
}
|
|
77
|
-
// 1 = Arabic numerals (1, 2, 3...)
|
|
78
|
-
infoService.updateCharacteristic(this.platform.Characteristic.ServiceLabelNamespace, 1);
|
|
64
|
+
infoService
|
|
65
|
+
.setCharacteristic(this.platform.Characteristic.Manufacturer, manufacturer)
|
|
66
|
+
.setCharacteristic(this.platform.Characteristic.Model, model)
|
|
67
|
+
.setCharacteristic(this.platform.Characteristic.SerialNumber, serial)
|
|
68
|
+
.setCharacteristic(this.platform.Characteristic.FirmwareRevision, this.node.firmwareVersion || '1.0.0');
|
|
79
69
|
/**
|
|
80
70
|
* Helper to normalize UUIDs for reliable comparison during metadata pruning.
|
|
81
71
|
*/
|
|
@@ -105,18 +95,6 @@ class ZWaveAccessory {
|
|
|
105
95
|
rename(newName) {
|
|
106
96
|
this.platform.log.info(`Syncing HomeKit name for Node ${this.node.nodeId} -> ${newName}`);
|
|
107
97
|
this.platformAccessory.displayName = newName;
|
|
108
|
-
// Update the Accessory Information Service (Standard Characteristics Only)
|
|
109
|
-
const infoService = this.platformAccessory.getService(this.platform.Service.AccessoryInformation);
|
|
110
|
-
// Update Name (NOTIFY removed to respect user overrides)
|
|
111
|
-
if (!infoService.testCharacteristic(this.platform.Characteristic.Name)) {
|
|
112
|
-
infoService.addOptionalCharacteristic(this.platform.Characteristic.Name);
|
|
113
|
-
}
|
|
114
|
-
const nameChar = infoService.getCharacteristic(this.platform.Characteristic.Name);
|
|
115
|
-
nameChar.setProps({
|
|
116
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
117
|
-
perms: [settings_1.HAPPerm.PAIRED_READ],
|
|
118
|
-
});
|
|
119
|
-
nameChar.updateValue(newName);
|
|
120
98
|
// Update all features
|
|
121
99
|
for (const feature of this.features) {
|
|
122
100
|
feature.rename(newName);
|
|
@@ -344,8 +344,10 @@ class ZWaveUsbPlatform {
|
|
|
344
344
|
if (existing || this.discoveryInFlight.has(node.nodeId)) {
|
|
345
345
|
if (existing) {
|
|
346
346
|
existing.updateNode(node);
|
|
347
|
-
//
|
|
348
|
-
|
|
347
|
+
// Only sync name if it has actually changed in the Z-Wave network
|
|
348
|
+
// This prevents overwriting user-defined names in HomeKit on every startup
|
|
349
|
+
if (existing.platformAccessory.displayName !== nodeName) {
|
|
350
|
+
this.log.info(`Node ${node.nodeId} name changed: "${existing.platformAccessory.displayName}" -> "${nodeName}"`);
|
|
349
351
|
existing.rename(nodeName);
|
|
350
352
|
}
|
|
351
353
|
existing.refresh();
|
|
@@ -50,6 +50,7 @@ export interface IZWaveNode {
|
|
|
50
50
|
ready: boolean;
|
|
51
51
|
interviewStage: InterviewStage;
|
|
52
52
|
status: number;
|
|
53
|
+
firmwareVersion?: string;
|
|
53
54
|
getValue(valueId: ValueID): unknown;
|
|
54
55
|
setValue(valueId: ValueID, value: unknown): Promise<SetValueResult>;
|
|
55
56
|
supportsCC(cc: number): boolean;
|
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": "
|
|
4
|
+
"version": "3.0.2",
|
|
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": {
|