From f51c4e5e0aaee0185bee6e0a3ca5eb8ce6e88f7c Mon Sep 17 00:00:00 2001 From: Darsh Patel Date: Thu, 26 Apr 2018 16:44:28 +0530 Subject: [PATCH 1/3] Added Remote keypad for relay toggle Added samsung AA59-00608A , to toggle relays for a 8CH Relay Board --- code/espurna/config/general.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/code/espurna/config/general.h b/code/espurna/config/general.h index 8bebbe4b..2b1bf69a 100644 --- a/code/espurna/config/general.h +++ b/code/espurna/config/general.h @@ -1138,6 +1138,38 @@ #endif +//Remote Buttons SET 3 (samsung AA59-00608A 8 Toggle Buttons for generic 8CH module) +#if IR_BUTTON_SET == 3 +/* + +------+------+------+ + | 1 | 2 | 3 | + +------+------+------+ + | 4 | 5 | 6 | + +------+------+------+ + | 7 | 8 | 9 | + +------+------+------+ + | | 0 | | + +------+------+------+ +*/ +#define IR_BUTTON_COUNT 10 + + const unsigned long IR_BUTTON[IR_BUTTON_COUNT][3] PROGMEM = { + + { 0xE0E020DF, IR_BUTTON_MODE_TOGGLE, 0 }, // Toggle Relay #0 + { 0xE0E0A05F, IR_BUTTON_MODE_TOGGLE, 1 }, // Toggle Relay #1 + { 0xE0E0609F, IR_BUTTON_MODE_TOGGLE, 2 }, // Toggle Relay #2 + + { 0xE0E010EF, IR_BUTTON_MODE_TOGGLE, 3 }, // Toggle Relay #3 + { 0xE0E0906F, IR_BUTTON_MODE_TOGGLE, 4 }, // Toggle Relay #4 + { 0xE0E050AF, IR_BUTTON_MODE_TOGGLE, 5 }, // Toggle Relay #5 + + { 0xE0E030CF, IR_BUTTON_MODE_TOGGLE, 6 }, // Toggle Relay #6 + { 0xE0E0B04F, IR_BUTTON_MODE_TOGGLE, 7 } // Toggle Relay #7 + //{ 0xE0E0708F, IR_BUTTON_MODE_TOGGLE, 8 } //Extra Button + + //{ 0xE0E08877, IR_BUTTON_MODE_TOGGLE, 9 } //Extra Button + }; +#endif #endif // IR_SUPPORT //-------------------------------------------------------------------------------- From 692691986ce213bd8a15cdb5d75391549804000c Mon Sep 17 00:00:00 2001 From: Darsh Patel Date: Thu, 26 Apr 2018 16:46:04 +0530 Subject: [PATCH 2/3] Added toggle mode for IR --- code/espurna/config/types.h | 1 + 1 file changed, 1 insertion(+) diff --git a/code/espurna/config/types.h b/code/espurna/config/types.h index 646c8e91..5aa5b865 100644 --- a/code/espurna/config/types.h +++ b/code/espurna/config/types.h @@ -159,6 +159,7 @@ #define IR_BUTTON_MODE_BRIGHTER 3 #define IR_BUTTON_MODE_STATE 4 #define IR_BUTTON_MODE_EFFECT 5 +#define IR_BUTTON_MODE_TOGGLE 6 #define LIGHT_EFFECT_SOLID 0 #define LIGHT_EFFECT_FLASH 1 From 84592d15db11916dfaaa693fb46e7b802564344e Mon Sep 17 00:00:00 2001 From: Darsh Patel Date: Thu, 26 Apr 2018 16:47:25 +0530 Subject: [PATCH 3/3] Added Support for Toggle Mode --- code/espurna/ir.ino | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/espurna/ir.ino b/code/espurna/ir.ino index 241c6fa2..93d75878 100644 --- a/code/espurna/ir.ino +++ b/code/espurna/ir.ino @@ -42,7 +42,9 @@ void _irProcessCode(unsigned long code) { if (button_mode == IR_BUTTON_MODE_STATE) { relayStatus(0, button_value); } - + if (button_mode == IR_BUTTON_MODE_TOGGLE) { + relayToggle(button_value); + } #if LIGHT_PROVIDER != LIGHT_PROVIDER_NONE if (button_mode == IR_BUTTON_MODE_BRIGHTER) {