ctucx.git: smartied

[nimlang] smarthome server

commit 3acc037f42838b3eaa1b12e3c4c6cb7b80619f7a
parent 008145f1ce3a5ff0fecd4fbf9fa77217a9be762b
Author: Isabelle K <hi@f2k1.de>
Date: Mon, 22 Feb 2021 17:18:19 +0100

support multiple zigbee remote actions
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/devices/zigbee2mqttRemote.nim b/src/devices/zigbee2mqttRemote.nim
@@ -9,7 +9,8 @@ proc handleRemote (topic: string, message: string) =
     let recivedData = parseJson(message)
 
     if config.actions.hasKey(recivedData["action"].getStr):
-      discard waitFor handleDeviceAction(config.actions[recivedData["action"].getStr])
+      for action in config.actions[recivedData["action"].getStr]:
+        discard waitFor handleDeviceAction(action)
 
   except:
     echo "Error[handleRemote]:\n", getCurrentExceptionMsg()
diff --git a/src/types.nim b/src/types.nim
@@ -84,7 +84,7 @@ type DeviceConfig* = object
   of Zigbee2MqttLamp:
     lampType*: Zigbee2MqttLampType
   of Zigbee2MqttRemote:
-    actions*: Table[string, Action]
+    actions*: Table[string, seq[Action]]
   else:
     unusedValue: Option[bool]