From ff6816b2e1e9ca2d595e2f4d9f8620bb9563c7b2 Mon Sep 17 00:00:00 2001 From: Andrey Klimov Date: Sat, 18 Apr 2020 18:59:35 +0300 Subject: [PATCH] multiClick automation slightly modified Suffix calculaton bug fixed HUE&SAT impact to non-color channels fixed --- lighthub/inputs.cpp | 10 +++++++++- lighthub/item.cpp | 43 ++++++++++++++++++++++++------------------- 2 files changed, 33 insertions(+), 20 deletions(-) diff --git a/lighthub/inputs.cpp b/lighthub/inputs.cpp index 34ad5b9..f563262 100644 --- a/lighthub/inputs.cpp +++ b/lighthub/inputs.cpp @@ -712,7 +712,15 @@ switch (store->state) //Timer based transitions break; case IS_PRESSED3: - if (isTimeOver(store->timestamp16,millis() & 0xFFFF,T_LONG,0xFFFF)) changeState(IS_LONG3, cause); + if (isTimeOver(store->timestamp16,millis() & 0xFFFF,T_LONG,0xFFFF)) + { + if (!aJson.getObjectItem(inputObj, "lcmd3") && !aJson.getObjectItem(inputObj, "rpcmd3")) //No longpress handlers + { + if (aJson.getObjectItem(inputObj, "scmd3")) changeState(IS_WAITRELEASE, cause); //was used + else changeState(IS_PRESSED2, cause); // completely empty trippleClick section - fallback to first click handler + } + else changeState(IS_LONG3, cause); + } break; case IS_LONG3: diff --git a/lighthub/item.cpp b/lighthub/item.cpp index c453579..7c9afb6 100644 --- a/lighthub/item.cpp +++ b/lighthub/item.cpp @@ -106,6 +106,9 @@ int subitem2cmd(char *payload) { else if (strcmp_P(payload, AUTO_P) == 0) cmd = CMD_AUTO; else if (strcmp_P(payload, FAN_ONLY_P) == 0) cmd = CMD_FAN; else if (strcmp_P(payload, DRY_P) == 0) cmd = CMD_DRY; + //else if (strcmp_P(payload, HIGH_P) == 0) cmd = CMD_HIGH; + //else if (strcmp_P(payload, MED_P) == 0) cmd = CMD_MED; + //else if (strcmp_P(payload, LOW_P) == 0) cmd = CMD_LOW; return cmd; } @@ -394,12 +397,13 @@ int retrieveCode(char **psubItem) { int suffixCode; char* suffix; - +//debugSerial<"); } debugSerial<