Browse Source

Merge pull request #817 from darshkpatel/dev

Added IR Toggle Mode
rfm69
Xose Pérez 6 years ago
committed by GitHub
parent
commit
a14dca0f42
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 36 additions and 1 deletions
  1. +32
    -0
      code/espurna/config/general.h
  2. +1
    -0
      code/espurna/config/types.h
  3. +3
    -1
      code/espurna/ir.ino

+ 32
- 0
code/espurna/config/general.h View File

@ -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
//--------------------------------------------------------------------------------


+ 1
- 0
code/espurna/config/types.h View File

@ -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


+ 3
- 1
code/espurna/ir.ino View File

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


Loading…
Cancel
Save