smart-nodes 0.4.12 → 0.4.13
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/CHANGELOG.md +4 -0
- package/package.json +1 -1
- package/text-exec/text-exec.js +15 -15
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
package/text-exec/text-exec.js
CHANGED
|
@@ -44,7 +44,7 @@ module.exports = function (RED)
|
|
|
44
44
|
|
|
45
45
|
// Holds references to the nodes to access them by room name
|
|
46
46
|
// Format: RoomName => [Node1, Node2, ..., NodeX]
|
|
47
|
-
let lookup =
|
|
47
|
+
let lookup = new Map();
|
|
48
48
|
|
|
49
49
|
|
|
50
50
|
node.status({});
|
|
@@ -214,9 +214,9 @@ module.exports = function (RED)
|
|
|
214
214
|
let room = rooms[parseInt(word.substring(1), 10)];
|
|
215
215
|
// node.log("Found room " + room);
|
|
216
216
|
|
|
217
|
-
if (lookup
|
|
217
|
+
if (lookup.has(room))
|
|
218
218
|
{
|
|
219
|
-
for (const node of lookup
|
|
219
|
+
for (const node of lookup.get(room))
|
|
220
220
|
{
|
|
221
221
|
if (without && affectedNodes.includes(node))
|
|
222
222
|
affectedNodes.splice(affectedNodes.indexOf(node), 1);
|
|
@@ -265,7 +265,7 @@ module.exports = function (RED)
|
|
|
265
265
|
{
|
|
266
266
|
for (const link of config.links)
|
|
267
267
|
{
|
|
268
|
-
|
|
268
|
+
node.log("Check node = " + link);
|
|
269
269
|
let linkedNode = RED.nodes.getNode(link);
|
|
270
270
|
|
|
271
271
|
if (linkedNode == null || linkedNode.exec_text_names == null || linkedNode.exec_text_names.length == 0)
|
|
@@ -280,23 +280,23 @@ module.exports = function (RED)
|
|
|
280
280
|
case "smart_scene-control":
|
|
281
281
|
case "smart_shutter-control":
|
|
282
282
|
case "smart_shutter-complex-control":
|
|
283
|
-
|
|
284
|
-
if (!lookup
|
|
285
|
-
lookup
|
|
283
|
+
node.log("Add room: " + name);
|
|
284
|
+
if (!lookup.has(name))
|
|
285
|
+
lookup.set(name, []);
|
|
286
286
|
|
|
287
|
-
if (!lookup
|
|
288
|
-
lookup
|
|
287
|
+
if (!lookup.get(name).includes(linkedNode))
|
|
288
|
+
lookup.get(name).push(linkedNode);
|
|
289
|
+
|
|
290
|
+
if (!rooms.includes(name))
|
|
291
|
+
{
|
|
292
|
+
node.log("Add room to room list: " + name);
|
|
293
|
+
rooms.push(name);
|
|
294
|
+
}
|
|
289
295
|
break;
|
|
290
296
|
|
|
291
297
|
default:
|
|
292
298
|
break;
|
|
293
299
|
}
|
|
294
|
-
|
|
295
|
-
if (!rooms.includes(name))
|
|
296
|
-
{
|
|
297
|
-
// node.log("Add room " + name);
|
|
298
|
-
rooms.push(name);
|
|
299
|
-
}
|
|
300
300
|
}
|
|
301
301
|
}
|
|
302
302
|
|