From a65cb738e5af7b2d6027cbed03c7014df4a9b824 Mon Sep 17 00:00:00 2001 From: Henning Stahlke Date: Thu, 30 Apr 2020 10:45:12 +0200 Subject: [PATCH] re-enable reload prop on modules.nas --- Nasal/modules.nas | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Nasal/modules.nas b/Nasal/modules.nas index 712a21651..82068fbfe 100644 --- a/Nasal/modules.nas +++ b/Nasal/modules.nas @@ -67,11 +67,20 @@ var Module = { } else { obj.node = MODULES_NODE.getNode(id, 1); } - + obj.reloadN = obj.node.initNode("reload", 0, "BOOL"); obj.loadedN = obj.node.initNode("loaded", 0, "BOOL"); obj.lcountN = obj.node.initNode("listeners", 0, "INT"); obj.tcountN = obj.node.initNode("timers", 0, "INT"); obj.lhitN = obj.node.initNode("listener-hits", 0, "INT"); + + obj.reloadL = setlistener(obj.reloadN, func(n) { + if (n.getValue()) { + n.setValue(0); + logprint(DEV_ALERT, "Reload triggered for ", obj.id, " (", + obj.reloadL, ")"); + obj.reload(); + } + }); _instances[id] = obj; return obj;