node-red-contrib-homebridge-automation 0.2.1-beta.2 → 0.2.1-beta.4

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-homebridge-automation",
3
- "version": "0.2.1-beta.2",
3
+ "version": "0.2.1-beta.4",
4
4
  "description": "NodeRED Automation for HomeBridge",
5
5
  "main": "src/HAP-NodeRed.js",
6
6
  "scripts": {
@@ -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
- debug('Instance discovered: %s - %s %s:%s', instance?.name, instance?.username, instance?.ipAddress, instance?.port);
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();
@@ -78,10 +78,10 @@ class HBConfigNode {
78
78
  return filterUnique(this.hbDevices)
79
79
  .filter(service => supportedTypes.has(service.humanType))
80
80
  .map(service => ({
81
- name: service.serviceName,
82
- fullName: `${service.serviceName} - ${service.type}`,
83
- sortName: `${service.serviceName}:${service.type}`,
84
- uniqueId: `${service.instance.name}${service.instance.username}${service.accessoryInformation.Manufacturer}${service.serviceName}${service.uuid.slice(0, 8)}`,
81
+ name: (service.serviceName ? service.serviceName : service.accessoryInformation.Name),
82
+ fullName: `${(service.serviceName ? service.serviceName : service.accessoryInformation.Name)} - ${service.humanType}`,
83
+ sortName: `${(service.serviceName ? service.serviceName : service.accessoryInformation.Name)}:${service.type}`,
84
+ uniqueId: `${service.instance.name}${service.instance.username}${service.accessoryInformation.Manufacturer}${(service.serviceName ? service.serviceName : service.accessoryInformation.Name)}${service.uuid.slice(0, 8)}`,
85
85
  homebridge: service.instance.name,
86
86
  service: service.type,
87
87
  manufacturer: service.accessoryInformation.Manufacturer,
@@ -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.name}`);
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, but it works
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);
@@ -18,6 +18,8 @@
18
18
  },
19
19
  "debug": {
20
20
  "filter": "filterCurrent"
21
- }
21
+ },
22
+ "menu-deploymenu-item-node": true,
23
+ "menu-deploymenu-item-full": false
22
24
  }
23
25
  }
@@ -15,6 +15,9 @@
15
15
  "tours": {
16
16
  "welcome": "4.0.2"
17
17
  }
18
+ },
19
+ "debug": {
20
+ "filter": "filterCurrent"
18
21
  }
19
22
  }
20
23
  }
@@ -42,7 +42,7 @@
42
42
  "type": "debug",
43
43
  "z": "caef1e7b5b399e80",
44
44
  "name": "debug 1",
45
- "active": true,
45
+ "active": false,
46
46
  "tosidebar": true,
47
47
  "console": false,
48
48
  "tostatus": true,
@@ -59,7 +59,7 @@
59
59
  "type": "debug",
60
60
  "z": "caef1e7b5b399e80",
61
61
  "name": "debug 2",
62
- "active": true,
62
+ "active": false,
63
63
  "tosidebar": true,
64
64
  "console": false,
65
65
  "tostatus": true,
@@ -141,7 +141,7 @@
141
141
  "type": "debug",
142
142
  "z": "caef1e7b5b399e80",
143
143
  "name": "debug 3",
144
- "active": true,
144
+ "active": false,
145
145
  "tosidebar": true,
146
146
  "console": false,
147
147
  "tostatus": true,
@@ -444,7 +444,7 @@
444
444
  "type": "debug",
445
445
  "z": "caef1e7b5b399e80",
446
446
  "name": "debug 4",
447
- "active": true,
447
+ "active": false,
448
448
  "tosidebar": true,
449
449
  "console": false,
450
450
  "tostatus": true,
@@ -453,7 +453,7 @@
453
453
  "statusVal": "payload",
454
454
  "statusType": "auto",
455
455
  "x": 800,
456
- "y": 300,
456
+ "y": 320,
457
457
  "wires": []
458
458
  },
459
459
  {
@@ -501,7 +501,7 @@
501
501
  "type": "debug",
502
502
  "z": "caef1e7b5b399e80",
503
503
  "name": "debug 5",
504
- "active": true,
504
+ "active": false,
505
505
  "tosidebar": true,
506
506
  "console": false,
507
507
  "tostatus": true,
@@ -570,7 +570,7 @@
570
570
  "type": "debug",
571
571
  "z": "caef1e7b5b399e80",
572
572
  "name": "debug 6",
573
- "active": true,
573
+ "active": false,
574
574
  "tosidebar": true,
575
575
  "console": false,
576
576
  "tostatus": true,
@@ -634,9 +634,9 @@
634
634
  "z": "caef1e7b5b399e80",
635
635
  "name": "Backyard",
636
636
  "Homebridge": "Default Model",
637
- "Manufacturer": "NRCHKB",
637
+ "Manufacturer": "NRCHKB - LaCrosse-TX141W",
638
638
  "Service": "TemperatureSensor",
639
- "device": "Default Model69:62:B7:AE:38:D4NRCHKBBackyard0000008A",
639
+ "device": "Default Model69:62:B7:AE:38:D4NRCHKB - LaCrosse-TX141WBackyard0000008A",
640
640
  "conf": "7e647d67.f33acc",
641
641
  "sendInitialState": true,
642
642
  "x": 160,
@@ -670,9 +670,9 @@
670
670
  "z": "caef1e7b5b399e80",
671
671
  "name": "Backyard Tree",
672
672
  "Homebridge": "Default Model",
673
- "Manufacturer": "NRCHKB",
673
+ "Manufacturer": "NRCHKB - LaCrosse-TX141Bv3",
674
674
  "Service": "TemperatureSensor",
675
- "device": "Default Model69:62:B7:AE:38:D4NRCHKBBackyard Tree0000008A",
675
+ "device": "Default Model69:62:B7:AE:38:D4NRCHKB - LaCrosse-TX141Bv3Backyard Tree0000008A",
676
676
  "conf": "7e647d67.f33acc",
677
677
  "x": 360,
678
678
  "y": 800,
@@ -2250,13 +2250,13 @@
2250
2250
  "id": "7ceb11204ab233ad",
2251
2251
  "type": "hb-resume",
2252
2252
  "z": "efb3c9c5f6bdfd6c",
2253
- "name": "Bunkie Lower",
2253
+ "name": "Bunkie Fan",
2254
2254
  "Homebridge": "homebridge",
2255
- "Manufacturer": "WLED",
2256
- "Service": "Lightbulb",
2257
- "device": "homebridge0E:03:4B:B3:AF:4CWLEDBunkie Lower00000043",
2255
+ "Manufacturer": "Tasmota",
2256
+ "Service": "Fan",
2257
+ "device": "homebridge1C:22:3D:E3:CF:34TasmotaBunkie Fan00000040",
2258
2258
  "conf": "7e647d67.f33acc",
2259
- "x": 580,
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 Lower",
2354
+ "name": "Bunkie Fan",
2355
2355
  "Homebridge": "homebridge",
2356
- "Manufacturer": "WLED",
2357
- "Service": "Lightbulb",
2358
- "device": "homebridge0E:03:4B:B3:AF:4CWLEDBunkie Lower00000043",
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": 800,
2361
+ "x": 790,
2362
2362
  "y": 680,
2363
2363
  "wires": []
2364
2364
  },
@@ -42,7 +42,7 @@
42
42
  "type": "debug",
43
43
  "z": "caef1e7b5b399e80",
44
44
  "name": "debug 1",
45
- "active": true,
45
+ "active": false,
46
46
  "tosidebar": true,
47
47
  "console": false,
48
48
  "tostatus": true,
@@ -59,7 +59,7 @@
59
59
  "type": "debug",
60
60
  "z": "caef1e7b5b399e80",
61
61
  "name": "debug 2",
62
- "active": true,
62
+ "active": false,
63
63
  "tosidebar": true,
64
64
  "console": false,
65
65
  "tostatus": true,
@@ -141,7 +141,7 @@
141
141
  "type": "debug",
142
142
  "z": "caef1e7b5b399e80",
143
143
  "name": "debug 3",
144
- "active": true,
144
+ "active": false,
145
145
  "tosidebar": true,
146
146
  "console": false,
147
147
  "tostatus": true,
@@ -444,7 +444,7 @@
444
444
  "type": "debug",
445
445
  "z": "caef1e7b5b399e80",
446
446
  "name": "debug 4",
447
- "active": true,
447
+ "active": false,
448
448
  "tosidebar": true,
449
449
  "console": false,
450
450
  "tostatus": true,
@@ -501,7 +501,7 @@
501
501
  "type": "debug",
502
502
  "z": "caef1e7b5b399e80",
503
503
  "name": "debug 5",
504
- "active": true,
504
+ "active": false,
505
505
  "tosidebar": true,
506
506
  "console": false,
507
507
  "tostatus": true,
@@ -570,7 +570,7 @@
570
570
  "type": "debug",
571
571
  "z": "caef1e7b5b399e80",
572
572
  "name": "debug 6",
573
- "active": true,
573
+ "active": false,
574
574
  "tosidebar": true,
575
575
  "console": false,
576
576
  "tostatus": true,
@@ -634,9 +634,9 @@
634
634
  "z": "caef1e7b5b399e80",
635
635
  "name": "Backyard",
636
636
  "Homebridge": "Default Model",
637
- "Manufacturer": "NRCHKB",
637
+ "Manufacturer": "NRCHKB - LaCrosse-TX141W",
638
638
  "Service": "TemperatureSensor",
639
- "device": "Default Model69:62:B7:AE:38:D4NRCHKBBackyard0000008A",
639
+ "device": "Default Model69:62:B7:AE:38:D4NRCHKB - LaCrosse-TX141WBackyard0000008A",
640
640
  "conf": "7e647d67.f33acc",
641
641
  "sendInitialState": true,
642
642
  "x": 160,
@@ -656,10 +656,10 @@
656
656
  "tosidebar": true,
657
657
  "console": false,
658
658
  "tostatus": true,
659
- "complete": "payload",
660
- "targetType": "msg",
659
+ "complete": "true",
660
+ "targetType": "full",
661
661
  "statusVal": "payload",
662
- "statusType": "auto",
662
+ "statusType": "msg",
663
663
  "x": 620,
664
664
  "y": 740,
665
665
  "wires": []
@@ -670,9 +670,9 @@
670
670
  "z": "caef1e7b5b399e80",
671
671
  "name": "Backyard Tree",
672
672
  "Homebridge": "Default Model",
673
- "Manufacturer": "NRCHKB",
673
+ "Manufacturer": "NRCHKB - LaCrosse-TX141Bv3",
674
674
  "Service": "TemperatureSensor",
675
- "device": "Default Model69:62:B7:AE:38:D4NRCHKBBackyard Tree0000008A",
675
+ "device": "Default Model69:62:B7:AE:38:D4NRCHKB - LaCrosse-TX141Bv3Backyard Tree0000008A",
676
676
  "conf": "7e647d67.f33acc",
677
677
  "x": 360,
678
678
  "y": 800,
@@ -2250,13 +2250,13 @@
2250
2250
  "id": "7ceb11204ab233ad",
2251
2251
  "type": "hb-resume",
2252
2252
  "z": "efb3c9c5f6bdfd6c",
2253
- "name": "Bunkie Lower",
2253
+ "name": "Bunkie Fan",
2254
2254
  "Homebridge": "homebridge",
2255
- "Manufacturer": "WLED",
2256
- "Service": "Lightbulb",
2257
- "device": "homebridge0E:03:4B:B3:AF:4CWLEDBunkie Lower00000043",
2255
+ "Manufacturer": "Tasmota",
2256
+ "Service": "Fan",
2257
+ "device": "homebridge1C:22:3D:E3:CF:34TasmotaBunkie Fan00000040",
2258
2258
  "conf": "7e647d67.f33acc",
2259
- "x": 580,
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 Lower",
2354
+ "name": "Bunkie Fan",
2355
2355
  "Homebridge": "homebridge",
2356
- "Manufacturer": "WLED",
2357
- "Service": "Lightbulb",
2358
- "device": "homebridge0E:03:4B:B3:AF:4CWLEDBunkie Lower00000043",
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": 800,
2361
+ "x": 790,
2362
2362
  "y": 680,
2363
2363
  "wires": []
2364
2364
  },