@haydendonald/node-red-contrib-hass-stuff 1.2.5 → 1.2.6
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.
|
@@ -109,6 +109,11 @@ module.exports = function LightControlConfigNode(RED) {
|
|
|
109
109
|
};
|
|
110
110
|
RED.nodes.createNode(this, config);
|
|
111
111
|
(0, baseConfigNode_1.assignBaseConfigNode)(this);
|
|
112
|
+
//When NodeRED redeploys
|
|
113
|
+
self.on("close", function (done) {
|
|
114
|
+
clearTimeout(adaptiveInterval);
|
|
115
|
+
done();
|
|
116
|
+
});
|
|
112
117
|
const connectionsConfigNode = RED.nodes.getNode(config.connectionsConfigNode);
|
|
113
118
|
//When HASS is ready
|
|
114
119
|
connectionsConfigNode.hassEventReadyCallbacks[this.id] = function (msg) {
|
|
@@ -116,7 +121,7 @@ module.exports = function LightControlConfigNode(RED) {
|
|
|
116
121
|
connectionsConfigNode.getHASSEntityState(config.groupEntityId, (payload, data) => {
|
|
117
122
|
groupEntities = data.data.attributes.entity_id;
|
|
118
123
|
currentState = data.data;
|
|
119
|
-
entitiesOffDuringNight = config.entitiesOffAtNight.split(",");
|
|
124
|
+
entitiesOffDuringNight = config.entitiesOffAtNight.split(",").filter((entity) => entity != "");
|
|
120
125
|
entitiesOnDuringNight = groupEntities.filter((entity) => !entitiesOffDuringNight.includes(entity));
|
|
121
126
|
});
|
|
122
127
|
//Get the state of the night mode switch and store it
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@haydendonald/node-red-contrib-hass-stuff",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.6",
|
|
4
4
|
"description": "A collection of stuff I use on my Node Red + Home Assistant server. This could be of use for others, i don't know..",
|
|
5
5
|
"devDependencies": {
|
|
6
6
|
"@types/node": "^18.14.0",
|