node-red-contrib-homebridge-automation 0.2.1-beta.2 → 0.2.1-beta.3
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/package.json
CHANGED
package/src/hbConfigNode.js
CHANGED
|
@@ -35,9 +35,9 @@ class HBConfigNode {
|
|
|
35
35
|
* Wait for no more instance discoveries to be made before publishing services
|
|
36
36
|
*/
|
|
37
37
|
waitForNoMoreDiscoveries = (instance) => {
|
|
38
|
-
|
|
38
|
+
if (instance)
|
|
39
|
+
debug('Instance discovered: %s - %s %s:%s', instance?.name, instance?.username, instance?.ipAddress, instance?.port);
|
|
39
40
|
if (!this.discoveryTimeout) {
|
|
40
|
-
clearTimeout(this.discoveryTimeout);
|
|
41
41
|
this.discoveryTimeout = setTimeout(() => {
|
|
42
42
|
this.debug('No more instances discovered, publishing services');
|
|
43
43
|
this.handleReady();
|
|
@@ -112,6 +112,7 @@ class HBConfigNode {
|
|
|
112
112
|
debug('Register: %s type: %s', clientNode.type, clientNode.name);
|
|
113
113
|
this.clientNodes[clientNode.id] = clientNode;
|
|
114
114
|
clientNode.status({ fill: 'yellow', shape: 'ring', text: 'connecting' });
|
|
115
|
+
this.waitForNoMoreDiscoveries(); // Connect new nodes created after startup has ended ( Need a function to rather than brute forcing it )
|
|
115
116
|
}
|
|
116
117
|
|
|
117
118
|
async connectClientNodes() {
|
|
@@ -128,7 +129,7 @@ class HBConfigNode {
|
|
|
128
129
|
clientNode.emit('hbReady', matchedDevice);
|
|
129
130
|
debug('_Registered: %s type: %s', clientNode.type, matchedDevice.type, matchedDevice.serviceName);
|
|
130
131
|
} else {
|
|
131
|
-
this.error(`ERROR: Device registration failed ${clientNode.
|
|
132
|
+
this.error(`ERROR: Device registration failed '${clientNode.fullName}'`);
|
|
132
133
|
}
|
|
133
134
|
};
|
|
134
135
|
|
|
@@ -145,7 +146,7 @@ class HBConfigNode {
|
|
|
145
146
|
this.log(`Connected to ${Object.keys(monitorNodes).length} Homebridge devices`);
|
|
146
147
|
// console.log('monitorNodes', monitorNodes);
|
|
147
148
|
if (this.monitor) {
|
|
148
|
-
// This is kinda brute force,
|
|
149
|
+
// This is kinda brute force, and should be refactored to only refresh the changed monitorNodes
|
|
149
150
|
this.monitor.finish();
|
|
150
151
|
}
|
|
151
152
|
this.monitor = await this.hapClient.monitorCharacteristics(monitorNodes);
|
package/test/node-red/flows.json
CHANGED
|
@@ -2250,13 +2250,13 @@
|
|
|
2250
2250
|
"id": "7ceb11204ab233ad",
|
|
2251
2251
|
"type": "hb-resume",
|
|
2252
2252
|
"z": "efb3c9c5f6bdfd6c",
|
|
2253
|
-
"name": "Bunkie
|
|
2253
|
+
"name": "Bunkie Fan",
|
|
2254
2254
|
"Homebridge": "homebridge",
|
|
2255
|
-
"Manufacturer": "
|
|
2256
|
-
"Service": "
|
|
2257
|
-
"device": "
|
|
2255
|
+
"Manufacturer": "Tasmota",
|
|
2256
|
+
"Service": "Fan",
|
|
2257
|
+
"device": "homebridge1C:22:3D:E3:CF:34TasmotaBunkie Fan00000040",
|
|
2258
2258
|
"conf": "7e647d67.f33acc",
|
|
2259
|
-
"x":
|
|
2259
|
+
"x": 570,
|
|
2260
2260
|
"y": 680,
|
|
2261
2261
|
"wires": [
|
|
2262
2262
|
[
|
|
@@ -2351,14 +2351,14 @@
|
|
|
2351
2351
|
"id": "2abd3edc55335405",
|
|
2352
2352
|
"type": "hb-control",
|
|
2353
2353
|
"z": "efb3c9c5f6bdfd6c",
|
|
2354
|
-
"name": "Bunkie
|
|
2354
|
+
"name": "Bunkie Fan",
|
|
2355
2355
|
"Homebridge": "homebridge",
|
|
2356
|
-
"Manufacturer": "
|
|
2357
|
-
"Service": "
|
|
2358
|
-
"device": "
|
|
2356
|
+
"Manufacturer": "Tasmota",
|
|
2357
|
+
"Service": "Fan",
|
|
2358
|
+
"device": "homebridge1C:22:3D:E3:CF:34TasmotaBunkie Fan00000040",
|
|
2359
2359
|
"conf": "7e647d67.f33acc",
|
|
2360
2360
|
"outputs": 0,
|
|
2361
|
-
"x":
|
|
2361
|
+
"x": 790,
|
|
2362
2362
|
"y": 680,
|
|
2363
2363
|
"wires": []
|
|
2364
2364
|
},
|