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 //-------------------------------------------------------------------------------- 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 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) {