Fork of the espurna firmware for `mhsw` switches
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

234 lines
7.7 KiB

  1. /*
  2. IR MODULE
  3. Copyright (C) 2018 by Alexander Kolesnikov (raw and MQTT implementation)
  4. Copyright (C) 2017-2019 by François Déchery
  5. Copyright (C) 2016-2019 by Xose Pérez <xose dot perez at gmail dot com>
  6. */
  7. #pragma once
  8. // Remote Buttons SET 1 (for the original Remote shipped with the controller)
  9. #if IR_BUTTON_SET == 1
  10. /*
  11. +------+------+------+------+
  12. | UP | Down | OFF | ON |
  13. +------+------+------+------+
  14. | R | G | B | W |
  15. +------+------+------+------+
  16. | 1 | 2 | 3 |FLASH |
  17. +------+------+------+------+
  18. | 4 | 5 | 6 |STROBE|
  19. +------+------+------+------+
  20. | 7 | 8 | 9 | FADE |
  21. +------+------+------+------+
  22. | 10 | 11 | 12 |SMOOTH|
  23. +------+------+------+------+
  24. */
  25. constexpr const size_t IR_BUTTON_COUNT = 24;
  26. const uint32_t IR_BUTTON[IR_BUTTON_COUNT][3] PROGMEM = {
  27. { 0xFF906F, IR_BUTTON_ACTION_BRIGHTER, 1 },
  28. { 0xFFB847, IR_BUTTON_ACTION_BRIGHTER, 0 },
  29. { 0xFFF807, IR_BUTTON_ACTION_STATE, 0 },
  30. { 0xFFB04F, IR_BUTTON_ACTION_STATE, 1 },
  31. { 0xFF9867, IR_BUTTON_ACTION_RGB, 0xFF0000 },
  32. { 0xFFD827, IR_BUTTON_ACTION_RGB, 0x00FF00 },
  33. { 0xFF8877, IR_BUTTON_ACTION_RGB, 0x0000FF },
  34. { 0xFFA857, IR_BUTTON_ACTION_RGB, 0xFFFFFF },
  35. { 0xFFE817, IR_BUTTON_ACTION_RGB, 0xD13A01 },
  36. { 0xFF48B7, IR_BUTTON_ACTION_RGB, 0x00E644 },
  37. { 0xFF6897, IR_BUTTON_ACTION_RGB, 0x0040A7 },
  38. { 0xFFB24D, IR_BUTTON_ACTION_EFFECT, LIGHT_EFFECT_FLASH },
  39. { 0xFF02FD, IR_BUTTON_ACTION_RGB, 0xE96F2A },
  40. { 0xFF32CD, IR_BUTTON_ACTION_RGB, 0x00BEBF },
  41. { 0xFF20DF, IR_BUTTON_ACTION_RGB, 0x56406F },
  42. { 0xFF00FF, IR_BUTTON_ACTION_EFFECT, LIGHT_EFFECT_STROBE },
  43. { 0xFF50AF, IR_BUTTON_ACTION_RGB, 0xEE9819 },
  44. { 0xFF7887, IR_BUTTON_ACTION_RGB, 0x00799A },
  45. { 0xFF708F, IR_BUTTON_ACTION_RGB, 0x944E80 },
  46. { 0xFF58A7, IR_BUTTON_ACTION_EFFECT, LIGHT_EFFECT_FADE },
  47. { 0xFF38C7, IR_BUTTON_ACTION_RGB, 0xFFFF00 },
  48. { 0xFF28D7, IR_BUTTON_ACTION_RGB, 0x0060A1 },
  49. { 0xFFF00F, IR_BUTTON_ACTION_RGB, 0xEF45AD },
  50. { 0xFF30CF, IR_BUTTON_ACTION_EFFECT, LIGHT_EFFECT_SMOOTH }
  51. };
  52. #endif
  53. //Remote Buttons SET 2 (another identical IR Remote shipped with another controller)
  54. #if IR_BUTTON_SET == 2
  55. /*
  56. +------+------+------+------+
  57. | UP | Down | OFF | ON |
  58. +------+------+------+------+
  59. | R | G | B | W |
  60. +------+------+------+------+
  61. | 1 | 2 | 3 |FLASH |
  62. +------+------+------+------+
  63. | 4 | 5 | 6 |STROBE|
  64. +------+------+------+------+
  65. | 7 | 8 | 9 | FADE |
  66. +------+------+------+------+
  67. | 10 | 11 | 12 |SMOOTH|
  68. +------+------+------+------+
  69. */
  70. constexpr const size_t IR_BUTTON_COUNT = 24;
  71. const unsigned long IR_BUTTON[IR_BUTTON_COUNT][3] PROGMEM = {
  72. { 0xFF00FF, IR_BUTTON_ACTION_BRIGHTER, 1 },
  73. { 0xFF807F, IR_BUTTON_ACTION_BRIGHTER, 0 },
  74. { 0xFF40BF, IR_BUTTON_ACTION_STATE, 0 },
  75. { 0xFFC03F, IR_BUTTON_ACTION_STATE, 1 },
  76. { 0xFF20DF, IR_BUTTON_ACTION_RGB, 0xFF0000 },
  77. { 0xFFA05F, IR_BUTTON_ACTION_RGB, 0x00FF00 },
  78. { 0xFF609F, IR_BUTTON_ACTION_RGB, 0x0000FF },
  79. { 0xFFE01F, IR_BUTTON_ACTION_RGB, 0xFFFFFF },
  80. { 0xFF10EF, IR_BUTTON_ACTION_RGB, 0xD13A01 },
  81. { 0xFF906F, IR_BUTTON_ACTION_RGB, 0x00E644 },
  82. { 0xFF50AF, IR_BUTTON_ACTION_RGB, 0x0040A7 },
  83. { 0xFFD02F, IR_BUTTON_ACTION_EFFECT, LIGHT_EFFECT_FLASH },
  84. { 0xFF30CF, IR_BUTTON_ACTION_RGB, 0xE96F2A },
  85. { 0xFFB04F, IR_BUTTON_ACTION_RGB, 0x00BEBF },
  86. { 0xFF708F, IR_BUTTON_ACTION_RGB, 0x56406F },
  87. { 0xFFF00F, IR_BUTTON_ACTION_EFFECT, LIGHT_EFFECT_STROBE },
  88. { 0xFF08F7, IR_BUTTON_ACTION_RGB, 0xEE9819 },
  89. { 0xFF8877, IR_BUTTON_ACTION_RGB, 0x00799A },
  90. { 0xFF48B7, IR_BUTTON_ACTION_RGB, 0x944E80 },
  91. { 0xFFC837, IR_BUTTON_ACTION_EFFECT, LIGHT_EFFECT_FADE },
  92. { 0xFF28D7, IR_BUTTON_ACTION_RGB, 0xFFFF00 },
  93. { 0xFFA857, IR_BUTTON_ACTION_RGB, 0x0060A1 },
  94. { 0xFF6897, IR_BUTTON_ACTION_RGB, 0xEF45AD },
  95. { 0xFFE817, IR_BUTTON_ACTION_EFFECT, LIGHT_EFFECT_SMOOTH }
  96. };
  97. #endif
  98. //Remote Buttons SET 3 (samsung AA59-00608A 8 Toggle Buttons for generic 8CH module)
  99. #if IR_BUTTON_SET == 3
  100. /*
  101. +------+------+------+
  102. | 1 | 2 | 3 |
  103. +------+------+------+
  104. | 4 | 5 | 6 |
  105. +------+------+------+
  106. | 7 | 8 | 9 |
  107. +------+------+------+
  108. | | 0 | |
  109. +------+------+------+
  110. */
  111. constexpr const size_t IR_BUTTON_COUNT = 8;
  112. const unsigned long IR_BUTTON[IR_BUTTON_COUNT][3] PROGMEM = {
  113. { 0xE0E020DF, IR_BUTTON_ACTION_TOGGLE, 0 }, // Toggle Relay #0
  114. { 0xE0E0A05F, IR_BUTTON_ACTION_TOGGLE, 1 }, // Toggle Relay #1
  115. { 0xE0E0609F, IR_BUTTON_ACTION_TOGGLE, 2 }, // Toggle Relay #2
  116. { 0xE0E010EF, IR_BUTTON_ACTION_TOGGLE, 3 }, // Toggle Relay #3
  117. { 0xE0E0906F, IR_BUTTON_ACTION_TOGGLE, 4 }, // Toggle Relay #4
  118. { 0xE0E050AF, IR_BUTTON_ACTION_TOGGLE, 5 }, // Toggle Relay #5
  119. { 0xE0E030CF, IR_BUTTON_ACTION_TOGGLE, 6 }, // Toggle Relay #6
  120. { 0xE0E0B04F, IR_BUTTON_ACTION_TOGGLE, 7 } // Toggle Relay #7
  121. //{ 0xE0E0708F, IR_BUTTON_ACTION_TOGGLE, 8 } //Extra Button
  122. //{ 0xE0E08877, IR_BUTTON_ACTION_TOGGLE, 9 } //Extra Button
  123. };
  124. #endif
  125. //Remote Buttons SET 4
  126. #if IR_BUTTON_SET == 4
  127. /*
  128. +------+------+------+
  129. | OFF | SRC | MUTE |
  130. +------+------+------+
  131. ...
  132. +------+------+------+
  133. */
  134. constexpr const size_t IR_BUTTON_COUNT = 1;
  135. const unsigned long IR_BUTTON[IR_BUTTON_COUNT][3] PROGMEM = {
  136. { 0xFFB24D, IR_BUTTON_ACTION_TOGGLE, 0 } // Toggle Relay #0
  137. };
  138. #endif
  139. //Remote Buttons SET 5 (another identical IR Remote shipped with another controller as SET 1 and 2)
  140. #if IR_BUTTON_SET == 5
  141. /*
  142. +------+------+------+------+
  143. | UP | Down | OFF | ON |
  144. +------+------+------+------+
  145. | R | G | B | W |
  146. +------+------+------+------+
  147. | 1 | 2 | 3 |FLASH |
  148. +------+------+------+------+
  149. | 4 | 5 | 6 |STROBE|
  150. +------+------+------+------+
  151. | 7 | 8 | 9 | FADE |
  152. +------+------+------+------+
  153. | 10 | 11 | 12 |SMOOTH|
  154. +------+------+------+------+
  155. */
  156. constexpr const size_t IR_BUTTON_COUNT = 24;
  157. const unsigned long IR_BUTTON[IR_BUTTON_COUNT][3] PROGMEM = {
  158. { 0xF700FF, IR_BUTTON_ACTION_BRIGHTER, 1 },
  159. { 0xF7807F, IR_BUTTON_ACTION_BRIGHTER, 0 },
  160. { 0xF740BF, IR_BUTTON_ACTION_STATE, 0 },
  161. { 0xF7C03F, IR_BUTTON_ACTION_STATE, 1 },
  162. { 0xF720DF, IR_BUTTON_ACTION_RGB, 0xFF0000 },
  163. { 0xF7A05F, IR_BUTTON_ACTION_RGB, 0x00FF00 },
  164. { 0xF7609F, IR_BUTTON_ACTION_RGB, 0x0000FF },
  165. { 0xF7E01F, IR_BUTTON_ACTION_RGB, 0xFFFFFF },
  166. { 0xF710EF, IR_BUTTON_ACTION_RGB, 0xD13A01 },
  167. { 0xF7906F, IR_BUTTON_ACTION_RGB, 0x00E644 },
  168. { 0xF750AF, IR_BUTTON_ACTION_RGB, 0x0040A7 },
  169. { 0xF7D02F, IR_BUTTON_ACTION_EFFECT, LIGHT_EFFECT_FLASH },
  170. { 0xF730CF, IR_BUTTON_ACTION_RGB, 0xE96F2A },
  171. { 0xF7B04F, IR_BUTTON_ACTION_RGB, 0x00BEBF },
  172. { 0xF7708F, IR_BUTTON_ACTION_RGB, 0x56406F },
  173. { 0xF7F00F, IR_BUTTON_ACTION_EFFECT, LIGHT_EFFECT_STROBE },
  174. { 0xF708F7, IR_BUTTON_ACTION_RGB, 0xEE9819 },
  175. { 0xF78877, IR_BUTTON_ACTION_RGB, 0x00799A },
  176. { 0xF748B7, IR_BUTTON_ACTION_RGB, 0x944E80 },
  177. { 0xF7C837, IR_BUTTON_ACTION_EFFECT, LIGHT_EFFECT_FADE },
  178. { 0xF728D7, IR_BUTTON_ACTION_RGB, 0xFFFF00 },
  179. { 0xF7A857, IR_BUTTON_ACTION_RGB, 0x0060A1 },
  180. { 0xF76897, IR_BUTTON_ACTION_RGB, 0xEF45AD },
  181. { 0xF7E817, IR_BUTTON_ACTION_EFFECT, LIGHT_EFFECT_SMOOTH }
  182. };
  183. #endif