homebridge-smartsystem 7.1.2 → 7.1.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 +5 -3
- package/server/smartapp.js +6 -9
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "homebridge-smartsystem",
|
|
3
3
|
"displayname": "Duotecno Bridge",
|
|
4
|
-
"version": "7.1.
|
|
4
|
+
"version": "7.1.4",
|
|
5
5
|
"description": "SmartServer (Proxy TCP sockets to the cloud, Smappee MQTT, Duotecno IP Nodes, Homekit interface)",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"author": "Johan Coppieters",
|
|
@@ -13,7 +13,9 @@
|
|
|
13
13
|
"build": "npx tsc --build",
|
|
14
14
|
"unpublish": "npm unpublish --force homebridge-smartsystem@6.8.17",
|
|
15
15
|
"prepublishOnly": "npm run build",
|
|
16
|
-
"
|
|
16
|
+
"release:patch": "git add -A && git commit -m 'pre-release' --allow-empty && npm version patch && npm publish && git push && git push --tags",
|
|
17
|
+
"release:minor": "git add -A && git commit -m 'pre-release' --allow-empty && npm version minor && npm publish && git push && git push --tags",
|
|
18
|
+
"release:major": "git add -A && git commit -m 'pre-release' --allow-empty && npm version major && npm publish && git push && git push --tags"
|
|
17
19
|
},
|
|
18
20
|
"engines": {
|
|
19
21
|
"node": "^18.20.4 || ^20.15.1 || ^22",
|
|
@@ -32,7 +34,7 @@
|
|
|
32
34
|
],
|
|
33
35
|
"repository": {
|
|
34
36
|
"type": "git",
|
|
35
|
-
"url": "https://github.com/
|
|
37
|
+
"url": "https://github.com/Duotecno-developer/smartsocket.git"
|
|
36
38
|
},
|
|
37
39
|
"dependencies": {
|
|
38
40
|
"bonjour-service": "^1.3.0",
|
package/server/smartapp.js
CHANGED
|
@@ -760,7 +760,9 @@ class SmartApp extends webapp_1.WebApp {
|
|
|
760
760
|
//////////////////////
|
|
761
761
|
sendDeviceList(ws) {
|
|
762
762
|
const devices = this.getDeviceList();
|
|
763
|
+
console.log("Sending device list to WebSocket client: " + JSON.stringify(devices));
|
|
763
764
|
if (ws.readyState === WebSocket.OPEN) {
|
|
765
|
+
(0, logger_1.debug)("smartapp", devices);
|
|
764
766
|
ws.send(JSON.stringify(devices));
|
|
765
767
|
}
|
|
766
768
|
}
|
|
@@ -883,18 +885,13 @@ class SmartApp extends webapp_1.WebApp {
|
|
|
883
885
|
(0, logger_1.err)("smartapp", "WebSocket message must be an array");
|
|
884
886
|
return;
|
|
885
887
|
}
|
|
886
|
-
//
|
|
887
|
-
if (data.length === 0) {
|
|
888
|
-
this.sendDeviceList(ws);
|
|
889
|
-
return;
|
|
890
|
-
}
|
|
891
|
-
// Process relay control commands
|
|
888
|
+
// Process relay control commands if any
|
|
892
889
|
for (const cmd of data) {
|
|
893
890
|
if (cmd.id && cmd.relay !== undefined) {
|
|
894
891
|
yield this.setDeviceRelay(cmd.id, cmd.relay);
|
|
895
892
|
}
|
|
896
893
|
}
|
|
897
|
-
// Send updated device list
|
|
894
|
+
// Send updated device list or if array was empty: keep-alive / poll
|
|
898
895
|
this.sendDeviceList(ws);
|
|
899
896
|
});
|
|
900
897
|
}
|
|
@@ -921,8 +918,8 @@ class SmartApp extends webapp_1.WebApp {
|
|
|
921
918
|
(0, logger_1.err)("smartapp", `Unit ${unit} in node ${node} not found`);
|
|
922
919
|
return;
|
|
923
920
|
}
|
|
924
|
-
// Set the unit state
|
|
925
|
-
yield master.setUnitStatus(unitObj, state
|
|
921
|
+
// Set the unit state
|
|
922
|
+
yield master.setUnitStatus(unitObj, state);
|
|
926
923
|
});
|
|
927
924
|
}
|
|
928
925
|
setLink(inx, newstate, newvalue) {
|