From d89dfd23647c1b3db832f158e29331bc2633c701 Mon Sep 17 00:00:00 2001 From: Andrey Klimov Date: Sun, 14 Oct 2018 11:15:54 +0300 Subject: [PATCH] Prevent restoring temporary turned on channels (by XON) --- lighthub/item.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lighthub/item.cpp b/lighthub/item.cpp index 39d4820..152a8f0 100644 --- a/lighthub/item.cpp +++ b/lighthub/item.cpp @@ -515,7 +515,8 @@ int Item::Ctrl(short cmd, short n, int *Parameters, boolean send) { Par[0] = 0; Par[1] = 0; Par[2] = 0; - setCmd(cmd); + if (getCmd() == CMD_XON) setCmd(CMD_OFF); //Prevent restoring temporary turned on channels (by XON) + else setCmd(cmd); SendStatus(CMD_OFF); //HALT to OFF mapping - send in any cases Serial.println(F(" Halted")); }