node-red-contrib-homebridge-automation 0.1.5 → 0.1.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/HAP-NodeRed.js +5 -9
- package/README.md +11 -1
- package/lib/Service.js +10 -8
- package/package.json +2 -2
package/HAP-NodeRed.js
CHANGED
|
@@ -510,12 +510,8 @@ module.exports = function (RED) {
|
|
|
510
510
|
payload[key] = msg.payload[key];
|
|
511
511
|
});
|
|
512
512
|
_control.call(this, node, msg.payload, function (err, data) {
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
const msg = {};
|
|
516
|
-
msg.payload = data;
|
|
517
|
-
node.send(msg);
|
|
518
|
-
} else {
|
|
513
|
+
// debug('hbControl [%s] - [%s]', err, data); // Images produce alot of noise
|
|
514
|
+
if (err) {
|
|
519
515
|
node.error(err, this.msg);
|
|
520
516
|
}
|
|
521
517
|
}.bind(this));
|
|
@@ -728,7 +724,7 @@ module.exports = function (RED) {
|
|
|
728
724
|
|
|
729
725
|
// characteristics = Object.assign(characteristics, characteristic.characteristic);
|
|
730
726
|
if (device) {
|
|
731
|
-
hbMessage.forEach(function(characteristic) {
|
|
727
|
+
hbMessage.forEach(function (characteristic) {
|
|
732
728
|
// debug("Exists", (device.characteristics[characteristic.aid + '.' + characteristic.iid]));
|
|
733
729
|
if (device.characteristics[characteristic.aid + '.' + characteristic.iid]) {
|
|
734
730
|
payload = Object.assign(payload, {
|
|
@@ -806,7 +802,7 @@ module.exports = function (RED) {
|
|
|
806
802
|
"image-height": 1080
|
|
807
803
|
};
|
|
808
804
|
debug("Control %s:%s ->", device.host, device.port, JSON.stringify(message));
|
|
809
|
-
homebridge.HAPresource(device.host, device.port, JSON.stringify(message), function(err, status) {
|
|
805
|
+
homebridge.HAPresource(device.host, device.port, JSON.stringify(message), function (err, status) {
|
|
810
806
|
// debug("status", btoa(status));
|
|
811
807
|
if (!err) {
|
|
812
808
|
debug("Controlled %s:%s ->", device.host, device.port);
|
|
@@ -816,7 +812,7 @@ module.exports = function (RED) {
|
|
|
816
812
|
fill: 'green'
|
|
817
813
|
});
|
|
818
814
|
clearTimeout(node.timeout);
|
|
819
|
-
node.timeout = setTimeout(function() {
|
|
815
|
+
node.timeout = setTimeout(function () {
|
|
820
816
|
node.status({});
|
|
821
817
|
}, 30 * 1000);
|
|
822
818
|
// {"characteristics":[{"aid":19,"iid":10,"value":false},{"aid":19,"iid":11,"value":0}]}
|
package/README.md
CHANGED
|
@@ -31,6 +31,8 @@ The above Node-RED Flow, turns on my 'Outside Office' light when the powder room
|
|
|
31
31
|
* [Mar 9, 2021 - Version 0.0.80](#mar-9-2021---version-0080)
|
|
32
32
|
* [April 23, 2021 - Version 0.0.82](#april-23-2021---version-0082)
|
|
33
33
|
* [Dec 31, 2022 - Version 0.1.3](#dec-31-2022---version-013)
|
|
34
|
+
* [Jan 6, 2023 - Version 0.1.5](#jan-6-2023---version-015)
|
|
35
|
+
* [Jan 11, 2023 - Version 0.1.7](#jan-11-2023---version-017)
|
|
34
36
|
* [Backlog / Roadmap](#backlog--roadmap)
|
|
35
37
|
* [Dropped items](#dropped-items)
|
|
36
38
|
* [Installation Steps](#installation-steps)
|
|
@@ -56,7 +58,7 @@ The above Node-RED Flow, turns on my 'Outside Office' light when the powder room
|
|
|
56
58
|
* [To start Node-RED in DEBUG mode, and output Homebridge-Automation debug logs start Node-RED like this.](#to-start-node-red-in-debug-mode-and-output-homebridge-automation-debug-logs-start-node-red-like-this)
|
|
57
59
|
|
|
58
60
|
<!-- Created by https://github.com/ekalinin/github-markdown-toc -->
|
|
59
|
-
<!-- Added by: sgracey, at:
|
|
61
|
+
<!-- Added by: sgracey, at: Wed 11 Jan 2023 11:21:22 EST -->
|
|
60
62
|
|
|
61
63
|
<!--te-->
|
|
62
64
|
|
|
@@ -167,6 +169,14 @@ With a plugin, you can see if it supports Real Time events, by opening the Home
|
|
|
167
169
|
|
|
168
170
|
- Removal of request dependency from hap-node-client
|
|
169
171
|
|
|
172
|
+
### Jan 6, 2023 - Version 0.1.5
|
|
173
|
+
|
|
174
|
+
- Remove support for ipv6
|
|
175
|
+
|
|
176
|
+
### Jan 11, 2023 - Version 0.1.7
|
|
177
|
+
|
|
178
|
+
- Fix for #110 and homebridge-alexa #564
|
|
179
|
+
|
|
170
180
|
# Backlog / Roadmap
|
|
171
181
|
|
|
172
182
|
* [x] - Update Node Information with Homebridge Accessory Details ( hapEndpoint, deviceType, description )
|
package/lib/Service.js
CHANGED
|
@@ -74,7 +74,7 @@ function Service(devices, context) {
|
|
|
74
74
|
this.id = context.id;
|
|
75
75
|
this.characteristics = [];
|
|
76
76
|
// Fix for homebridge 1.3.0
|
|
77
|
-
devices.characteristics.forEach(function(element) {
|
|
77
|
+
devices.characteristics.forEach(function (element) {
|
|
78
78
|
// var service = new Characteristic(element, this);
|
|
79
79
|
if (element.type.substring(0, 8) === '00000023' && element.description === "Name") {
|
|
80
80
|
this.name = element.value;
|
|
@@ -84,7 +84,7 @@ function Service(devices, context) {
|
|
|
84
84
|
// this.characteristics.push(service);
|
|
85
85
|
}
|
|
86
86
|
}.bind(this));
|
|
87
|
-
devices.characteristics.forEach(function(element) {
|
|
87
|
+
devices.characteristics.forEach(function (element) {
|
|
88
88
|
var service = new Characteristic(element, this);
|
|
89
89
|
if (element.type.substring(0, 8) === '00000023' && element.description === "Name") {
|
|
90
90
|
this.name = element.value;
|
|
@@ -97,13 +97,13 @@ function Service(devices, context) {
|
|
|
97
97
|
if (this.configuredName) {
|
|
98
98
|
this.name = this.configuredName;
|
|
99
99
|
}
|
|
100
|
-
// Uncomment to display services not defined
|
|
101
|
-
// if (!this.service) {
|
|
102
|
-
// console.log('Missing', devices);
|
|
103
|
-
// }
|
|
100
|
+
// Uncomment to display services not defined
|
|
101
|
+
// if (!this.service) {
|
|
102
|
+
// console.log('Missing', devices);
|
|
103
|
+
// }
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
-
Service.prototype.toList = function(context) {
|
|
106
|
+
Service.prototype.toList = function (context) {
|
|
107
107
|
var descriptions;
|
|
108
108
|
var getCharacteristics;
|
|
109
109
|
var putCharacteristics = [];
|
|
@@ -115,6 +115,8 @@ Service.prototype.toList = function(context) {
|
|
|
115
115
|
// Fix for #30
|
|
116
116
|
if (context.manufacturer === "Nest" && (this.name === "Fan" || this.name === "Eco Mode")) {
|
|
117
117
|
fullName = context.name + " - " + this.name;
|
|
118
|
+
} else if (context.manufacturer === "Mitsubishi" && !fullName.includes(this.name)) {
|
|
119
|
+
fullName = context.name + " - " + this.name;
|
|
118
120
|
} else {
|
|
119
121
|
context.name = this.name;
|
|
120
122
|
fullName = context.name;
|
|
@@ -292,7 +294,7 @@ function _normalizeName(id) {
|
|
|
292
294
|
return ("Transfer Transport Management");
|
|
293
295
|
case "00000012":
|
|
294
296
|
return ("Heartrate");
|
|
295
|
-
|
|
297
|
+
// Eve types
|
|
296
298
|
case "B77831FD":
|
|
297
299
|
return ("Air Pressure Service");
|
|
298
300
|
case "E863F007":
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-red-contrib-homebridge-automation",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "NodeRED Automation for HomeBridge",
|
|
5
5
|
"main": "HAP-NodeRed.js",
|
|
6
6
|
"scripts": {
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"better-queue": ">=3.8.12",
|
|
29
29
|
"debug": "^4.3.4",
|
|
30
|
-
"hap-node-client": ">=0.2.
|
|
30
|
+
"hap-node-client": ">=0.2.4"
|
|
31
31
|
},
|
|
32
32
|
"author": "NorthernMan54",
|
|
33
33
|
"license": "ISC",
|