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.

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