homebridge-tuya-plus 3.5.0 → 3.5.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.
- package/index.js +8 -4
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -27,6 +27,10 @@ const VerticalBlindsWithTilt = require('./lib/VerticalBlindsWithTilt');
|
|
|
27
27
|
|
|
28
28
|
const PLUGIN_NAME = 'homebridge-tuya-plus';
|
|
29
29
|
const PLATFORM_NAME = 'TuyaLan';
|
|
30
|
+
// Seed used to derive accessory UUIDs. Must remain 'homebridge-tuya' so that
|
|
31
|
+
// devices already paired with HomeKit keep their existing identity (names,
|
|
32
|
+
// rooms, automations).
|
|
33
|
+
const UUID_SEED = 'homebridge-tuya';
|
|
30
34
|
const DEFAULT_DISCOVER_TIMEOUT = 60000;
|
|
31
35
|
|
|
32
36
|
const CLASS_DEF = {
|
|
@@ -78,7 +82,7 @@ class TuyaLan {
|
|
|
78
82
|
return false;
|
|
79
83
|
}
|
|
80
84
|
|
|
81
|
-
this._expectedUUIDs = this.config.devices.map(device => UUID.generate(
|
|
85
|
+
this._expectedUUIDs = this.config.devices.map(device => UUID.generate(UUID_SEED +(device.fake ? ':fake:' : ':') + device.id));
|
|
82
86
|
|
|
83
87
|
this.api.on('didFinishLaunching', () => {
|
|
84
88
|
this.discoverDevices();
|
|
@@ -122,7 +126,7 @@ class TuyaLan {
|
|
|
122
126
|
const device = new TuyaAccessory({
|
|
123
127
|
...devices[config.id], ...config,
|
|
124
128
|
log: this.log,
|
|
125
|
-
UUID: UUID.generate(
|
|
129
|
+
UUID: UUID.generate(UUID_SEED + ':' + config.id),
|
|
126
130
|
connect: false
|
|
127
131
|
});
|
|
128
132
|
this.addAccessory(device);
|
|
@@ -133,7 +137,7 @@ class TuyaLan {
|
|
|
133
137
|
this.addAccessory(new TuyaAccessory({
|
|
134
138
|
...config,
|
|
135
139
|
log: this.log,
|
|
136
|
-
UUID: UUID.generate(
|
|
140
|
+
UUID: UUID.generate(UUID_SEED + ':fake:' + config.id),
|
|
137
141
|
connect: false
|
|
138
142
|
}));
|
|
139
143
|
});
|
|
@@ -149,7 +153,7 @@ class TuyaLan {
|
|
|
149
153
|
const device = new TuyaAccessory({
|
|
150
154
|
...devices[deviceId],
|
|
151
155
|
log: this.log,
|
|
152
|
-
UUID: UUID.generate(
|
|
156
|
+
UUID: UUID.generate(UUID_SEED + ':' + deviceId),
|
|
153
157
|
connect: false
|
|
154
158
|
});
|
|
155
159
|
this.addAccessory(device);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "homebridge-tuya-plus",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.1",
|
|
4
4
|
"description": "A community-maintained Homebridge plugin for controlling Tuya devices locally over LAN. Includes new features, fixes, and updated device support.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|