node-red-contrib-homebridge-automation 0.3.0-beta.5 → 0.3.0-beta.7
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/README.md +1 -0
- package/package.json +1 -1
- package/src/HAP-NodeRed.html +18 -1
- package/src/hbConfigNode.js +2 -1
- package/test/node-red/flows.json +2 -1
package/README.md
CHANGED
|
@@ -199,6 +199,7 @@ With a plugin, you can see if it supports Real Time events, by opening the Home
|
|
|
199
199
|
|
|
200
200
|
- Add common supported types Window, Window Covering, Light Sensor #151, tks @HDeKnop
|
|
201
201
|
- HB-Control Node Turns Off then On when this message is received #152
|
|
202
|
+
- Added `Debug logging` configuration option that creates a file `homebridge-automation-endpoints.json`, which contains all the homebridge devices discovered. It can be used as part of troubleshooting device issues.
|
|
202
203
|
|
|
203
204
|
# Backlog / Roadmap
|
|
204
205
|
|
package/package.json
CHANGED
package/src/HAP-NodeRed.html
CHANGED
|
@@ -7,10 +7,23 @@
|
|
|
7
7
|
<label for="node-config-input-macAddress"><i class="icon-wifi"></i> MAC Address (optional)</label>
|
|
8
8
|
<input type="text" id="node-config-input-macAddress" placeholder="00:00:00:A1:2B:CC">
|
|
9
9
|
</div>
|
|
10
|
+
<div class="form-row">
|
|
11
|
+
<label for="node-config-input-debug"><i class="icon-tag"></i>Debug Logging</label>
|
|
12
|
+
<input type="checkbox" id="node-config-input-debug" placeholder=false>
|
|
13
|
+
</div>
|
|
10
14
|
</script>
|
|
11
15
|
|
|
12
16
|
<script type="text/x-red" data-help-name="hb-conf">
|
|
13
|
-
<p>
|
|
17
|
+
<p>Configuration Node for Homebridge</p>
|
|
18
|
+
<h3>Settings</h3>
|
|
19
|
+
<dl class="message-properties">
|
|
20
|
+
<dt>PIN<span class="property-type">string</span></dt>
|
|
21
|
+
<dd>Please enter the PIN from your homebridge instances. Please note that the same pin must be used for all instances.</dd>
|
|
22
|
+
<dt>MAC Address<span class="property-type">object</span></dt>
|
|
23
|
+
<dd>Optional - Not implemented</dd>
|
|
24
|
+
<dt>Debug Logging<span class="property-type">string</span></dt>
|
|
25
|
+
<dd>Enables debug logging and creates a file `homebridge-automation-endpoints.json`, which contains all the homebridge devices discovered. It can be used as part of troubleshooting device issues.</dd>
|
|
26
|
+
</dl>
|
|
14
27
|
</script>
|
|
15
28
|
|
|
16
29
|
<script type="text/javascript">
|
|
@@ -36,6 +49,10 @@
|
|
|
36
49
|
},
|
|
37
50
|
required: false
|
|
38
51
|
},
|
|
52
|
+
debug: {
|
|
53
|
+
value: false,
|
|
54
|
+
required: false
|
|
55
|
+
}
|
|
39
56
|
},
|
|
40
57
|
credentials: {
|
|
41
58
|
password: {
|
package/src/hbConfigNode.js
CHANGED
|
@@ -10,6 +10,7 @@ class HBConfigNode {
|
|
|
10
10
|
// Initialize properties
|
|
11
11
|
this.username = config.username;
|
|
12
12
|
this.macAddress = config.macAddress || '';
|
|
13
|
+
this.debugLogging = config.debug || false;
|
|
13
14
|
this.users = {};
|
|
14
15
|
this.homebridge = null;
|
|
15
16
|
this.evDevices = [];
|
|
@@ -53,7 +54,7 @@ class HBConfigNode {
|
|
|
53
54
|
*/
|
|
54
55
|
async handleReady() {
|
|
55
56
|
const updatedDevices = await this.hapClient.getAllServices();
|
|
56
|
-
if (this.
|
|
57
|
+
if (this.debugLogging && updatedDevices && updatedDevices.length && process.uptime() < 300) {
|
|
57
58
|
try {
|
|
58
59
|
const storagePath = path.join(process.cwd(), '/homebridge-automation-endpoints.json');
|
|
59
60
|
this.warn(`Writing Homebridge endpoints to ${storagePath}`);
|