esphome 2024.12.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3393) hide show
  1. esphome/__init__.py +0 -0
  2. esphome/__main__.py +1045 -0
  3. esphome/automation.py +430 -0
  4. esphome/codegen.py +93 -0
  5. esphome/components/__init__.py +0 -0
  6. esphome/components/a01nyub/__init__.py +1 -0
  7. esphome/components/a01nyub/a01nyub.cpp +44 -0
  8. esphome/components/a01nyub/a01nyub.h +27 -0
  9. esphome/components/a01nyub/sensor.py +41 -0
  10. esphome/components/a02yyuw/__init__.py +1 -0
  11. esphome/components/a02yyuw/a02yyuw.cpp +43 -0
  12. esphome/components/a02yyuw/a02yyuw.h +27 -0
  13. esphome/components/a02yyuw/sensor.py +41 -0
  14. esphome/components/a4988/__init__.py +0 -0
  15. esphome/components/a4988/a4988.cpp +56 -0
  16. esphome/components/a4988/a4988.h +29 -0
  17. esphome/components/a4988/stepper.py +33 -0
  18. esphome/components/absolute_humidity/__init__.py +1 -0
  19. esphome/components/absolute_humidity/absolute_humidity.cpp +182 -0
  20. esphome/components/absolute_humidity/absolute_humidity.h +76 -0
  21. esphome/components/absolute_humidity/sensor.py +56 -0
  22. esphome/components/ac_dimmer/__init__.py +0 -0
  23. esphome/components/ac_dimmer/ac_dimmer.cpp +233 -0
  24. esphome/components/ac_dimmer/ac_dimmer.h +70 -0
  25. esphome/components/ac_dimmer/output.py +52 -0
  26. esphome/components/adalight/__init__.py +27 -0
  27. esphome/components/adalight/adalight_light_effect.cpp +142 -0
  28. esphome/components/adalight/adalight_light_effect.h +39 -0
  29. esphome/components/adc/__init__.py +208 -0
  30. esphome/components/adc/adc_sensor.h +90 -0
  31. esphome/components/adc/adc_sensor_common.cpp +24 -0
  32. esphome/components/adc/adc_sensor_esp32.cpp +163 -0
  33. esphome/components/adc/adc_sensor_esp8266.cpp +58 -0
  34. esphome/components/adc/adc_sensor_libretiny.cpp +48 -0
  35. esphome/components/adc/adc_sensor_rp2040.cpp +93 -0
  36. esphome/components/adc/sensor.py +136 -0
  37. esphome/components/adc128s102/__init__.py +23 -0
  38. esphome/components/adc128s102/adc128s102.cpp +35 -0
  39. esphome/components/adc128s102/adc128s102.h +23 -0
  40. esphome/components/adc128s102/sensor/__init__.py +38 -0
  41. esphome/components/adc128s102/sensor/adc128s102_sensor.cpp +24 -0
  42. esphome/components/adc128s102/sensor/adc128s102_sensor.h +29 -0
  43. esphome/components/addressable_light/__init__.py +0 -0
  44. esphome/components/addressable_light/addressable_light_display.cpp +67 -0
  45. esphome/components/addressable_light/addressable_light_display.h +63 -0
  46. esphome/components/addressable_light/display.py +62 -0
  47. esphome/components/ade7880/__init__.py +1 -0
  48. esphome/components/ade7880/ade7880.cpp +304 -0
  49. esphome/components/ade7880/ade7880.h +131 -0
  50. esphome/components/ade7880/ade7880_i2c.cpp +101 -0
  51. esphome/components/ade7880/ade7880_registers.h +243 -0
  52. esphome/components/ade7880/sensor.py +290 -0
  53. esphome/components/ade7953/__init__.py +1 -0
  54. esphome/components/ade7953/sensor.py +5 -0
  55. esphome/components/ade7953_base/__init__.py +201 -0
  56. esphome/components/ade7953_base/ade7953_base.cpp +150 -0
  57. esphome/components/ade7953_base/ade7953_base.h +125 -0
  58. esphome/components/ade7953_i2c/__init__.py +1 -0
  59. esphome/components/ade7953_i2c/ade7953_i2c.cpp +80 -0
  60. esphome/components/ade7953_i2c/ade7953_i2c.h +28 -0
  61. esphome/components/ade7953_i2c/sensor.py +27 -0
  62. esphome/components/ade7953_spi/__init__.py +1 -0
  63. esphome/components/ade7953_spi/ade7953_spi.cpp +81 -0
  64. esphome/components/ade7953_spi/ade7953_spi.h +32 -0
  65. esphome/components/ade7953_spi/sensor.py +27 -0
  66. esphome/components/ads1115/__init__.py +32 -0
  67. esphome/components/ads1115/ads1115.cpp +177 -0
  68. esphome/components/ads1115/ads1115.h +53 -0
  69. esphome/components/ads1115/sensor/__init__.py +81 -0
  70. esphome/components/ads1115/sensor/ads1115_sensor.cpp +30 -0
  71. esphome/components/ads1115/sensor/ads1115_sensor.h +35 -0
  72. esphome/components/ads1118/__init__.py +25 -0
  73. esphome/components/ads1118/ads1118.cpp +126 -0
  74. esphome/components/ads1118/ads1118.h +46 -0
  75. esphome/components/ads1118/sensor/__init__.py +97 -0
  76. esphome/components/ads1118/sensor/ads1118_sensor.cpp +29 -0
  77. esphome/components/ads1118/sensor/ads1118_sensor.h +36 -0
  78. esphome/components/ags10/__init__.py +1 -0
  79. esphome/components/ags10/ags10.cpp +214 -0
  80. esphome/components/ags10/ags10.h +152 -0
  81. esphome/components/ags10/sensor.py +132 -0
  82. esphome/components/aht10/__init__.py +0 -0
  83. esphome/components/aht10/aht10.cpp +172 -0
  84. esphome/components/aht10/aht10.h +36 -0
  85. esphome/components/aht10/sensor.py +65 -0
  86. esphome/components/aic3204/__init__.py +0 -0
  87. esphome/components/aic3204/aic3204.cpp +173 -0
  88. esphome/components/aic3204/aic3204.h +88 -0
  89. esphome/components/aic3204/audio_dac.py +52 -0
  90. esphome/components/aic3204/automation.h +23 -0
  91. esphome/components/airthings_ble/__init__.py +23 -0
  92. esphome/components/airthings_ble/airthings_listener.cpp +34 -0
  93. esphome/components/airthings_ble/airthings_listener.h +19 -0
  94. esphome/components/airthings_wave_base/__init__.py +103 -0
  95. esphome/components/airthings_wave_base/airthings_wave_base.cpp +211 -0
  96. esphome/components/airthings_wave_base/airthings_wave_base.h +90 -0
  97. esphome/components/airthings_wave_mini/__init__.py +1 -0
  98. esphome/components/airthings_wave_mini/airthings_wave_mini.cpp +55 -0
  99. esphome/components/airthings_wave_mini/airthings_wave_mini.h +40 -0
  100. esphome/components/airthings_wave_mini/sensor.py +28 -0
  101. esphome/components/airthings_wave_plus/__init__.py +1 -0
  102. esphome/components/airthings_wave_plus/airthings_wave_plus.cpp +86 -0
  103. esphome/components/airthings_wave_plus/airthings_wave_plus.h +55 -0
  104. esphome/components/airthings_wave_plus/sensor.py +76 -0
  105. esphome/components/alarm_control_panel/__init__.py +316 -0
  106. esphome/components/alarm_control_panel/alarm_control_panel.cpp +156 -0
  107. esphome/components/alarm_control_panel/alarm_control_panel.h +200 -0
  108. esphome/components/alarm_control_panel/alarm_control_panel_call.cpp +103 -0
  109. esphome/components/alarm_control_panel/alarm_control_panel_call.h +40 -0
  110. esphome/components/alarm_control_panel/alarm_control_panel_state.cpp +34 -0
  111. esphome/components/alarm_control_panel/alarm_control_panel_state.h +29 -0
  112. esphome/components/alarm_control_panel/automation.h +191 -0
  113. esphome/components/alpha3/__init__.py +1 -0
  114. esphome/components/alpha3/alpha3.cpp +191 -0
  115. esphome/components/alpha3/alpha3.h +73 -0
  116. esphome/components/alpha3/sensor.py +85 -0
  117. esphome/components/am2315c/__init__.py +1 -0
  118. esphome/components/am2315c/am2315c.cpp +200 -0
  119. esphome/components/am2315c/am2315c.h +51 -0
  120. esphome/components/am2315c/sensor.py +54 -0
  121. esphome/components/am2320/__init__.py +0 -0
  122. esphome/components/am2320/am2320.cpp +92 -0
  123. esphome/components/am2320/am2320.h +29 -0
  124. esphome/components/am2320/sensor.py +56 -0
  125. esphome/components/am43/__init__.py +1 -0
  126. esphome/components/am43/am43_base.cpp +144 -0
  127. esphome/components/am43/am43_base.h +78 -0
  128. esphome/components/am43/cover/__init__.py +36 -0
  129. esphome/components/am43/cover/am43_cover.cpp +157 -0
  130. esphome/components/am43/cover/am43_cover.h +45 -0
  131. esphome/components/am43/sensor/__init__.py +53 -0
  132. esphome/components/am43/sensor/am43_sensor.cpp +120 -0
  133. esphome/components/am43/sensor/am43_sensor.h +45 -0
  134. esphome/components/analog_threshold/__init__.py +1 -0
  135. esphome/components/analog_threshold/analog_threshold_binary_sensor.cpp +40 -0
  136. esphome/components/analog_threshold/analog_threshold_binary_sensor.h +29 -0
  137. esphome/components/analog_threshold/binary_sensor.py +50 -0
  138. esphome/components/animation/__init__.py +343 -0
  139. esphome/components/animation/animation.cpp +70 -0
  140. esphome/components/animation/animation.h +67 -0
  141. esphome/components/anova/__init__.py +0 -0
  142. esphome/components/anova/anova.cpp +158 -0
  143. esphome/components/anova/anova.h +52 -0
  144. esphome/components/anova/anova_base.cpp +134 -0
  145. esphome/components/anova/anova_base.h +79 -0
  146. esphome/components/anova/climate.py +36 -0
  147. esphome/components/apds9306/__init__.py +4 -0
  148. esphome/components/apds9306/apds9306.cpp +152 -0
  149. esphome/components/apds9306/apds9306.h +66 -0
  150. esphome/components/apds9306/sensor.py +95 -0
  151. esphome/components/apds9960/__init__.py +69 -0
  152. esphome/components/apds9960/apds9960.cpp +408 -0
  153. esphome/components/apds9960/apds9960.h +76 -0
  154. esphome/components/apds9960/binary_sensor.py +25 -0
  155. esphome/components/apds9960/sensor.py +33 -0
  156. esphome/components/api/__init__.py +286 -0
  157. esphome/components/api/api_connection.cpp +1572 -0
  158. esphome/components/api/api_connection.h +272 -0
  159. esphome/components/api/api_frame_helper.cpp +1031 -0
  160. esphome/components/api/api_frame_helper.h +193 -0
  161. esphome/components/api/api_noise_context.h +23 -0
  162. esphome/components/api/api_pb2.cpp +8946 -0
  163. esphome/components/api/api_pb2.h +2288 -0
  164. esphome/components/api/api_pb2_service.cpp +1728 -0
  165. esphome/components/api/api_pb2_service.h +557 -0
  166. esphome/components/api/api_server.cpp +407 -0
  167. esphome/components/api/api_server.h +157 -0
  168. esphome/components/api/client.py +60 -0
  169. esphome/components/api/custom_api_device.h +219 -0
  170. esphome/components/api/homeassistant_service.h +84 -0
  171. esphome/components/api/list_entities.cpp +108 -0
  172. esphome/components/api/list_entities.h +90 -0
  173. esphome/components/api/proto.cpp +92 -0
  174. esphome/components/api/proto.h +313 -0
  175. esphome/components/api/subscribe_state.cpp +88 -0
  176. esphome/components/api/subscribe_state.h +85 -0
  177. esphome/components/api/user_services.cpp +44 -0
  178. esphome/components/api/user_services.h +75 -0
  179. esphome/components/as3935/__init__.py +59 -0
  180. esphome/components/as3935/as3935.cpp +326 -0
  181. esphome/components/as3935/as3935.h +132 -0
  182. esphome/components/as3935/binary_sensor.py +18 -0
  183. esphome/components/as3935/sensor.py +40 -0
  184. esphome/components/as3935_i2c/__init__.py +26 -0
  185. esphome/components/as3935_i2c/as3935_i2c.cpp +44 -0
  186. esphome/components/as3935_i2c/as3935_i2c.h +22 -0
  187. esphome/components/as3935_spi/__init__.py +26 -0
  188. esphome/components/as3935_spi/as3935_spi.cpp +48 -0
  189. esphome/components/as3935_spi/as3935_spi.h +27 -0
  190. esphome/components/as5600/__init__.py +227 -0
  191. esphome/components/as5600/as5600.cpp +138 -0
  192. esphome/components/as5600/as5600.h +105 -0
  193. esphome/components/as5600/sensor/__init__.py +119 -0
  194. esphome/components/as5600/sensor/as5600_sensor.cpp +98 -0
  195. esphome/components/as5600/sensor/as5600_sensor.h +43 -0
  196. esphome/components/as7341/__init__.py +0 -0
  197. esphome/components/as7341/as7341.cpp +271 -0
  198. esphome/components/as7341/as7341.h +144 -0
  199. esphome/components/as7341/sensor.py +112 -0
  200. esphome/components/async_tcp/__init__.py +28 -0
  201. esphome/components/at581x/__init__.py +223 -0
  202. esphome/components/at581x/at581x.cpp +195 -0
  203. esphome/components/at581x/at581x.h +62 -0
  204. esphome/components/at581x/automation.h +71 -0
  205. esphome/components/at581x/switch/__init__.py +31 -0
  206. esphome/components/at581x/switch/rf_switch.cpp +12 -0
  207. esphome/components/at581x/switch/rf_switch.h +15 -0
  208. esphome/components/atc_mithermometer/__init__.py +0 -0
  209. esphome/components/atc_mithermometer/atc_mithermometer.cpp +133 -0
  210. esphome/components/atc_mithermometer/atc_mithermometer.h +51 -0
  211. esphome/components/atc_mithermometer/sensor.py +100 -0
  212. esphome/components/atm90e26/__init__.py +1 -0
  213. esphome/components/atm90e26/atm90e26.cpp +235 -0
  214. esphome/components/atm90e26/atm90e26.h +72 -0
  215. esphome/components/atm90e26/atm90e26_reg.h +70 -0
  216. esphome/components/atm90e26/sensor.py +157 -0
  217. esphome/components/atm90e32/__init__.py +7 -0
  218. esphome/components/atm90e32/atm90e32.cpp +496 -0
  219. esphome/components/atm90e32/atm90e32.h +140 -0
  220. esphome/components/atm90e32/atm90e32_reg.h +270 -0
  221. esphome/components/atm90e32/button/__init__.py +43 -0
  222. esphome/components/atm90e32/button/atm90e32_button.cpp +20 -0
  223. esphome/components/atm90e32/button/atm90e32_button.h +27 -0
  224. esphome/components/atm90e32/sensor.py +233 -0
  225. esphome/components/audio/__init__.py +9 -0
  226. esphome/components/audio/audio.h +21 -0
  227. esphome/components/audio_dac/__init__.py +57 -0
  228. esphome/components/audio_dac/audio_dac.h +23 -0
  229. esphome/components/audio_dac/automation.h +43 -0
  230. esphome/components/axs15231/__init__.py +6 -0
  231. esphome/components/axs15231/touchscreen/__init__.py +36 -0
  232. esphome/components/axs15231/touchscreen/axs15231_touchscreen.cpp +64 -0
  233. esphome/components/axs15231/touchscreen/axs15231_touchscreen.h +27 -0
  234. esphome/components/b_parasite/__init__.py +0 -0
  235. esphome/components/b_parasite/b_parasite.cpp +108 -0
  236. esphome/components/b_parasite/b_parasite.h +42 -0
  237. esphome/components/b_parasite/sensor.py +92 -0
  238. esphome/components/ballu/__init__.py +0 -0
  239. esphome/components/ballu/ballu.cpp +239 -0
  240. esphome/components/ballu/ballu.h +31 -0
  241. esphome/components/ballu/climate.py +21 -0
  242. esphome/components/bang_bang/__init__.py +1 -0
  243. esphome/components/bang_bang/bang_bang_climate.cpp +210 -0
  244. esphome/components/bang_bang/bang_bang_climate.h +89 -0
  245. esphome/components/bang_bang/climate.py +82 -0
  246. esphome/components/bedjet/__init__.py +52 -0
  247. esphome/components/bedjet/bedjet_child.h +23 -0
  248. esphome/components/bedjet/bedjet_codec.cpp +169 -0
  249. esphome/components/bedjet/bedjet_codec.h +194 -0
  250. esphome/components/bedjet/bedjet_const.h +107 -0
  251. esphome/components/bedjet/bedjet_hub.cpp +546 -0
  252. esphome/components/bedjet/bedjet_hub.h +178 -0
  253. esphome/components/bedjet/climate/__init__.py +75 -0
  254. esphome/components/bedjet/climate/bedjet_climate.cpp +353 -0
  255. esphome/components/bedjet/climate/bedjet_climate.h +94 -0
  256. esphome/components/bedjet/fan/__init__.py +36 -0
  257. esphome/components/bedjet/fan/bedjet_fan.cpp +113 -0
  258. esphome/components/bedjet/fan/bedjet_fan.h +40 -0
  259. esphome/components/bedjet/sensor/__init__.py +55 -0
  260. esphome/components/bedjet/sensor/bedjet_sensor.cpp +34 -0
  261. esphome/components/bedjet/sensor/bedjet_sensor.h +32 -0
  262. esphome/components/beken_spi_led_strip/__init__.py +0 -0
  263. esphome/components/beken_spi_led_strip/led_strip.cpp +384 -0
  264. esphome/components/beken_spi_led_strip/led_strip.h +85 -0
  265. esphome/components/beken_spi_led_strip/light.py +134 -0
  266. esphome/components/bh1750/__init__.py +0 -0
  267. esphome/components/bh1750/bh1750.cpp +169 -0
  268. esphome/components/bh1750/bh1750.h +33 -0
  269. esphome/components/bh1750/sensor.py +45 -0
  270. esphome/components/binary/__init__.py +3 -0
  271. esphome/components/binary/fan/__init__.py +38 -0
  272. esphome/components/binary/fan/binary_fan.cpp +40 -0
  273. esphome/components/binary/fan/binary_fan.h +31 -0
  274. esphome/components/binary/light/__init__.py +22 -0
  275. esphome/components/binary/light/binary_light_output.h +33 -0
  276. esphome/components/binary_sensor/__init__.py +589 -0
  277. esphome/components/binary_sensor/automation.cpp +123 -0
  278. esphome/components/binary_sensor/automation.h +158 -0
  279. esphome/components/binary_sensor/binary_sensor.cpp +68 -0
  280. esphome/components/binary_sensor/binary_sensor.h +91 -0
  281. esphome/components/binary_sensor/filter.cpp +133 -0
  282. esphome/components/binary_sensor/filter.h +126 -0
  283. esphome/components/binary_sensor_map/__init__.py +0 -0
  284. esphome/components/binary_sensor_map/binary_sensor_map.cpp +142 -0
  285. esphome/components/binary_sensor_map/binary_sensor_map.h +100 -0
  286. esphome/components/binary_sensor_map/sensor.py +106 -0
  287. esphome/components/bk72xx/__init__.py +51 -0
  288. esphome/components/bk72xx/boards.py +1264 -0
  289. esphome/components/bl0906/__init__.py +1 -0
  290. esphome/components/bl0906/bl0906.cpp +238 -0
  291. esphome/components/bl0906/bl0906.h +96 -0
  292. esphome/components/bl0906/const.py +4 -0
  293. esphome/components/bl0906/constants.h +122 -0
  294. esphome/components/bl0906/sensor.py +185 -0
  295. esphome/components/bl0939/__init__.py +1 -0
  296. esphome/components/bl0939/bl0939.cpp +146 -0
  297. esphome/components/bl0939/bl0939.h +107 -0
  298. esphome/components/bl0939/sensor.py +119 -0
  299. esphome/components/bl0940/__init__.py +1 -0
  300. esphome/components/bl0940/bl0940.cpp +138 -0
  301. esphome/components/bl0940/bl0940.h +109 -0
  302. esphome/components/bl0940/sensor.py +101 -0
  303. esphome/components/bl0942/__init__.py +1 -0
  304. esphome/components/bl0942/bl0942.cpp +215 -0
  305. esphome/components/bl0942/bl0942.h +152 -0
  306. esphome/components/bl0942/sensor.py +128 -0
  307. esphome/components/ble_client/__init__.py +308 -0
  308. esphome/components/ble_client/automation.cpp +13 -0
  309. esphome/components/ble_client/automation.h +378 -0
  310. esphome/components/ble_client/ble_client.cpp +89 -0
  311. esphome/components/ble_client/ble_client.h +81 -0
  312. esphome/components/ble_client/output/__init__.py +68 -0
  313. esphome/components/ble_client/output/ble_binary_output.cpp +77 -0
  314. esphome/components/ble_client/output/ble_binary_output.h +43 -0
  315. esphome/components/ble_client/sensor/__init__.py +161 -0
  316. esphome/components/ble_client/sensor/automation.h +41 -0
  317. esphome/components/ble_client/sensor/ble_rssi_sensor.cpp +79 -0
  318. esphome/components/ble_client/sensor/ble_rssi_sensor.h +35 -0
  319. esphome/components/ble_client/sensor/ble_sensor.cpp +142 -0
  320. esphome/components/ble_client/sensor/ble_sensor.h +52 -0
  321. esphome/components/ble_client/switch/__init__.py +22 -0
  322. esphome/components/ble_client/switch/ble_switch.cpp +36 -0
  323. esphome/components/ble_client/switch/ble_switch.h +30 -0
  324. esphome/components/ble_client/text_sensor/__init__.py +108 -0
  325. esphome/components/ble_client/text_sensor/automation.h +39 -0
  326. esphome/components/ble_client/text_sensor/ble_text_sensor.cpp +133 -0
  327. esphome/components/ble_client/text_sensor/ble_text_sensor.h +46 -0
  328. esphome/components/ble_presence/__init__.py +0 -0
  329. esphome/components/ble_presence/binary_sensor.py +93 -0
  330. esphome/components/ble_presence/ble_presence_device.cpp +16 -0
  331. esphome/components/ble_presence/ble_presence_device.h +143 -0
  332. esphome/components/ble_rssi/__init__.py +0 -0
  333. esphome/components/ble_rssi/ble_rssi_sensor.cpp +16 -0
  334. esphome/components/ble_rssi/ble_rssi_sensor.h +126 -0
  335. esphome/components/ble_rssi/sensor.py +89 -0
  336. esphome/components/ble_scanner/__init__.py +0 -0
  337. esphome/components/ble_scanner/ble_scanner.cpp +16 -0
  338. esphome/components/ble_scanner/ble_scanner.h +38 -0
  339. esphome/components/ble_scanner/text_sensor.py +25 -0
  340. esphome/components/bluetooth_proxy/__init__.py +83 -0
  341. esphome/components/bluetooth_proxy/bluetooth_connection.cpp +268 -0
  342. esphome/components/bluetooth_proxy/bluetooth_connection.h +37 -0
  343. esphome/components/bluetooth_proxy/bluetooth_proxy.cpp +522 -0
  344. esphome/components/bluetooth_proxy/bluetooth_proxy.h +134 -0
  345. esphome/components/bme280_base/__init__.py +108 -0
  346. esphome/components/bme280_base/bme280_base.cpp +359 -0
  347. esphome/components/bme280_base/bme280_base.h +114 -0
  348. esphome/components/bme280_i2c/__init__.py +0 -0
  349. esphome/components/bme280_i2c/bme280_i2c.cpp +30 -0
  350. esphome/components/bme280_i2c/bme280_i2c.h +20 -0
  351. esphome/components/bme280_i2c/sensor.py +21 -0
  352. esphome/components/bme280_spi/__init__.py +0 -0
  353. esphome/components/bme280_spi/bme280_spi.cpp +65 -0
  354. esphome/components/bme280_spi/bme280_spi.h +20 -0
  355. esphome/components/bme280_spi/sensor.py +23 -0
  356. esphome/components/bme680/__init__.py +0 -0
  357. esphome/components/bme680/bme680.cpp +515 -0
  358. esphome/components/bme680/bme680.h +139 -0
  359. esphome/components/bme680/sensor.py +159 -0
  360. esphome/components/bme680_bsec/__init__.py +88 -0
  361. esphome/components/bme680_bsec/bme680_bsec.cpp +563 -0
  362. esphome/components/bme680_bsec/bme680_bsec.h +137 -0
  363. esphome/components/bme680_bsec/sensor.py +123 -0
  364. esphome/components/bme680_bsec/text_sensor.py +32 -0
  365. esphome/components/bme68x_bsec2/__init__.py +196 -0
  366. esphome/components/bme68x_bsec2/bme68x_bsec2.cpp +526 -0
  367. esphome/components/bme68x_bsec2/bme68x_bsec2.h +161 -0
  368. esphome/components/bme68x_bsec2/sensor.py +130 -0
  369. esphome/components/bme68x_bsec2/text_sensor.py +33 -0
  370. esphome/components/bme68x_bsec2_i2c/__init__.py +28 -0
  371. esphome/components/bme68x_bsec2_i2c/bme68x_bsec2_i2c.cpp +53 -0
  372. esphome/components/bme68x_bsec2_i2c/bme68x_bsec2_i2c.h +28 -0
  373. esphome/components/bmi160/__init__.py +1 -0
  374. esphome/components/bmi160/bmi160.cpp +270 -0
  375. esphome/components/bmi160/bmi160.h +44 -0
  376. esphome/components/bmi160/sensor.py +102 -0
  377. esphome/components/bmp085/__init__.py +0 -0
  378. esphome/components/bmp085/bmp085.cpp +138 -0
  379. esphome/components/bmp085/bmp085.h +45 -0
  380. esphome/components/bmp085/sensor.py +56 -0
  381. esphome/components/bmp280/__init__.py +0 -0
  382. esphome/components/bmp280/sensor.py +5 -0
  383. esphome/components/bmp280_base/__init__.py +88 -0
  384. esphome/components/bmp280_base/bmp280_base.cpp +273 -0
  385. esphome/components/bmp280_base/bmp280_base.h +98 -0
  386. esphome/components/bmp280_i2c/__init__.py +0 -0
  387. esphome/components/bmp280_i2c/bmp280_i2c.cpp +27 -0
  388. esphome/components/bmp280_i2c/bmp280_i2c.h +22 -0
  389. esphome/components/bmp280_i2c/sensor.py +22 -0
  390. esphome/components/bmp280_spi/__init__.py +0 -0
  391. esphome/components/bmp280_spi/bmp280_spi.cpp +65 -0
  392. esphome/components/bmp280_spi/bmp280_spi.h +20 -0
  393. esphome/components/bmp280_spi/sensor.py +22 -0
  394. esphome/components/bmp3xx/__init__.py +0 -0
  395. esphome/components/bmp3xx/sensor.py +7 -0
  396. esphome/components/bmp3xx_base/__init__.py +95 -0
  397. esphome/components/bmp3xx_base/bmp3xx_base.cpp +389 -0
  398. esphome/components/bmp3xx_base/bmp3xx_base.h +242 -0
  399. esphome/components/bmp3xx_i2c/__init__.py +0 -0
  400. esphome/components/bmp3xx_i2c/bmp3xx_i2c.cpp +29 -0
  401. esphome/components/bmp3xx_i2c/bmp3xx_i2c.h +17 -0
  402. esphome/components/bmp3xx_i2c/sensor.py +22 -0
  403. esphome/components/bmp3xx_spi/__init__.py +0 -0
  404. esphome/components/bmp3xx_spi/bmp3xx_spi.cpp +57 -0
  405. esphome/components/bmp3xx_spi/bmp3xx_spi.h +19 -0
  406. esphome/components/bmp3xx_spi/sensor.py +22 -0
  407. esphome/components/bmp581/__init__.py +0 -0
  408. esphome/components/bmp581/bmp581.cpp +596 -0
  409. esphome/components/bmp581/bmp581.h +222 -0
  410. esphome/components/bmp581/sensor.py +163 -0
  411. esphome/components/bp1658cj/__init__.py +44 -0
  412. esphome/components/bp1658cj/bp1658cj.cpp +131 -0
  413. esphome/components/bp1658cj/bp1658cj.h +64 -0
  414. esphome/components/bp1658cj/output.py +27 -0
  415. esphome/components/bp5758d/__init__.py +33 -0
  416. esphome/components/bp5758d/bp5758d.cpp +169 -0
  417. esphome/components/bp5758d/bp5758d.h +64 -0
  418. esphome/components/bp5758d/output.py +29 -0
  419. esphome/components/button/__init__.py +133 -0
  420. esphome/components/button/automation.h +28 -0
  421. esphome/components/button/button.cpp +17 -0
  422. esphome/components/button/button.h +52 -0
  423. esphome/components/bytebuffer/__init__.py +5 -0
  424. esphome/components/bytebuffer/bytebuffer.h +421 -0
  425. esphome/components/canbus/__init__.py +169 -0
  426. esphome/components/canbus/canbus.cpp +96 -0
  427. esphome/components/canbus/canbus.h +160 -0
  428. esphome/components/cap1188/__init__.py +45 -0
  429. esphome/components/cap1188/binary_sensor.py +23 -0
  430. esphome/components/cap1188/cap1188.cpp +88 -0
  431. esphome/components/cap1188/cap1188.h +70 -0
  432. esphome/components/captive_portal/__init__.py +49 -0
  433. esphome/components/captive_portal/captive_index.h +109 -0
  434. esphome/components/captive_portal/captive_portal.cpp +95 -0
  435. esphome/components/captive_portal/captive_portal.h +75 -0
  436. esphome/components/ccs811/__init__.py +0 -0
  437. esphome/components/ccs811/ccs811.cpp +189 -0
  438. esphome/components/ccs811/ccs811.h +57 -0
  439. esphome/components/ccs811/sensor.py +84 -0
  440. esphome/components/cd74hc4067/__init__.py +54 -0
  441. esphome/components/cd74hc4067/cd74hc4067.cpp +87 -0
  442. esphome/components/cd74hc4067/cd74hc4067.h +65 -0
  443. esphome/components/cd74hc4067/sensor.py +55 -0
  444. esphome/components/ch422g/__init__.py +76 -0
  445. esphome/components/ch422g/ch422g.cpp +139 -0
  446. esphome/components/ch422g/ch422g.h +68 -0
  447. esphome/components/climate/__init__.py +487 -0
  448. esphome/components/climate/automation.h +62 -0
  449. esphome/components/climate/climate.cpp +632 -0
  450. esphome/components/climate/climate.h +307 -0
  451. esphome/components/climate/climate_mode.cpp +111 -0
  452. esphome/components/climate/climate_mode.h +117 -0
  453. esphome/components/climate/climate_traits.cpp +15 -0
  454. esphome/components/climate/climate_traits.h +213 -0
  455. esphome/components/climate_ir/__init__.py +50 -0
  456. esphome/components/climate_ir/climate_ir.cpp +84 -0
  457. esphome/components/climate_ir/climate_ir.h +71 -0
  458. esphome/components/climate_ir_lg/__init__.py +0 -0
  459. esphome/components/climate_ir_lg/climate.py +47 -0
  460. esphome/components/climate_ir_lg/climate_ir_lg.cpp +222 -0
  461. esphome/components/climate_ir_lg/climate_ir_lg.h +57 -0
  462. esphome/components/color/__init__.py +108 -0
  463. esphome/components/color_temperature/__init__.py +0 -0
  464. esphome/components/color_temperature/ct_light_output.h +38 -0
  465. esphome/components/color_temperature/light.py +42 -0
  466. esphome/components/combination/__init__.py +0 -0
  467. esphome/components/combination/combination.cpp +262 -0
  468. esphome/components/combination/combination.h +141 -0
  469. esphome/components/combination/sensor.py +176 -0
  470. esphome/components/coolix/__init__.py +0 -0
  471. esphome/components/coolix/climate.py +21 -0
  472. esphome/components/coolix/coolix.cpp +162 -0
  473. esphome/components/coolix/coolix.h +45 -0
  474. esphome/components/copy/__init__.py +5 -0
  475. esphome/components/copy/binary_sensor/__init__.py +41 -0
  476. esphome/components/copy/binary_sensor/copy_binary_sensor.cpp +18 -0
  477. esphome/components/copy/binary_sensor/copy_binary_sensor.h +21 -0
  478. esphome/components/copy/button/__init__.py +41 -0
  479. esphome/components/copy/button/copy_button.cpp +14 -0
  480. esphome/components/copy/button/copy_button.h +22 -0
  481. esphome/components/copy/cover/__init__.py +38 -0
  482. esphome/components/copy/cover/copy_cover.cpp +51 -0
  483. esphome/components/copy/cover/copy_cover.h +25 -0
  484. esphome/components/copy/fan/__init__.py +36 -0
  485. esphome/components/copy/fan/copy_fan.cpp +58 -0
  486. esphome/components/copy/fan/copy_fan.h +26 -0
  487. esphome/components/copy/lock/__init__.py +36 -0
  488. esphome/components/copy/lock/copy_lock.cpp +29 -0
  489. esphome/components/copy/lock/copy_lock.h +23 -0
  490. esphome/components/copy/number/__init__.py +41 -0
  491. esphome/components/copy/number/copy_number.cpp +29 -0
  492. esphome/components/copy/number/copy_number.h +23 -0
  493. esphome/components/copy/select/__init__.py +39 -0
  494. esphome/components/copy/select/copy_select.cpp +27 -0
  495. esphome/components/copy/select/copy_select.h +23 -0
  496. esphome/components/copy/sensor/__init__.py +45 -0
  497. esphome/components/copy/sensor/copy_sensor.cpp +18 -0
  498. esphome/components/copy/sensor/copy_sensor.h +21 -0
  499. esphome/components/copy/switch/__init__.py +39 -0
  500. esphome/components/copy/switch/copy_switch.cpp +26 -0
  501. esphome/components/copy/switch/copy_switch.h +23 -0
  502. esphome/components/copy/text/__init__.py +36 -0
  503. esphome/components/copy/text/copy_text.cpp +25 -0
  504. esphome/components/copy/text/copy_text.h +23 -0
  505. esphome/components/copy/text_sensor/__init__.py +37 -0
  506. esphome/components/copy/text_sensor/copy_text_sensor.cpp +18 -0
  507. esphome/components/copy/text_sensor/copy_text_sensor.h +21 -0
  508. esphome/components/cover/__init__.py +230 -0
  509. esphome/components/cover/automation.h +135 -0
  510. esphome/components/cover/cover.cpp +226 -0
  511. esphome/components/cover/cover.h +179 -0
  512. esphome/components/cover/cover_traits.h +30 -0
  513. esphome/components/cs5460a/__init__.py +0 -0
  514. esphome/components/cs5460a/cs5460a.cpp +340 -0
  515. esphome/components/cs5460a/cs5460a.h +125 -0
  516. esphome/components/cs5460a/sensor.py +138 -0
  517. esphome/components/cse7761/__init__.py +0 -0
  518. esphome/components/cse7761/cse7761.cpp +244 -0
  519. esphome/components/cse7761/cse7761.h +52 -0
  520. esphome/components/cse7761/sensor.py +90 -0
  521. esphome/components/cse7766/__init__.py +0 -0
  522. esphome/components/cse7766/cse7766.cpp +251 -0
  523. esphome/components/cse7766/cse7766.h +48 -0
  524. esphome/components/cse7766/sensor.py +111 -0
  525. esphome/components/cst226/__init__.py +6 -0
  526. esphome/components/cst226/touchscreen/__init__.py +38 -0
  527. esphome/components/cst226/touchscreen/cst226_touchscreen.cpp +92 -0
  528. esphome/components/cst226/touchscreen/cst226_touchscreen.h +44 -0
  529. esphome/components/cst816/__init__.py +6 -0
  530. esphome/components/cst816/binary_sensor/__init__.py +28 -0
  531. esphome/components/cst816/binary_sensor/cst816_button.h +27 -0
  532. esphome/components/cst816/touchscreen/__init__.py +37 -0
  533. esphome/components/cst816/touchscreen/cst816_touchscreen.cpp +118 -0
  534. esphome/components/cst816/touchscreen/cst816_touchscreen.h +63 -0
  535. esphome/components/ct_clamp/__init__.py +0 -0
  536. esphome/components/ct_clamp/ct_clamp_sensor.cpp +74 -0
  537. esphome/components/ct_clamp/ct_clamp_sensor.h +54 -0
  538. esphome/components/ct_clamp/sensor.py +45 -0
  539. esphome/components/current_based/__init__.py +1 -0
  540. esphome/components/current_based/cover.py +128 -0
  541. esphome/components/current_based/current_based_cover.cpp +270 -0
  542. esphome/components/current_based/current_based_cover.h +97 -0
  543. esphome/components/custom/__init__.py +3 -0
  544. esphome/components/custom/binary_sensor/__init__.py +31 -0
  545. esphome/components/custom/binary_sensor/custom_binary_sensor.cpp +16 -0
  546. esphome/components/custom/binary_sensor/custom_binary_sensor.h +26 -0
  547. esphome/components/custom/climate/__init__.py +30 -0
  548. esphome/components/custom/climate/custom_climate.h +22 -0
  549. esphome/components/custom/cover/__init__.py +30 -0
  550. esphome/components/custom/cover/custom_cover.h +21 -0
  551. esphome/components/custom/light/__init__.py +30 -0
  552. esphome/components/custom/light/custom_light_output.h +24 -0
  553. esphome/components/custom/output/__init__.py +61 -0
  554. esphome/components/custom/output/custom_output.h +37 -0
  555. esphome/components/custom/sensor/__init__.py +27 -0
  556. esphome/components/custom/sensor/custom_sensor.cpp +16 -0
  557. esphome/components/custom/sensor/custom_sensor.h +24 -0
  558. esphome/components/custom/switch/__init__.py +27 -0
  559. esphome/components/custom/switch/custom_switch.cpp +16 -0
  560. esphome/components/custom/switch/custom_switch.h +24 -0
  561. esphome/components/custom/text_sensor/__init__.py +32 -0
  562. esphome/components/custom/text_sensor/custom_text_sensor.cpp +16 -0
  563. esphome/components/custom/text_sensor/custom_text_sensor.h +26 -0
  564. esphome/components/custom_component/__init__.py +31 -0
  565. esphome/components/custom_component/custom_component.h +28 -0
  566. esphome/components/cwww/__init__.py +0 -0
  567. esphome/components/cwww/cwww_light_output.h +40 -0
  568. esphome/components/cwww/light.py +48 -0
  569. esphome/components/dac7678/__init__.py +32 -0
  570. esphome/components/dac7678/dac7678_output.cpp +86 -0
  571. esphome/components/dac7678/dac7678_output.h +55 -0
  572. esphome/components/dac7678/output.py +27 -0
  573. esphome/components/daikin/__init__.py +0 -0
  574. esphome/components/daikin/climate.py +20 -0
  575. esphome/components/daikin/daikin.cpp +249 -0
  576. esphome/components/daikin/daikin.h +64 -0
  577. esphome/components/daikin_arc/__init__.py +1 -0
  578. esphome/components/daikin_arc/climate.py +18 -0
  579. esphome/components/daikin_arc/daikin_arc.cpp +487 -0
  580. esphome/components/daikin_arc/daikin_arc.h +76 -0
  581. esphome/components/daikin_brc/__init__.py +1 -0
  582. esphome/components/daikin_brc/climate.py +23 -0
  583. esphome/components/daikin_brc/daikin_brc.cpp +273 -0
  584. esphome/components/daikin_brc/daikin_brc.h +82 -0
  585. esphome/components/dallas/__init__.py +7 -0
  586. esphome/components/dallas/sensor.py +5 -0
  587. esphome/components/dallas_temp/__init__.py +1 -0
  588. esphome/components/dallas_temp/dallas_temp.cpp +169 -0
  589. esphome/components/dallas_temp/dallas_temp.h +32 -0
  590. esphome/components/dallas_temp/sensor.py +43 -0
  591. esphome/components/daly_bms/__init__.py +33 -0
  592. esphome/components/daly_bms/binary_sensor.py +38 -0
  593. esphome/components/daly_bms/daly_bms.cpp +319 -0
  594. esphome/components/daly_bms/daly_bms.h +91 -0
  595. esphome/components/daly_bms/sensor.py +229 -0
  596. esphome/components/daly_bms/text_sensor.py +34 -0
  597. esphome/components/dashboard_import/__init__.py +168 -0
  598. esphome/components/dashboard_import/dashboard_import.cpp +12 -0
  599. esphome/components/dashboard_import/dashboard_import.h +12 -0
  600. esphome/components/datetime/__init__.py +271 -0
  601. esphome/components/datetime/date_entity.cpp +131 -0
  602. esphome/components/datetime/date_entity.h +117 -0
  603. esphome/components/datetime/datetime_base.h +48 -0
  604. esphome/components/datetime/datetime_entity.cpp +252 -0
  605. esphome/components/datetime/datetime_entity.h +152 -0
  606. esphome/components/datetime/time_entity.cpp +154 -0
  607. esphome/components/datetime/time_entity.h +131 -0
  608. esphome/components/debug/__init__.py +46 -0
  609. esphome/components/debug/debug_component.cpp +93 -0
  610. esphome/components/debug/debug_component.h +70 -0
  611. esphome/components/debug/debug_esp32.cpp +297 -0
  612. esphome/components/debug/debug_esp8266.cpp +94 -0
  613. esphome/components/debug/debug_host.cpp +18 -0
  614. esphome/components/debug/debug_libretiny.cpp +44 -0
  615. esphome/components/debug/debug_rp2040.cpp +23 -0
  616. esphome/components/debug/sensor.py +86 -0
  617. esphome/components/debug/text_sensor.py +40 -0
  618. esphome/components/deep_sleep/__init__.py +316 -0
  619. esphome/components/deep_sleep/deep_sleep_component.cpp +76 -0
  620. esphome/components/deep_sleep/deep_sleep_component.h +217 -0
  621. esphome/components/deep_sleep/deep_sleep_esp32.cpp +104 -0
  622. esphome/components/deep_sleep/deep_sleep_esp8266.cpp +23 -0
  623. esphome/components/delonghi/__init__.py +1 -0
  624. esphome/components/delonghi/climate.py +20 -0
  625. esphome/components/delonghi/delonghi.cpp +186 -0
  626. esphome/components/delonghi/delonghi.h +64 -0
  627. esphome/components/demo/__init__.py +425 -0
  628. esphome/components/demo/demo_binary_sensor.h +22 -0
  629. esphome/components/demo/demo_climate.h +158 -0
  630. esphome/components/demo/demo_cover.h +87 -0
  631. esphome/components/demo/demo_fan.h +66 -0
  632. esphome/components/demo/demo_light.h +68 -0
  633. esphome/components/demo/demo_number.h +39 -0
  634. esphome/components/demo/demo_sensor.h +29 -0
  635. esphome/components/demo/demo_switch.h +22 -0
  636. esphome/components/demo/demo_text_sensor.h +25 -0
  637. esphome/components/dfplayer/__init__.py +373 -0
  638. esphome/components/dfplayer/dfplayer.cpp +263 -0
  639. esphome/components/dfplayer/dfplayer.h +182 -0
  640. esphome/components/dfrobot_sen0395/__init__.py +205 -0
  641. esphome/components/dfrobot_sen0395/automation.h +89 -0
  642. esphome/components/dfrobot_sen0395/binary_sensor.py +22 -0
  643. esphome/components/dfrobot_sen0395/commands.cpp +321 -0
  644. esphome/components/dfrobot_sen0395/commands.h +156 -0
  645. esphome/components/dfrobot_sen0395/dfrobot_sen0395.cpp +142 -0
  646. esphome/components/dfrobot_sen0395/dfrobot_sen0395.h +125 -0
  647. esphome/components/dfrobot_sen0395/switch/__init__.py +65 -0
  648. esphome/components/dfrobot_sen0395/switch/dfrobot_sen0395_switch.cpp +48 -0
  649. esphome/components/dfrobot_sen0395/switch/dfrobot_sen0395_switch.h +34 -0
  650. esphome/components/dht/__init__.py +1 -0
  651. esphome/components/dht/dht.cpp +257 -0
  652. esphome/components/dht/dht.h +65 -0
  653. esphome/components/dht/sensor.py +71 -0
  654. esphome/components/dht12/__init__.py +0 -0
  655. esphome/components/dht12/dht12.cpp +70 -0
  656. esphome/components/dht12/dht12.h +28 -0
  657. esphome/components/dht12/sensor.py +54 -0
  658. esphome/components/display/__init__.py +198 -0
  659. esphome/components/display/display.cpp +856 -0
  660. esphome/components/display/display.h +765 -0
  661. esphome/components/display/display_buffer.cpp +72 -0
  662. esphome/components/display/display_buffer.h +34 -0
  663. esphome/components/display/display_color_utils.h +159 -0
  664. esphome/components/display/rect.cpp +98 -0
  665. esphome/components/display/rect.h +36 -0
  666. esphome/components/display_menu_base/__init__.py +428 -0
  667. esphome/components/display_menu_base/automation.h +133 -0
  668. esphome/components/display_menu_base/display_menu_base.cpp +329 -0
  669. esphome/components/display_menu_base/display_menu_base.h +82 -0
  670. esphome/components/display_menu_base/menu_item.cpp +202 -0
  671. esphome/components/display_menu_base/menu_item.h +191 -0
  672. esphome/components/dps310/__init__.py +0 -0
  673. esphome/components/dps310/dps310.cpp +189 -0
  674. esphome/components/dps310/dps310.h +65 -0
  675. esphome/components/dps310/sensor.py +62 -0
  676. esphome/components/ds1307/__init__.py +0 -0
  677. esphome/components/ds1307/ds1307.cpp +109 -0
  678. esphome/components/ds1307/ds1307.h +70 -0
  679. esphome/components/ds1307/time.py +58 -0
  680. esphome/components/dsmr/__init__.py +93 -0
  681. esphome/components/dsmr/dsmr.cpp +333 -0
  682. esphome/components/dsmr/dsmr.h +146 -0
  683. esphome/components/dsmr/sensor.py +290 -0
  684. esphome/components/dsmr/text_sensor.py +51 -0
  685. esphome/components/duty_cycle/__init__.py +0 -0
  686. esphome/components/duty_cycle/duty_cycle_sensor.cpp +63 -0
  687. esphome/components/duty_cycle/duty_cycle_sensor.h +37 -0
  688. esphome/components/duty_cycle/sensor.py +35 -0
  689. esphome/components/duty_time/__init__.py +1 -0
  690. esphome/components/duty_time/duty_time_sensor.cpp +105 -0
  691. esphome/components/duty_time/duty_time_sensor.h +76 -0
  692. esphome/components/duty_time/sensor.py +127 -0
  693. esphome/components/e131/__init__.py +58 -0
  694. esphome/components/e131/e131.cpp +122 -0
  695. esphome/components/e131/e131.h +57 -0
  696. esphome/components/e131/e131_addressable_light_effect.cpp +94 -0
  697. esphome/components/e131/e131_addressable_light_effect.h +45 -0
  698. esphome/components/e131/e131_packet.cpp +141 -0
  699. esphome/components/ee895/__init__.py +0 -0
  700. esphome/components/ee895/ee895.cpp +115 -0
  701. esphome/components/ee895/ee895.h +34 -0
  702. esphome/components/ee895/sensor.py +69 -0
  703. esphome/components/ektf2232/__init__.py +0 -0
  704. esphome/components/ektf2232/touchscreen/__init__.py +42 -0
  705. esphome/components/ektf2232/touchscreen/ektf2232.cpp +132 -0
  706. esphome/components/ektf2232/touchscreen/ektf2232.h +35 -0
  707. esphome/components/emc2101/__init__.py +83 -0
  708. esphome/components/emc2101/emc2101.cpp +169 -0
  709. esphome/components/emc2101/emc2101.h +115 -0
  710. esphome/components/emc2101/output/__init__.py +21 -0
  711. esphome/components/emc2101/output/emc2101_output.cpp +9 -0
  712. esphome/components/emc2101/output/emc2101_output.h +22 -0
  713. esphome/components/emc2101/sensor/__init__.py +74 -0
  714. esphome/components/emc2101/sensor/emc2101_sensor.cpp +43 -0
  715. esphome/components/emc2101/sensor/emc2101_sensor.h +39 -0
  716. esphome/components/emmeti/__init__.py +0 -0
  717. esphome/components/emmeti/climate.py +21 -0
  718. esphome/components/emmeti/emmeti.cpp +316 -0
  719. esphome/components/emmeti/emmeti.h +109 -0
  720. esphome/components/endstop/__init__.py +0 -0
  721. esphome/components/endstop/cover.py +59 -0
  722. esphome/components/endstop/endstop_cover.cpp +192 -0
  723. esphome/components/endstop/endstop_cover.h +58 -0
  724. esphome/components/ens160/__init__.py +0 -0
  725. esphome/components/ens160/sensor.py +7 -0
  726. esphome/components/ens160_base/__init__.py +78 -0
  727. esphome/components/ens160_base/ens160_base.cpp +320 -0
  728. esphome/components/ens160_base/ens160_base.h +64 -0
  729. esphome/components/ens160_i2c/__init__.py +0 -0
  730. esphome/components/ens160_i2c/ens160_i2c.cpp +32 -0
  731. esphome/components/ens160_i2c/ens160_i2c.h +19 -0
  732. esphome/components/ens160_i2c/sensor.py +22 -0
  733. esphome/components/ens160_spi/__init__.py +0 -0
  734. esphome/components/ens160_spi/ens160_spi.cpp +59 -0
  735. esphome/components/ens160_spi/ens160_spi.h +22 -0
  736. esphome/components/ens160_spi/sensor.py +22 -0
  737. esphome/components/ens210/__init__.py +0 -0
  738. esphome/components/ens210/ens210.cpp +230 -0
  739. esphome/components/ens210/ens210.h +39 -0
  740. esphome/components/ens210/sensor.py +58 -0
  741. esphome/components/es8311/__init__.py +0 -0
  742. esphome/components/es8311/audio_dac.py +70 -0
  743. esphome/components/es8311/es8311.cpp +227 -0
  744. esphome/components/es8311/es8311.h +135 -0
  745. esphome/components/es8311/es8311_const.h +195 -0
  746. esphome/components/esp32/__init__.py +853 -0
  747. esphome/components/esp32/boards.py +2303 -0
  748. esphome/components/esp32/const.py +42 -0
  749. esphome/components/esp32/core.cpp +85 -0
  750. esphome/components/esp32/gpio.cpp +144 -0
  751. esphome/components/esp32/gpio.h +40 -0
  752. esphome/components/esp32/gpio.py +219 -0
  753. esphome/components/esp32/gpio_esp32.py +71 -0
  754. esphome/components/esp32/gpio_esp32_c2.py +32 -0
  755. esphome/components/esp32/gpio_esp32_c3.py +45 -0
  756. esphome/components/esp32/gpio_esp32_c6.py +45 -0
  757. esphome/components/esp32/gpio_esp32_h2.py +52 -0
  758. esphome/components/esp32/gpio_esp32_s2.py +74 -0
  759. esphome/components/esp32/gpio_esp32_s3.py +64 -0
  760. esphome/components/esp32/post_build.py.script +77 -0
  761. esphome/components/esp32/preferences.cpp +199 -0
  762. esphome/components/esp32/preferences.h +12 -0
  763. esphome/components/esp32_ble/__init__.py +119 -0
  764. esphome/components/esp32_ble/ble.cpp +443 -0
  765. esphome/components/esp32_ble/ble.h +159 -0
  766. esphome/components/esp32_ble/ble_advertising.cpp +165 -0
  767. esphome/components/esp32_ble/ble_advertising.h +60 -0
  768. esphome/components/esp32_ble/ble_event.h +94 -0
  769. esphome/components/esp32_ble/ble_uuid.cpp +195 -0
  770. esphome/components/esp32_ble/ble_uuid.h +47 -0
  771. esphome/components/esp32_ble/const_esp32c6.h +74 -0
  772. esphome/components/esp32_ble/queue.h +56 -0
  773. esphome/components/esp32_ble_beacon/__init__.py +85 -0
  774. esphome/components/esp32_ble_beacon/esp32_ble_beacon.cpp +128 -0
  775. esphome/components/esp32_ble_beacon/esp32_ble_beacon.h +69 -0
  776. esphome/components/esp32_ble_client/__init__.py +11 -0
  777. esphome/components/esp32_ble_client/ble_characteristic.cpp +99 -0
  778. esphome/components/esp32_ble_client/ble_characteristic.h +39 -0
  779. esphome/components/esp32_ble_client/ble_client_base.cpp +487 -0
  780. esphome/components/esp32_ble_client/ble_client_base.h +113 -0
  781. esphome/components/esp32_ble_client/ble_descriptor.h +25 -0
  782. esphome/components/esp32_ble_client/ble_service.cpp +77 -0
  783. esphome/components/esp32_ble_client/ble_service.h +36 -0
  784. esphome/components/esp32_ble_server/__init__.py +54 -0
  785. esphome/components/esp32_ble_server/ble_2901.cpp +18 -0
  786. esphome/components/esp32_ble_server/ble_2901.h +19 -0
  787. esphome/components/esp32_ble_server/ble_2902.cpp +20 -0
  788. esphome/components/esp32_ble_server/ble_2902.h +18 -0
  789. esphome/components/esp32_ble_server/ble_characteristic.cpp +324 -0
  790. esphome/components/esp32_ble_server/ble_characteristic.h +101 -0
  791. esphome/components/esp32_ble_server/ble_descriptor.cpp +78 -0
  792. esphome/components/esp32_ble_server/ble_descriptor.h +51 -0
  793. esphome/components/esp32_ble_server/ble_server.cpp +207 -0
  794. esphome/components/esp32_ble_server/ble_server.h +103 -0
  795. esphome/components/esp32_ble_server/ble_service.cpp +177 -0
  796. esphome/components/esp32_ble_server/ble_service.h +90 -0
  797. esphome/components/esp32_ble_tracker/__init__.py +332 -0
  798. esphome/components/esp32_ble_tracker/automation.h +112 -0
  799. esphome/components/esp32_ble_tracker/esp32_ble_tracker.cpp +743 -0
  800. esphome/components/esp32_ble_tracker/esp32_ble_tracker.h +271 -0
  801. esphome/components/esp32_camera/__init__.py +315 -0
  802. esphome/components/esp32_camera/esp32_camera.cpp +431 -0
  803. esphome/components/esp32_camera/esp32_camera.h +250 -0
  804. esphome/components/esp32_camera_web_server/__init__.py +28 -0
  805. esphome/components/esp32_camera_web_server/camera_web_server.cpp +244 -0
  806. esphome/components/esp32_camera_web_server/camera_web_server.h +51 -0
  807. esphome/components/esp32_can/__init__.py +0 -0
  808. esphome/components/esp32_can/canbus.py +100 -0
  809. esphome/components/esp32_can/esp32_can.cpp +158 -0
  810. esphome/components/esp32_can/esp32_can.h +33 -0
  811. esphome/components/esp32_dac/__init__.py +0 -0
  812. esphome/components/esp32_dac/esp32_dac.cpp +54 -0
  813. esphome/components/esp32_dac/esp32_dac.h +32 -0
  814. esphome/components/esp32_dac/output.py +35 -0
  815. esphome/components/esp32_hall/__init__.py +0 -0
  816. esphome/components/esp32_hall/esp32_hall.cpp +25 -0
  817. esphome/components/esp32_hall/esp32_hall.h +23 -0
  818. esphome/components/esp32_hall/sensor.py +28 -0
  819. esphome/components/esp32_improv/__init__.py +146 -0
  820. esphome/components/esp32_improv/automation.h +72 -0
  821. esphome/components/esp32_improv/esp32_improv_component.cpp +349 -0
  822. esphome/components/esp32_improv/esp32_improv_component.h +120 -0
  823. esphome/components/esp32_rmt/__init__.py +55 -0
  824. esphome/components/esp32_rmt_led_strip/__init__.py +0 -0
  825. esphome/components/esp32_rmt_led_strip/led_strip.cpp +224 -0
  826. esphome/components/esp32_rmt_led_strip/led_strip.h +92 -0
  827. esphome/components/esp32_rmt_led_strip/light.py +155 -0
  828. esphome/components/esp32_touch/__init__.py +325 -0
  829. esphome/components/esp32_touch/binary_sensor.py +39 -0
  830. esphome/components/esp32_touch/esp32_touch.cpp +346 -0
  831. esphome/components/esp32_touch/esp32_touch.h +122 -0
  832. esphome/components/esp8266/__init__.py +262 -0
  833. esphome/components/esp8266/boards.py +362 -0
  834. esphome/components/esp8266/const.py +11 -0
  835. esphome/components/esp8266/core.cpp +73 -0
  836. esphome/components/esp8266/core.h +14 -0
  837. esphome/components/esp8266/gpio.cpp +109 -0
  838. esphome/components/esp8266/gpio.h +38 -0
  839. esphome/components/esp8266/gpio.py +210 -0
  840. esphome/components/esp8266/post_build.py.script +23 -0
  841. esphome/components/esp8266/preferences.cpp +291 -0
  842. esphome/components/esp8266/preferences.h +14 -0
  843. esphome/components/esp8266_pwm/__init__.py +0 -0
  844. esphome/components/esp8266_pwm/esp8266_pwm.cpp +58 -0
  845. esphome/components/esp8266_pwm/esp8266_pwm.h +54 -0
  846. esphome/components/esp8266_pwm/output.py +68 -0
  847. esphome/components/esphome/ota/__init__.py +134 -0
  848. esphome/components/esphome/ota/ota_esphome.cpp +413 -0
  849. esphome/components/esphome/ota/ota_esphome.h +45 -0
  850. esphome/components/ethernet/__init__.py +326 -0
  851. esphome/components/ethernet/esp_eth_phy_jl1101.c +355 -0
  852. esphome/components/ethernet/ethernet_component.cpp +676 -0
  853. esphome/components/ethernet/ethernet_component.h +153 -0
  854. esphome/components/ethernet_info/__init__.py +1 -0
  855. esphome/components/ethernet_info/ethernet_info_text_sensor.cpp +18 -0
  856. esphome/components/ethernet_info/ethernet_info_text_sensor.h +72 -0
  857. esphome/components/ethernet_info/text_sensor.py +64 -0
  858. esphome/components/event/__init__.py +142 -0
  859. esphome/components/event/automation.h +25 -0
  860. esphome/components/event/event.cpp +24 -0
  861. esphome/components/event/event.h +37 -0
  862. esphome/components/exposure_notifications/__init__.py +39 -0
  863. esphome/components/exposure_notifications/exposure_notifications.cpp +49 -0
  864. esphome/components/exposure_notifications/exposure_notifications.h +29 -0
  865. esphome/components/external_components/__init__.py +116 -0
  866. esphome/components/ezo/__init__.py +0 -0
  867. esphome/components/ezo/automation.h +53 -0
  868. esphome/components/ezo/ezo.cpp +235 -0
  869. esphome/components/ezo/ezo.h +111 -0
  870. esphome/components/ezo/sensor.py +114 -0
  871. esphome/components/ezo_pmp/__init__.py +296 -0
  872. esphome/components/ezo_pmp/binary_sensor.py +42 -0
  873. esphome/components/ezo_pmp/ezo_pmp.cpp +543 -0
  874. esphome/components/ezo_pmp/ezo_pmp.h +252 -0
  875. esphome/components/ezo_pmp/sensor.py +104 -0
  876. esphome/components/ezo_pmp/text_sensor.py +39 -0
  877. esphome/components/factory_reset/__init__.py +5 -0
  878. esphome/components/factory_reset/button/__init__.py +27 -0
  879. esphome/components/factory_reset/button/factory_reset_button.cpp +21 -0
  880. esphome/components/factory_reset/button/factory_reset_button.h +18 -0
  881. esphome/components/factory_reset/switch/__init__.py +35 -0
  882. esphome/components/factory_reset/switch/factory_reset_switch.cpp +26 -0
  883. esphome/components/factory_reset/switch/factory_reset_switch.h +18 -0
  884. esphome/components/fan/__init__.py +353 -0
  885. esphome/components/fan/automation.h +230 -0
  886. esphome/components/fan/fan.cpp +209 -0
  887. esphome/components/fan/fan.h +151 -0
  888. esphome/components/fan/fan_state.cpp +16 -0
  889. esphome/components/fan/fan_state.h +34 -0
  890. esphome/components/fan/fan_traits.h +47 -0
  891. esphome/components/fastled_base/__init__.py +48 -0
  892. esphome/components/fastled_base/fastled_light.cpp +43 -0
  893. esphome/components/fastled_base/fastled_light.h +243 -0
  894. esphome/components/fastled_clockless/__init__.py +0 -0
  895. esphome/components/fastled_clockless/light.py +70 -0
  896. esphome/components/fastled_spi/__init__.py +0 -0
  897. esphome/components/fastled_spi/light.py +67 -0
  898. esphome/components/feedback/__init__.py +1 -0
  899. esphome/components/feedback/cover.py +157 -0
  900. esphome/components/feedback/feedback_cover.cpp +446 -0
  901. esphome/components/feedback/feedback_cover.h +90 -0
  902. esphome/components/fingerprint_grow/__init__.py +373 -0
  903. esphome/components/fingerprint_grow/binary_sensor.py +20 -0
  904. esphome/components/fingerprint_grow/fingerprint_grow.cpp +576 -0
  905. esphome/components/fingerprint_grow/fingerprint_grow.h +335 -0
  906. esphome/components/fingerprint_grow/sensor.py +73 -0
  907. esphome/components/font/__init__.py +617 -0
  908. esphome/components/font/font.cpp +172 -0
  909. esphome/components/font/font.h +79 -0
  910. esphome/components/fs3000/__init__.py +0 -0
  911. esphome/components/fs3000/fs3000.cpp +107 -0
  912. esphome/components/fs3000/fs3000.h +35 -0
  913. esphome/components/fs3000/sensor.py +50 -0
  914. esphome/components/ft5x06/__init__.py +6 -0
  915. esphome/components/ft5x06/touchscreen/__init__.py +32 -0
  916. esphome/components/ft5x06/touchscreen/ft5x06_touchscreen.cpp +102 -0
  917. esphome/components/ft5x06/touchscreen/ft5x06_touchscreen.h +56 -0
  918. esphome/components/ft63x6/__init__.py +1 -0
  919. esphome/components/ft63x6/ft63x6.cpp +134 -0
  920. esphome/components/ft63x6/ft63x6.h +51 -0
  921. esphome/components/ft63x6/touchscreen.py +45 -0
  922. esphome/components/fujitsu_general/__init__.py +0 -0
  923. esphome/components/fujitsu_general/climate.py +22 -0
  924. esphome/components/fujitsu_general/fujitsu_general.cpp +404 -0
  925. esphome/components/fujitsu_general/fujitsu_general.h +82 -0
  926. esphome/components/gcja5/__init__.py +1 -0
  927. esphome/components/gcja5/gcja5.cpp +119 -0
  928. esphome/components/gcja5/gcja5.h +52 -0
  929. esphome/components/gcja5/sensor.py +118 -0
  930. esphome/components/gdk101/__init__.py +32 -0
  931. esphome/components/gdk101/binary_sensor.py +29 -0
  932. esphome/components/gdk101/gdk101.cpp +189 -0
  933. esphome/components/gdk101/gdk101.h +52 -0
  934. esphome/components/gdk101/sensor.py +83 -0
  935. esphome/components/globals/__init__.py +89 -0
  936. esphome/components/globals/globals_component.h +145 -0
  937. esphome/components/gp2y1010au0f/__init__.py +0 -0
  938. esphome/components/gp2y1010au0f/gp2y1010au0f.cpp +67 -0
  939. esphome/components/gp2y1010au0f/gp2y1010au0f.h +52 -0
  940. esphome/components/gp2y1010au0f/sensor.py +61 -0
  941. esphome/components/gp8403/__init__.py +40 -0
  942. esphome/components/gp8403/gp8403.cpp +21 -0
  943. esphome/components/gp8403/gp8403.h +27 -0
  944. esphome/components/gp8403/output/__init__.py +31 -0
  945. esphome/components/gp8403/output/gp8403_output.cpp +26 -0
  946. esphome/components/gp8403/output/gp8403_output.h +25 -0
  947. esphome/components/gpio/__init__.py +4 -0
  948. esphome/components/gpio/binary_sensor/__init__.py +28 -0
  949. esphome/components/gpio/binary_sensor/gpio_binary_sensor.cpp +24 -0
  950. esphome/components/gpio/binary_sensor/gpio_binary_sensor.h +28 -0
  951. esphome/components/gpio/one_wire/__init__.py +25 -0
  952. esphome/components/gpio/one_wire/gpio_one_wire.cpp +205 -0
  953. esphome/components/gpio/one_wire/gpio_one_wire.h +41 -0
  954. esphome/components/gpio/output/__init__.py +24 -0
  955. esphome/components/gpio/output/gpio_binary_output.cpp +16 -0
  956. esphome/components/gpio/output/gpio_binary_output.h +29 -0
  957. esphome/components/gpio/switch/__init__.py +39 -0
  958. esphome/components/gpio/switch/gpio_switch.cpp +75 -0
  959. esphome/components/gpio/switch/gpio_switch.h +34 -0
  960. esphome/components/gpio_expander/__init__.py +0 -0
  961. esphome/components/gpio_expander/cached_gpio.h +38 -0
  962. esphome/components/gps/__init__.py +97 -0
  963. esphome/components/gps/gps.cpp +75 -0
  964. esphome/components/gps/gps.h +71 -0
  965. esphome/components/gps/time/__init__.py +27 -0
  966. esphome/components/gps/time/gps_time.cpp +38 -0
  967. esphome/components/gps/time/gps_time.h +28 -0
  968. esphome/components/graph/__init__.py +220 -0
  969. esphome/components/graph/graph.cpp +398 -0
  970. esphome/components/graph/graph.h +183 -0
  971. esphome/components/graphical_display_menu/__init__.py +100 -0
  972. esphome/components/graphical_display_menu/graphical_display_menu.cpp +245 -0
  973. esphome/components/graphical_display_menu/graphical_display_menu.h +84 -0
  974. esphome/components/gree/__init__.py +0 -0
  975. esphome/components/gree/climate.py +35 -0
  976. esphome/components/gree/gree.cpp +216 -0
  977. esphome/components/gree/gree.h +109 -0
  978. esphome/components/grove_gas_mc_v2/__init__.py +0 -0
  979. esphome/components/grove_gas_mc_v2/grove_gas_mc_v2.cpp +88 -0
  980. esphome/components/grove_gas_mc_v2/grove_gas_mc_v2.h +39 -0
  981. esphome/components/grove_gas_mc_v2/sensor.py +77 -0
  982. esphome/components/grove_tb6612fng/__init__.py +177 -0
  983. esphome/components/grove_tb6612fng/grove_tb6612fng.cpp +171 -0
  984. esphome/components/grove_tb6612fng/grove_tb6612fng.h +215 -0
  985. esphome/components/growatt_solar/__init__.py +0 -0
  986. esphome/components/growatt_solar/growatt_solar.cpp +141 -0
  987. esphome/components/growatt_solar/growatt_solar.h +87 -0
  988. esphome/components/growatt_solar/sensor.py +212 -0
  989. esphome/components/gt911/__init__.py +6 -0
  990. esphome/components/gt911/binary_sensor/__init__.py +31 -0
  991. esphome/components/gt911/binary_sensor/gt911_button.cpp +27 -0
  992. esphome/components/gt911/binary_sensor/gt911_button.h +28 -0
  993. esphome/components/gt911/touchscreen/__init__.py +33 -0
  994. esphome/components/gt911/touchscreen/gt911_touchscreen.cpp +133 -0
  995. esphome/components/gt911/touchscreen/gt911_touchscreen.h +35 -0
  996. esphome/components/haier/__init__.py +0 -0
  997. esphome/components/haier/automation.h +130 -0
  998. esphome/components/haier/binary_sensor/__init__.py +71 -0
  999. esphome/components/haier/button/__init__.py +41 -0
  1000. esphome/components/haier/button/self_cleaning.cpp +9 -0
  1001. esphome/components/haier/button/self_cleaning.h +18 -0
  1002. esphome/components/haier/button/steri_cleaning.cpp +9 -0
  1003. esphome/components/haier/button/steri_cleaning.h +18 -0
  1004. esphome/components/haier/climate.py +522 -0
  1005. esphome/components/haier/haier_base.cpp +427 -0
  1006. esphome/components/haier/haier_base.h +187 -0
  1007. esphome/components/haier/hon_climate.cpp +1376 -0
  1008. esphome/components/haier/hon_climate.h +214 -0
  1009. esphome/components/haier/hon_packet.h +260 -0
  1010. esphome/components/haier/logger_handler.cpp +33 -0
  1011. esphome/components/haier/logger_handler.h +14 -0
  1012. esphome/components/haier/sensor/__init__.py +152 -0
  1013. esphome/components/haier/smartair2_climate.cpp +553 -0
  1014. esphome/components/haier/smartair2_climate.h +40 -0
  1015. esphome/components/haier/smartair2_packet.h +88 -0
  1016. esphome/components/haier/switch/__init__.py +91 -0
  1017. esphome/components/haier/switch/beeper.cpp +14 -0
  1018. esphome/components/haier/switch/beeper.h +18 -0
  1019. esphome/components/haier/switch/display.cpp +14 -0
  1020. esphome/components/haier/switch/display.h +18 -0
  1021. esphome/components/haier/switch/health_mode.cpp +14 -0
  1022. esphome/components/haier/switch/health_mode.h +18 -0
  1023. esphome/components/haier/switch/quiet_mode.cpp +14 -0
  1024. esphome/components/haier/switch/quiet_mode.h +18 -0
  1025. esphome/components/haier/text_sensor/__init__.py +54 -0
  1026. esphome/components/havells_solar/__init__.py +0 -0
  1027. esphome/components/havells_solar/havells_solar.cpp +165 -0
  1028. esphome/components/havells_solar/havells_solar.h +117 -0
  1029. esphome/components/havells_solar/havells_solar_registers.h +49 -0
  1030. esphome/components/havells_solar/sensor.py +291 -0
  1031. esphome/components/hbridge/__init__.py +3 -0
  1032. esphome/components/hbridge/fan/__init__.py +76 -0
  1033. esphome/components/hbridge/fan/hbridge_fan.cpp +94 -0
  1034. esphome/components/hbridge/fan/hbridge_fan.h +60 -0
  1035. esphome/components/hbridge/light/__init__.py +30 -0
  1036. esphome/components/hbridge/light/hbridge_light_output.h +58 -0
  1037. esphome/components/hbridge/switch/__init__.py +44 -0
  1038. esphome/components/hbridge/switch/hbridge_switch.cpp +95 -0
  1039. esphome/components/hbridge/switch/hbridge_switch.h +50 -0
  1040. esphome/components/hdc1080/__init__.py +0 -0
  1041. esphome/components/hdc1080/hdc1080.cpp +75 -0
  1042. esphome/components/hdc1080/hdc1080.h +29 -0
  1043. esphome/components/hdc1080/sensor.py +56 -0
  1044. esphome/components/he60r/__init__.py +1 -0
  1045. esphome/components/he60r/cover.py +47 -0
  1046. esphome/components/he60r/he60r.cpp +263 -0
  1047. esphome/components/he60r/he60r.h +46 -0
  1048. esphome/components/heatpumpir/__init__.py +0 -0
  1049. esphome/components/heatpumpir/climate.py +132 -0
  1050. esphome/components/heatpumpir/heatpumpir.cpp +210 -0
  1051. esphome/components/heatpumpir/heatpumpir.h +131 -0
  1052. esphome/components/heatpumpir/ir_sender_esphome.cpp +32 -0
  1053. esphome/components/heatpumpir/ir_sender_esphome.h +25 -0
  1054. esphome/components/hitachi_ac344/__init__.py +0 -0
  1055. esphome/components/hitachi_ac344/climate.py +20 -0
  1056. esphome/components/hitachi_ac344/hitachi_ac344.cpp +370 -0
  1057. esphome/components/hitachi_ac344/hitachi_ac344.h +121 -0
  1058. esphome/components/hitachi_ac424/__init__.py +1 -0
  1059. esphome/components/hitachi_ac424/climate.py +20 -0
  1060. esphome/components/hitachi_ac424/hitachi_ac424.cpp +371 -0
  1061. esphome/components/hitachi_ac424/hitachi_ac424.h +123 -0
  1062. esphome/components/hlw8012/__init__.py +0 -0
  1063. esphome/components/hlw8012/hlw8012.cpp +108 -0
  1064. esphome/components/hlw8012/hlw8012.h +77 -0
  1065. esphome/components/hlw8012/sensor.py +124 -0
  1066. esphome/components/hm3301/__init__.py +0 -0
  1067. esphome/components/hm3301/abstract_aqi_calculator.h +14 -0
  1068. esphome/components/hm3301/aqi_calculator.h +51 -0
  1069. esphome/components/hm3301/aqi_calculator_factory.h +29 -0
  1070. esphome/components/hm3301/caqi_calculator.h +52 -0
  1071. esphome/components/hm3301/hm3301.cpp +101 -0
  1072. esphome/components/hm3301/hm3301.h +52 -0
  1073. esphome/components/hm3301/sensor.py +111 -0
  1074. esphome/components/hmac_md5/__init__.py +2 -0
  1075. esphome/components/hmac_md5/hmac_md5.cpp +58 -0
  1076. esphome/components/hmac_md5/hmac_md5.h +49 -0
  1077. esphome/components/hmc5883l/__init__.py +0 -0
  1078. esphome/components/hmc5883l/hmc5883l.cpp +146 -0
  1079. esphome/components/hmc5883l/hmc5883l.h +70 -0
  1080. esphome/components/hmc5883l/sensor.py +142 -0
  1081. esphome/components/homeassistant/__init__.py +40 -0
  1082. esphome/components/homeassistant/binary_sensor/__init__.py +24 -0
  1083. esphome/components/homeassistant/binary_sensor/homeassistant_binary_sensor.cpp +48 -0
  1084. esphome/components/homeassistant/binary_sensor/homeassistant_binary_sensor.h +24 -0
  1085. esphome/components/homeassistant/number/__init__.py +33 -0
  1086. esphome/components/homeassistant/number/homeassistant_number.cpp +103 -0
  1087. esphome/components/homeassistant/number/homeassistant_number.h +31 -0
  1088. esphome/components/homeassistant/sensor/__init__.py +24 -0
  1089. esphome/components/homeassistant/sensor/homeassistant_sensor.cpp +39 -0
  1090. esphome/components/homeassistant/sensor/homeassistant_sensor.h +23 -0
  1091. esphome/components/homeassistant/switch/__init__.py +43 -0
  1092. esphome/components/homeassistant/switch/homeassistant_switch.cpp +59 -0
  1093. esphome/components/homeassistant/switch/homeassistant_switch.h +22 -0
  1094. esphome/components/homeassistant/text_sensor/__init__.py +24 -0
  1095. esphome/components/homeassistant/text_sensor/homeassistant_text_sensor.cpp +31 -0
  1096. esphome/components/homeassistant/text_sensor/homeassistant_text_sensor.h +23 -0
  1097. esphome/components/homeassistant/time/__init__.py +22 -0
  1098. esphome/components/homeassistant/time/homeassistant_time.cpp +22 -0
  1099. esphome/components/homeassistant/time/homeassistant_time.h +22 -0
  1100. esphome/components/honeywell_hih_i2c/__init__.py +3 -0
  1101. esphome/components/honeywell_hih_i2c/honeywell_hih.cpp +97 -0
  1102. esphome/components/honeywell_hih_i2c/honeywell_hih.h +34 -0
  1103. esphome/components/honeywell_hih_i2c/sensor.py +56 -0
  1104. esphome/components/honeywellabp/__init__.py +1 -0
  1105. esphome/components/honeywellabp/honeywellabp.cpp +102 -0
  1106. esphome/components/honeywellabp/honeywellabp.h +45 -0
  1107. esphome/components/honeywellabp/sensor.py +69 -0
  1108. esphome/components/honeywellabp2_i2c/__init__.py +3 -0
  1109. esphome/components/honeywellabp2_i2c/honeywellabp2.cpp +109 -0
  1110. esphome/components/honeywellabp2_i2c/honeywellabp2.h +60 -0
  1111. esphome/components/honeywellabp2_i2c/sensor.py +75 -0
  1112. esphome/components/host/__init__.py +45 -0
  1113. esphome/components/host/const.py +5 -0
  1114. esphome/components/host/core.cpp +77 -0
  1115. esphome/components/host/gpio.cpp +59 -0
  1116. esphome/components/host/gpio.h +37 -0
  1117. esphome/components/host/gpio.py +62 -0
  1118. esphome/components/host/preferences.cpp +87 -0
  1119. esphome/components/host/preferences.h +66 -0
  1120. esphome/components/host/time/__init__.py +20 -0
  1121. esphome/components/host/time/host_time.h +15 -0
  1122. esphome/components/hrxl_maxsonar_wr/__init__.py +0 -0
  1123. esphome/components/hrxl_maxsonar_wr/hrxl_maxsonar_wr.cpp +77 -0
  1124. esphome/components/hrxl_maxsonar_wr/hrxl_maxsonar_wr.h +25 -0
  1125. esphome/components/hrxl_maxsonar_wr/sensor.py +29 -0
  1126. esphome/components/hte501/__init__.py +0 -0
  1127. esphome/components/hte501/hte501.cpp +90 -0
  1128. esphome/components/hte501/hte501.h +30 -0
  1129. esphome/components/hte501/sensor.py +58 -0
  1130. esphome/components/http_request/__init__.py +288 -0
  1131. esphome/components/http_request/http_request.cpp +24 -0
  1132. esphome/components/http_request/http_request.h +251 -0
  1133. esphome/components/http_request/http_request_arduino.cpp +167 -0
  1134. esphome/components/http_request/http_request_arduino.h +40 -0
  1135. esphome/components/http_request/http_request_idf.cpp +217 -0
  1136. esphome/components/http_request/http_request_idf.h +47 -0
  1137. esphome/components/http_request/ota/__init__.py +100 -0
  1138. esphome/components/http_request/ota/automation.h +42 -0
  1139. esphome/components/http_request/ota/ota_http_request.cpp +269 -0
  1140. esphome/components/http_request/ota/ota_http_request.h +61 -0
  1141. esphome/components/http_request/update/__init__.py +44 -0
  1142. esphome/components/http_request/update/http_request_update.cpp +181 -0
  1143. esphome/components/http_request/update/http_request_update.h +44 -0
  1144. esphome/components/htu21d/__init__.py +0 -0
  1145. esphome/components/htu21d/htu21d.cpp +156 -0
  1146. esphome/components/htu21d/htu21d.h +63 -0
  1147. esphome/components/htu21d/sensor.py +121 -0
  1148. esphome/components/htu31d/__init__.py +1 -0
  1149. esphome/components/htu31d/htu31d.cpp +271 -0
  1150. esphome/components/htu31d/htu31d.h +33 -0
  1151. esphome/components/htu31d/sensor.py +56 -0
  1152. esphome/components/hx711/__init__.py +0 -0
  1153. esphome/components/hx711/hx711.cpp +83 -0
  1154. esphome/components/hx711/hx711.h +38 -0
  1155. esphome/components/hx711/sensor.py +50 -0
  1156. esphome/components/hydreon_rgxx/__init__.py +12 -0
  1157. esphome/components/hydreon_rgxx/binary_sensor.py +53 -0
  1158. esphome/components/hydreon_rgxx/hydreon_rgxx.cpp +295 -0
  1159. esphome/components/hydreon_rgxx/hydreon_rgxx.h +98 -0
  1160. esphome/components/hydreon_rgxx/sensor.py +157 -0
  1161. esphome/components/hyt271/__init__.py +1 -0
  1162. esphome/components/hyt271/hyt271.cpp +52 -0
  1163. esphome/components/hyt271/hyt271.h +27 -0
  1164. esphome/components/hyt271/sensor.py +56 -0
  1165. esphome/components/i2c/__init__.py +179 -0
  1166. esphome/components/i2c/i2c.cpp +103 -0
  1167. esphome/components/i2c/i2c.h +274 -0
  1168. esphome/components/i2c/i2c_bus.h +112 -0
  1169. esphome/components/i2c/i2c_bus_arduino.cpp +326 -0
  1170. esphome/components/i2c/i2c_bus_arduino.h +49 -0
  1171. esphome/components/i2c/i2c_bus_esp_idf.cpp +364 -0
  1172. esphome/components/i2c/i2c_bus_esp_idf.h +52 -0
  1173. esphome/components/i2c_device/__init__.py +26 -0
  1174. esphome/components/i2c_device/i2c_device.cpp +17 -0
  1175. esphome/components/i2c_device/i2c_device.h +18 -0
  1176. esphome/components/i2s_audio/__init__.py +162 -0
  1177. esphome/components/i2s_audio/i2s_audio.cpp +34 -0
  1178. esphome/components/i2s_audio/i2s_audio.h +75 -0
  1179. esphome/components/i2s_audio/media_player/__init__.py +112 -0
  1180. esphome/components/i2s_audio/media_player/i2s_audio_media_player.cpp +258 -0
  1181. esphome/components/i2s_audio/media_player/i2s_audio_media_player.h +87 -0
  1182. esphome/components/i2s_audio/microphone/__init__.py +90 -0
  1183. esphome/components/i2s_audio/microphone/i2s_audio_microphone.cpp +220 -0
  1184. esphome/components/i2s_audio/microphone/i2s_audio_microphone.h +51 -0
  1185. esphome/components/i2s_audio/speaker/__init__.py +126 -0
  1186. esphome/components/i2s_audio/speaker/i2s_audio_speaker.cpp +524 -0
  1187. esphome/components/i2s_audio/speaker/i2s_audio_speaker.h +136 -0
  1188. esphome/components/iaqcore/__init__.py +0 -0
  1189. esphome/components/iaqcore/iaqcore.cpp +99 -0
  1190. esphome/components/iaqcore/iaqcore.h +29 -0
  1191. esphome/components/iaqcore/sensor.py +57 -0
  1192. esphome/components/ili9341/__init__.py +0 -0
  1193. esphome/components/ili9341/display.py +5 -0
  1194. esphome/components/ili9xxx/__init__.py +0 -0
  1195. esphome/components/ili9xxx/display.py +293 -0
  1196. esphome/components/ili9xxx/ili9xxx_defines.h +100 -0
  1197. esphome/components/ili9xxx/ili9xxx_display.cpp +463 -0
  1198. esphome/components/ili9xxx/ili9xxx_display.h +281 -0
  1199. esphome/components/ili9xxx/ili9xxx_init.h +423 -0
  1200. esphome/components/image/__init__.py +407 -0
  1201. esphome/components/image/image.cpp +178 -0
  1202. esphome/components/image/image.h +74 -0
  1203. esphome/components/improv_base/__init__.py +41 -0
  1204. esphome/components/improv_base/improv_base.cpp +37 -0
  1205. esphome/components/improv_base/improv_base.h +18 -0
  1206. esphome/components/improv_serial/__init__.py +47 -0
  1207. esphome/components/improv_serial/improv_serial_component.cpp +316 -0
  1208. esphome/components/improv_serial/improv_serial_component.h +81 -0
  1209. esphome/components/ina219/__init__.py +0 -0
  1210. esphome/components/ina219/ina219.cpp +196 -0
  1211. esphome/components/ina219/ina219.h +39 -0
  1212. esphome/components/ina219/sensor.py +96 -0
  1213. esphome/components/ina226/__init__.py +1 -0
  1214. esphome/components/ina226/ina226.cpp +166 -0
  1215. esphome/components/ina226/ina226.h +78 -0
  1216. esphome/components/ina226/sensor.py +147 -0
  1217. esphome/components/ina260/__init__.py +0 -0
  1218. esphome/components/ina260/ina260.cpp +128 -0
  1219. esphome/components/ina260/ina260.h +39 -0
  1220. esphome/components/ina260/sensor.py +71 -0
  1221. esphome/components/ina2xx_base/__init__.py +255 -0
  1222. esphome/components/ina2xx_base/ina2xx_base.cpp +604 -0
  1223. esphome/components/ina2xx_base/ina2xx_base.h +253 -0
  1224. esphome/components/ina2xx_i2c/__init__.py +0 -0
  1225. esphome/components/ina2xx_i2c/ina2xx_i2c.cpp +39 -0
  1226. esphome/components/ina2xx_i2c/ina2xx_i2c.h +21 -0
  1227. esphome/components/ina2xx_i2c/sensor.py +34 -0
  1228. esphome/components/ina2xx_spi/__init__.py +0 -0
  1229. esphome/components/ina2xx_spi/ina2xx_spi.cpp +38 -0
  1230. esphome/components/ina2xx_spi/ina2xx_spi.h +22 -0
  1231. esphome/components/ina2xx_spi/sensor.py +33 -0
  1232. esphome/components/ina3221/__init__.py +0 -0
  1233. esphome/components/ina3221/ina3221.cpp +134 -0
  1234. esphome/components/ina3221/ina3221.h +40 -0
  1235. esphome/components/ina3221/sensor.py +99 -0
  1236. esphome/components/inkbird_ibsth1_mini/__init__.py +0 -0
  1237. esphome/components/inkbird_ibsth1_mini/inkbird_ibsth1_mini.cpp +110 -0
  1238. esphome/components/inkbird_ibsth1_mini/inkbird_ibsth1_mini.h +36 -0
  1239. esphome/components/inkbird_ibsth1_mini/sensor.py +83 -0
  1240. esphome/components/inkplate6/__init__.py +1 -0
  1241. esphome/components/inkplate6/display.py +189 -0
  1242. esphome/components/inkplate6/inkplate.cpp +719 -0
  1243. esphome/components/inkplate6/inkplate.h +253 -0
  1244. esphome/components/integration/__init__.py +1 -0
  1245. esphome/components/integration/integration_sensor.cpp +51 -0
  1246. esphome/components/integration/integration_sensor.h +86 -0
  1247. esphome/components/integration/sensor.py +115 -0
  1248. esphome/components/internal_temperature/__init__.py +1 -0
  1249. esphome/components/internal_temperature/internal_temperature.cpp +128 -0
  1250. esphome/components/internal_temperature/internal_temperature.h +18 -0
  1251. esphome/components/internal_temperature/sensor.py +62 -0
  1252. esphome/components/interval/__init__.py +32 -0
  1253. esphome/components/interval/interval.h +34 -0
  1254. esphome/components/jsn_sr04t/__init__.py +1 -0
  1255. esphome/components/jsn_sr04t/jsn_sr04t.cpp +73 -0
  1256. esphome/components/jsn_sr04t/jsn_sr04t.h +34 -0
  1257. esphome/components/jsn_sr04t/sensor.py +57 -0
  1258. esphome/components/json/__init__.py +17 -0
  1259. esphome/components/json/json_util.cpp +111 -0
  1260. esphome/components/json/json_util.h +29 -0
  1261. esphome/components/kalman_combinator/__init__.py +0 -0
  1262. esphome/components/kalman_combinator/sensor.py +6 -0
  1263. esphome/components/kamstrup_kmp/__init__.py +0 -0
  1264. esphome/components/kamstrup_kmp/kamstrup_kmp.cpp +301 -0
  1265. esphome/components/kamstrup_kmp/kamstrup_kmp.h +131 -0
  1266. esphome/components/kamstrup_kmp/sensor.py +132 -0
  1267. esphome/components/key_collector/__init__.py +96 -0
  1268. esphome/components/key_collector/key_collector.cpp +97 -0
  1269. esphome/components/key_collector/key_collector.h +53 -0
  1270. esphome/components/key_provider/__init__.py +6 -0
  1271. esphome/components/key_provider/key_provider.cpp +13 -0
  1272. esphome/components/key_provider/key_provider.h +21 -0
  1273. esphome/components/kmeteriso/__init__.py +0 -0
  1274. esphome/components/kmeteriso/kmeteriso.cpp +82 -0
  1275. esphome/components/kmeteriso/kmeteriso.h +34 -0
  1276. esphome/components/kmeteriso/sensor.py +55 -0
  1277. esphome/components/kuntze/__init__.py +0 -0
  1278. esphome/components/kuntze/kuntze.cpp +91 -0
  1279. esphome/components/kuntze/kuntze.h +42 -0
  1280. esphome/components/kuntze/sensor.py +123 -0
  1281. esphome/components/lcd_base/__init__.py +59 -0
  1282. esphome/components/lcd_base/lcd_display.cpp +177 -0
  1283. esphome/components/lcd_base/lcd_display.h +66 -0
  1284. esphome/components/lcd_gpio/__init__.py +0 -0
  1285. esphome/components/lcd_gpio/display.py +64 -0
  1286. esphome/components/lcd_gpio/gpio_lcd_display.cpp +66 -0
  1287. esphome/components/lcd_gpio/gpio_lcd_display.h +50 -0
  1288. esphome/components/lcd_menu/__init__.py +73 -0
  1289. esphome/components/lcd_menu/lcd_menu.cpp +74 -0
  1290. esphome/components/lcd_menu/lcd_menu.h +45 -0
  1291. esphome/components/lcd_pcf8574/__init__.py +0 -0
  1292. esphome/components/lcd_pcf8574/display.py +32 -0
  1293. esphome/components/lcd_pcf8574/pcf8574_display.cpp +59 -0
  1294. esphome/components/lcd_pcf8574/pcf8574_display.h +31 -0
  1295. esphome/components/ld2410/__init__.py +109 -0
  1296. esphome/components/ld2410/automation.h +22 -0
  1297. esphome/components/ld2410/binary_sensor.py +55 -0
  1298. esphome/components/ld2410/button/__init__.py +57 -0
  1299. esphome/components/ld2410/button/query_button.cpp +9 -0
  1300. esphome/components/ld2410/button/query_button.h +18 -0
  1301. esphome/components/ld2410/button/reset_button.cpp +9 -0
  1302. esphome/components/ld2410/button/reset_button.h +18 -0
  1303. esphome/components/ld2410/button/restart_button.cpp +9 -0
  1304. esphome/components/ld2410/button/restart_button.h +18 -0
  1305. esphome/components/ld2410/ld2410.cpp +680 -0
  1306. esphome/components/ld2410/ld2410.h +237 -0
  1307. esphome/components/ld2410/number/__init__.py +128 -0
  1308. esphome/components/ld2410/number/gate_threshold_number.cpp +14 -0
  1309. esphome/components/ld2410/number/gate_threshold_number.h +19 -0
  1310. esphome/components/ld2410/number/light_threshold_number.cpp +12 -0
  1311. esphome/components/ld2410/number/light_threshold_number.h +18 -0
  1312. esphome/components/ld2410/number/max_distance_timeout_number.cpp +12 -0
  1313. esphome/components/ld2410/number/max_distance_timeout_number.h +18 -0
  1314. esphome/components/ld2410/select/__init__.py +81 -0
  1315. esphome/components/ld2410/select/baud_rate_select.cpp +12 -0
  1316. esphome/components/ld2410/select/baud_rate_select.h +18 -0
  1317. esphome/components/ld2410/select/distance_resolution_select.cpp +12 -0
  1318. esphome/components/ld2410/select/distance_resolution_select.h +18 -0
  1319. esphome/components/ld2410/select/light_out_control_select.cpp +12 -0
  1320. esphome/components/ld2410/select/light_out_control_select.h +18 -0
  1321. esphome/components/ld2410/sensor.py +108 -0
  1322. esphome/components/ld2410/switch/__init__.py +44 -0
  1323. esphome/components/ld2410/switch/bluetooth_switch.cpp +12 -0
  1324. esphome/components/ld2410/switch/bluetooth_switch.h +18 -0
  1325. esphome/components/ld2410/switch/engineering_mode_switch.cpp +12 -0
  1326. esphome/components/ld2410/switch/engineering_mode_switch.h +18 -0
  1327. esphome/components/ld2410/text_sensor.py +33 -0
  1328. esphome/components/ld2420/__init__.py +39 -0
  1329. esphome/components/ld2420/binary_sensor/__init__.py +32 -0
  1330. esphome/components/ld2420/binary_sensor/ld2420_binary_sensor.cpp +16 -0
  1331. esphome/components/ld2420/binary_sensor/ld2420_binary_sensor.h +25 -0
  1332. esphome/components/ld2420/button/__init__.py +69 -0
  1333. esphome/components/ld2420/button/reconfig_buttons.cpp +16 -0
  1334. esphome/components/ld2420/button/reconfig_buttons.h +42 -0
  1335. esphome/components/ld2420/ld2420.cpp +778 -0
  1336. esphome/components/ld2420/ld2420.h +271 -0
  1337. esphome/components/ld2420/number/__init__.py +183 -0
  1338. esphome/components/ld2420/number/gate_config_number.cpp +73 -0
  1339. esphome/components/ld2420/number/gate_config_number.h +78 -0
  1340. esphome/components/ld2420/select/__init__.py +33 -0
  1341. esphome/components/ld2420/select/operating_mode_select.cpp +16 -0
  1342. esphome/components/ld2420/select/operating_mode_select.h +18 -0
  1343. esphome/components/ld2420/sensor/__init__.py +35 -0
  1344. esphome/components/ld2420/sensor/ld2420_sensor.cpp +16 -0
  1345. esphome/components/ld2420/sensor/ld2420_sensor.h +34 -0
  1346. esphome/components/ld2420/text_sensor/__init__.py +38 -0
  1347. esphome/components/ld2420/text_sensor/text_sensor.cpp +16 -0
  1348. esphome/components/ld2420/text_sensor/text_sensor.h +24 -0
  1349. esphome/components/ledc/__init__.py +1 -0
  1350. esphome/components/ledc/ledc_output.cpp +268 -0
  1351. esphome/components/ledc/ledc_output.h +62 -0
  1352. esphome/components/ledc/output.py +84 -0
  1353. esphome/components/libretiny/__init__.py +340 -0
  1354. esphome/components/libretiny/const.py +90 -0
  1355. esphome/components/libretiny/core.cpp +40 -0
  1356. esphome/components/libretiny/core.h +11 -0
  1357. esphome/components/libretiny/generate_components.py +329 -0
  1358. esphome/components/libretiny/gpio.py +204 -0
  1359. esphome/components/libretiny/gpio_arduino.cpp +105 -0
  1360. esphome/components/libretiny/gpio_arduino.h +36 -0
  1361. esphome/components/libretiny/lt_component.cpp +29 -0
  1362. esphome/components/libretiny/lt_component.h +36 -0
  1363. esphome/components/libretiny/preferences.cpp +182 -0
  1364. esphome/components/libretiny/preferences.h +13 -0
  1365. esphome/components/libretiny/text_sensor.py +31 -0
  1366. esphome/components/libretiny_pwm/__init__.py +1 -0
  1367. esphome/components/libretiny_pwm/libretiny_pwm.cpp +53 -0
  1368. esphome/components/libretiny_pwm/libretiny_pwm.h +55 -0
  1369. esphome/components/libretiny_pwm/output.py +49 -0
  1370. esphome/components/light/__init__.py +229 -0
  1371. esphome/components/light/addressable_light.cpp +113 -0
  1372. esphome/components/light/addressable_light.h +123 -0
  1373. esphome/components/light/addressable_light_effect.h +369 -0
  1374. esphome/components/light/addressable_light_wrapper.h +127 -0
  1375. esphome/components/light/automation.cpp +15 -0
  1376. esphome/components/light/automation.h +220 -0
  1377. esphome/components/light/automation.py +281 -0
  1378. esphome/components/light/base_light_effects.h +231 -0
  1379. esphome/components/light/color_mode.h +108 -0
  1380. esphome/components/light/effects.py +552 -0
  1381. esphome/components/light/esp_color_correction.cpp +27 -0
  1382. esphome/components/light/esp_color_correction.h +77 -0
  1383. esphome/components/light/esp_color_view.h +110 -0
  1384. esphome/components/light/esp_hsv_color.cpp +74 -0
  1385. esphome/components/light/esp_hsv_color.h +36 -0
  1386. esphome/components/light/esp_range_view.cpp +96 -0
  1387. esphome/components/light/esp_range_view.h +80 -0
  1388. esphome/components/light/light_call.cpp +690 -0
  1389. esphome/components/light/light_call.h +197 -0
  1390. esphome/components/light/light_color_values.h +309 -0
  1391. esphome/components/light/light_effect.h +43 -0
  1392. esphome/components/light/light_json_schema.cpp +165 -0
  1393. esphome/components/light/light_json_schema.h +28 -0
  1394. esphome/components/light/light_output.cpp +12 -0
  1395. esphome/components/light/light_output.h +33 -0
  1396. esphome/components/light/light_state.cpp +296 -0
  1397. esphome/components/light/light_state.h +257 -0
  1398. esphome/components/light/light_traits.h +61 -0
  1399. esphome/components/light/light_transformer.h +59 -0
  1400. esphome/components/light/transformers.h +126 -0
  1401. esphome/components/light/types.py +87 -0
  1402. esphome/components/lightwaverf/LwRx.cpp +427 -0
  1403. esphome/components/lightwaverf/LwRx.h +142 -0
  1404. esphome/components/lightwaverf/LwTx.cpp +208 -0
  1405. esphome/components/lightwaverf/LwTx.h +94 -0
  1406. esphome/components/lightwaverf/__init__.py +83 -0
  1407. esphome/components/lightwaverf/lightwaverf.cpp +67 -0
  1408. esphome/components/lightwaverf/lightwaverf.h +70 -0
  1409. esphome/components/lilygo_t5_47/__init__.py +3 -0
  1410. esphome/components/lilygo_t5_47/touchscreen/__init__.py +39 -0
  1411. esphome/components/lilygo_t5_47/touchscreen/lilygo_t5_47_touchscreen.cpp +105 -0
  1412. esphome/components/lilygo_t5_47/touchscreen/lilygo_t5_47_touchscreen.h +31 -0
  1413. esphome/components/lock/__init__.py +110 -0
  1414. esphome/components/lock/automation.h +87 -0
  1415. esphome/components/lock/lock.cpp +107 -0
  1416. esphome/components/lock/lock.h +175 -0
  1417. esphome/components/logger/__init__.py +367 -0
  1418. esphome/components/logger/logger.cpp +201 -0
  1419. esphome/components/logger/logger.h +192 -0
  1420. esphome/components/logger/logger_esp32.cpp +214 -0
  1421. esphome/components/logger/logger_esp8266.cpp +45 -0
  1422. esphome/components/logger/logger_host.cpp +24 -0
  1423. esphome/components/logger/logger_libretiny.cpp +62 -0
  1424. esphome/components/logger/logger_rp2040.cpp +39 -0
  1425. esphome/components/ltr390/__init__.py +0 -0
  1426. esphome/components/ltr390/ltr390.cpp +204 -0
  1427. esphome/components/ltr390/ltr390.h +91 -0
  1428. esphome/components/ltr390/sensor.py +141 -0
  1429. esphome/components/ltr501/__init__.py +1 -0
  1430. esphome/components/ltr501/ltr501.cpp +542 -0
  1431. esphome/components/ltr501/ltr501.h +184 -0
  1432. esphome/components/ltr501/ltr_definitions_501.h +260 -0
  1433. esphome/components/ltr501/sensor.py +274 -0
  1434. esphome/components/ltr_als_ps/__init__.py +1 -0
  1435. esphome/components/ltr_als_ps/ltr_als_ps.cpp +519 -0
  1436. esphome/components/ltr_als_ps/ltr_als_ps.h +184 -0
  1437. esphome/components/ltr_als_ps/ltr_definitions.h +275 -0
  1438. esphome/components/ltr_als_ps/sensor.py +271 -0
  1439. esphome/components/lvgl/__init__.py +470 -0
  1440. esphome/components/lvgl/automation.py +319 -0
  1441. esphome/components/lvgl/binary_sensor/__init__.py +37 -0
  1442. esphome/components/lvgl/defines.py +549 -0
  1443. esphome/components/lvgl/encoders.py +80 -0
  1444. esphome/components/lvgl/font.cpp +76 -0
  1445. esphome/components/lvgl/gradient.py +61 -0
  1446. esphome/components/lvgl/hello_world.py +64 -0
  1447. esphome/components/lvgl/helpers.py +49 -0
  1448. esphome/components/lvgl/keypads.py +77 -0
  1449. esphome/components/lvgl/light/__init__.py +31 -0
  1450. esphome/components/lvgl/light/lvgl_light.h +48 -0
  1451. esphome/components/lvgl/lv_validation.py +485 -0
  1452. esphome/components/lvgl/lvcode.py +351 -0
  1453. esphome/components/lvgl/lvgl_esphome.cpp +546 -0
  1454. esphome/components/lvgl/lvgl_esphome.h +379 -0
  1455. esphome/components/lvgl/lvgl_hal.h +21 -0
  1456. esphome/components/lvgl/lvgl_proxy.h +17 -0
  1457. esphome/components/lvgl/number/__init__.py +63 -0
  1458. esphome/components/lvgl/number/lvgl_number.h +36 -0
  1459. esphome/components/lvgl/schemas.py +444 -0
  1460. esphome/components/lvgl/select/__init__.py +32 -0
  1461. esphome/components/lvgl/select/lvgl_select.h +58 -0
  1462. esphome/components/lvgl/sensor/__init__.py +42 -0
  1463. esphome/components/lvgl/styles.py +58 -0
  1464. esphome/components/lvgl/switch/__init__.py +53 -0
  1465. esphome/components/lvgl/switch/lvgl_switch.h +36 -0
  1466. esphome/components/lvgl/text/__init__.py +51 -0
  1467. esphome/components/lvgl/text/lvgl_text.h +36 -0
  1468. esphome/components/lvgl/text_sensor/__init__.py +43 -0
  1469. esphome/components/lvgl/touchscreens.py +44 -0
  1470. esphome/components/lvgl/trigger.py +73 -0
  1471. esphome/components/lvgl/types.py +198 -0
  1472. esphome/components/lvgl/widgets/__init__.py +460 -0
  1473. esphome/components/lvgl/widgets/animimg.py +112 -0
  1474. esphome/components/lvgl/widgets/arc.py +82 -0
  1475. esphome/components/lvgl/widgets/button.py +20 -0
  1476. esphome/components/lvgl/widgets/buttonmatrix.py +279 -0
  1477. esphome/components/lvgl/widgets/checkbox.py +32 -0
  1478. esphome/components/lvgl/widgets/dropdown.py +92 -0
  1479. esphome/components/lvgl/widgets/img.py +85 -0
  1480. esphome/components/lvgl/widgets/keyboard.py +49 -0
  1481. esphome/components/lvgl/widgets/label.py +42 -0
  1482. esphome/components/lvgl/widgets/led.py +29 -0
  1483. esphome/components/lvgl/widgets/line.py +61 -0
  1484. esphome/components/lvgl/widgets/lv_bar.py +55 -0
  1485. esphome/components/lvgl/widgets/meter.py +314 -0
  1486. esphome/components/lvgl/widgets/msgbox.py +148 -0
  1487. esphome/components/lvgl/widgets/obj.py +30 -0
  1488. esphome/components/lvgl/widgets/page.py +158 -0
  1489. esphome/components/lvgl/widgets/qrcode.py +54 -0
  1490. esphome/components/lvgl/widgets/roller.py +84 -0
  1491. esphome/components/lvgl/widgets/slider.py +63 -0
  1492. esphome/components/lvgl/widgets/spinbox.py +178 -0
  1493. esphome/components/lvgl/widgets/spinner.py +43 -0
  1494. esphome/components/lvgl/widgets/switch.py +20 -0
  1495. esphome/components/lvgl/widgets/tabview.py +114 -0
  1496. esphome/components/lvgl/widgets/textarea.py +66 -0
  1497. esphome/components/lvgl/widgets/tileview.py +123 -0
  1498. esphome/components/m5stack_8angle/__init__.py +33 -0
  1499. esphome/components/m5stack_8angle/binary_sensor/__init__.py +30 -0
  1500. esphome/components/m5stack_8angle/binary_sensor/m5stack_8angle_binary_sensor.cpp +17 -0
  1501. esphome/components/m5stack_8angle/binary_sensor/m5stack_8angle_binary_sensor.h +19 -0
  1502. esphome/components/m5stack_8angle/light/__init__.py +31 -0
  1503. esphome/components/m5stack_8angle/light/m5stack_8angle_light.cpp +45 -0
  1504. esphome/components/m5stack_8angle/light/m5stack_8angle_light.h +37 -0
  1505. esphome/components/m5stack_8angle/m5stack_8angle.cpp +74 -0
  1506. esphome/components/m5stack_8angle/m5stack_8angle.h +34 -0
  1507. esphome/components/m5stack_8angle/sensor/__init__.py +66 -0
  1508. esphome/components/m5stack_8angle/sensor/m5stack_8angle_sensor.cpp +24 -0
  1509. esphome/components/m5stack_8angle/sensor/m5stack_8angle_sensor.h +27 -0
  1510. esphome/components/matrix_keypad/__init__.py +87 -0
  1511. esphome/components/matrix_keypad/binary_sensor/__init__.py +49 -0
  1512. esphome/components/matrix_keypad/binary_sensor/matrix_keypad_binary_sensor.h +51 -0
  1513. esphome/components/matrix_keypad/matrix_keypad.cpp +115 -0
  1514. esphome/components/matrix_keypad/matrix_keypad.h +53 -0
  1515. esphome/components/max17043/__init__.py +1 -0
  1516. esphome/components/max17043/automation.h +20 -0
  1517. esphome/components/max17043/max17043.cpp +98 -0
  1518. esphome/components/max17043/max17043.h +29 -0
  1519. esphome/components/max17043/sensor.py +77 -0
  1520. esphome/components/max31855/__init__.py +0 -0
  1521. esphome/components/max31855/max31855.cpp +108 -0
  1522. esphome/components/max31855/max31855.h +31 -0
  1523. esphome/components/max31855/sensor.py +44 -0
  1524. esphome/components/max31856/__init__.py +0 -0
  1525. esphome/components/max31856/max31856.cpp +209 -0
  1526. esphome/components/max31856/max31856.h +103 -0
  1527. esphome/components/max31856/sensor.py +66 -0
  1528. esphome/components/max31865/__init__.py +0 -0
  1529. esphome/components/max31865/max31865.cpp +232 -0
  1530. esphome/components/max31865/max31865.h +58 -0
  1531. esphome/components/max31865/sensor.py +62 -0
  1532. esphome/components/max44009/__init__.py +0 -0
  1533. esphome/components/max44009/max44009.cpp +144 -0
  1534. esphome/components/max44009/max44009.h +37 -0
  1535. esphome/components/max44009/sensor.py +53 -0
  1536. esphome/components/max6675/__init__.py +0 -0
  1537. esphome/components/max6675/max6675.cpp +52 -0
  1538. esphome/components/max6675/max6675.h +26 -0
  1539. esphome/components/max6675/sensor.py +31 -0
  1540. esphome/components/max6956/__init__.py +142 -0
  1541. esphome/components/max6956/automation.h +40 -0
  1542. esphome/components/max6956/max6956.cpp +170 -0
  1543. esphome/components/max6956/max6956.h +94 -0
  1544. esphome/components/max6956/output/__init__.py +28 -0
  1545. esphome/components/max6956/output/max6956_led_output.cpp +26 -0
  1546. esphome/components/max6956/output/max6956_led_output.h +28 -0
  1547. esphome/components/max7219/__init__.py +0 -0
  1548. esphome/components/max7219/display.py +43 -0
  1549. esphome/components/max7219/max7219.cpp +243 -0
  1550. esphome/components/max7219/max7219.h +64 -0
  1551. esphome/components/max7219digit/__init__.py +0 -0
  1552. esphome/components/max7219digit/display.py +101 -0
  1553. esphome/components/max7219digit/max7219digit.cpp +342 -0
  1554. esphome/components/max7219digit/max7219digit.h +124 -0
  1555. esphome/components/max7219digit/max7219font.h +270 -0
  1556. esphome/components/max9611/__init__.py +1 -0
  1557. esphome/components/max9611/max9611.cpp +93 -0
  1558. esphome/components/max9611/max9611.h +62 -0
  1559. esphome/components/max9611/sensor.py +92 -0
  1560. esphome/components/mcp23008/__init__.py +28 -0
  1561. esphome/components/mcp23008/mcp23008.cpp +43 -0
  1562. esphome/components/mcp23008/mcp23008.h +24 -0
  1563. esphome/components/mcp23016/__init__.py +72 -0
  1564. esphome/components/mcp23016/mcp23016.cpp +95 -0
  1565. esphome/components/mcp23016/mcp23016.h +72 -0
  1566. esphome/components/mcp23017/__init__.py +28 -0
  1567. esphome/components/mcp23017/mcp23017.cpp +44 -0
  1568. esphome/components/mcp23017/mcp23017.h +24 -0
  1569. esphome/components/mcp23s08/__init__.py +32 -0
  1570. esphome/components/mcp23s08/mcp23s08.cpp +59 -0
  1571. esphome/components/mcp23s08/mcp23s08.h +30 -0
  1572. esphome/components/mcp23s17/__init__.py +32 -0
  1573. esphome/components/mcp23s17/mcp23s17.cpp +69 -0
  1574. esphome/components/mcp23s17/mcp23s17.h +29 -0
  1575. esphome/components/mcp23x08_base/__init__.py +8 -0
  1576. esphome/components/mcp23x08_base/mcp23x08_base.cpp +84 -0
  1577. esphome/components/mcp23x08_base/mcp23x08_base.h +39 -0
  1578. esphome/components/mcp23x17_base/__init__.py +8 -0
  1579. esphome/components/mcp23x17_base/mcp23x17_base.cpp +89 -0
  1580. esphome/components/mcp23x17_base/mcp23x17_base.h +52 -0
  1581. esphome/components/mcp23xxx_base/__init__.py +86 -0
  1582. esphome/components/mcp23xxx_base/mcp23xxx_base.cpp +20 -0
  1583. esphome/components/mcp23xxx_base/mcp23xxx_base.h +55 -0
  1584. esphome/components/mcp2515/__init__.py +0 -0
  1585. esphome/components/mcp2515/canbus.py +50 -0
  1586. esphome/components/mcp2515/mcp2515.cpp +681 -0
  1587. esphome/components/mcp2515/mcp2515.h +112 -0
  1588. esphome/components/mcp2515/mcp2515_defs.h +373 -0
  1589. esphome/components/mcp3008/__init__.py +25 -0
  1590. esphome/components/mcp3008/mcp3008.cpp +43 -0
  1591. esphome/components/mcp3008/mcp3008.h +22 -0
  1592. esphome/components/mcp3008/sensor/__init__.py +53 -0
  1593. esphome/components/mcp3008/sensor/mcp3008_sensor.cpp +27 -0
  1594. esphome/components/mcp3008/sensor/mcp3008_sensor.h +31 -0
  1595. esphome/components/mcp3204/__init__.py +26 -0
  1596. esphome/components/mcp3204/mcp3204.cpp +35 -0
  1597. esphome/components/mcp3204/mcp3204.h +28 -0
  1598. esphome/components/mcp3204/sensor/__init__.py +35 -0
  1599. esphome/components/mcp3204/sensor/mcp3204_sensor.cpp +23 -0
  1600. esphome/components/mcp3204/sensor/mcp3204_sensor.h +30 -0
  1601. esphome/components/mcp4725/__init__.py +0 -0
  1602. esphome/components/mcp4725/mcp4725.cpp +35 -0
  1603. esphome/components/mcp4725/mcp4725.h +23 -0
  1604. esphome/components/mcp4725/output.py +26 -0
  1605. esphome/components/mcp4728/__init__.py +30 -0
  1606. esphome/components/mcp4728/mcp4728.cpp +114 -0
  1607. esphome/components/mcp4728/mcp4728.h +67 -0
  1608. esphome/components/mcp4728/output/__init__.py +62 -0
  1609. esphome/components/mcp4728/output/mcp4728_output.cpp +17 -0
  1610. esphome/components/mcp4728/output/mcp4728_output.h +32 -0
  1611. esphome/components/mcp47a1/__init__.py +0 -0
  1612. esphome/components/mcp47a1/mcp47a1.cpp +21 -0
  1613. esphome/components/mcp47a1/mcp47a1.h +17 -0
  1614. esphome/components/mcp47a1/output.py +27 -0
  1615. esphome/components/mcp9600/__init__.py +0 -0
  1616. esphome/components/mcp9600/mcp9600.cpp +115 -0
  1617. esphome/components/mcp9600/mcp9600.h +51 -0
  1618. esphome/components/mcp9600/sensor.py +81 -0
  1619. esphome/components/mcp9808/__init__.py +0 -0
  1620. esphome/components/mcp9808/mcp9808.cpp +81 -0
  1621. esphome/components/mcp9808/mcp9808.h +20 -0
  1622. esphome/components/mcp9808/sensor.py +34 -0
  1623. esphome/components/md5/__init__.py +7 -0
  1624. esphome/components/md5/md5.cpp +69 -0
  1625. esphome/components/md5/md5.h +70 -0
  1626. esphome/components/mdns/__init__.py +113 -0
  1627. esphome/components/mdns/mdns_component.cpp +129 -0
  1628. esphome/components/mdns/mdns_component.h +50 -0
  1629. esphome/components/mdns/mdns_esp32.cpp +60 -0
  1630. esphome/components/mdns/mdns_esp8266.cpp +49 -0
  1631. esphome/components/mdns/mdns_host.cpp +19 -0
  1632. esphome/components/mdns/mdns_libretiny.cpp +44 -0
  1633. esphome/components/mdns/mdns_rp2040.cpp +49 -0
  1634. esphome/components/media_player/__init__.py +204 -0
  1635. esphome/components/media_player/automation.h +82 -0
  1636. esphome/components/media_player/media_player.cpp +132 -0
  1637. esphome/components/media_player/media_player.h +113 -0
  1638. esphome/components/mhz19/__init__.py +0 -0
  1639. esphome/components/mhz19/mhz19.cpp +119 -0
  1640. esphome/components/mhz19/mhz19.h +70 -0
  1641. esphome/components/mhz19/sensor.py +96 -0
  1642. esphome/components/micro_wake_word/__init__.py +498 -0
  1643. esphome/components/micro_wake_word/micro_wake_word.cpp +458 -0
  1644. esphome/components/micro_wake_word/micro_wake_word.h +176 -0
  1645. esphome/components/micro_wake_word/preprocessor_settings.h +20 -0
  1646. esphome/components/micro_wake_word/streaming_model.cpp +191 -0
  1647. esphome/components/micro_wake_word/streaming_model.h +84 -0
  1648. esphome/components/micronova/__init__.py +69 -0
  1649. esphome/components/micronova/button/__init__.py +44 -0
  1650. esphome/components/micronova/button/micronova_button.cpp +18 -0
  1651. esphome/components/micronova/button/micronova_button.h +23 -0
  1652. esphome/components/micronova/micronova.cpp +148 -0
  1653. esphome/components/micronova/micronova.h +164 -0
  1654. esphome/components/micronova/number/__init__.py +110 -0
  1655. esphome/components/micronova/number/micronova_number.cpp +45 -0
  1656. esphome/components/micronova/number/micronova_number.h +28 -0
  1657. esphome/components/micronova/sensor/__init__.py +172 -0
  1658. esphome/components/micronova/sensor/micronova_sensor.cpp +35 -0
  1659. esphome/components/micronova/sensor/micronova_sensor.h +27 -0
  1660. esphome/components/micronova/switch/__init__.py +56 -0
  1661. esphome/components/micronova/switch/micronova_switch.cpp +33 -0
  1662. esphome/components/micronova/switch/micronova_switch.h +29 -0
  1663. esphome/components/micronova/text_sensor/__init__.py +43 -0
  1664. esphome/components/micronova/text_sensor/micronova_text_sensor.cpp +31 -0
  1665. esphome/components/micronova/text_sensor/micronova_text_sensor.h +20 -0
  1666. esphome/components/microphone/__init__.py +91 -0
  1667. esphome/components/microphone/automation.h +32 -0
  1668. esphome/components/microphone/microphone.h +38 -0
  1669. esphome/components/mics_4514/__init__.py +0 -0
  1670. esphome/components/mics_4514/mics_4514.cpp +135 -0
  1671. esphome/components/mics_4514/mics_4514.h +34 -0
  1672. esphome/components/mics_4514/sensor.py +56 -0
  1673. esphome/components/midea/__init__.py +0 -0
  1674. esphome/components/midea/ac_adapter.cpp +179 -0
  1675. esphome/components/midea/ac_adapter.h +51 -0
  1676. esphome/components/midea/ac_automations.h +68 -0
  1677. esphome/components/midea/air_conditioner.cpp +173 -0
  1678. esphome/components/midea/air_conditioner.h +66 -0
  1679. esphome/components/midea/appliance_base.h +102 -0
  1680. esphome/components/midea/climate.py +296 -0
  1681. esphome/components/midea/ir_transmitter.h +60 -0
  1682. esphome/components/midea_ac/__init__.py +0 -0
  1683. esphome/components/midea_ac/climate.py +3 -0
  1684. esphome/components/midea_ir/__init__.py +0 -0
  1685. esphome/components/midea_ir/climate.py +24 -0
  1686. esphome/components/midea_ir/midea_data.h +92 -0
  1687. esphome/components/midea_ir/midea_ir.cpp +202 -0
  1688. esphome/components/midea_ir/midea_ir.h +47 -0
  1689. esphome/components/mitsubishi/__init__.py +0 -0
  1690. esphome/components/mitsubishi/climate.py +71 -0
  1691. esphome/components/mitsubishi/mitsubishi.cpp +397 -0
  1692. esphome/components/mitsubishi/mitsubishi.h +83 -0
  1693. esphome/components/mlx90393/__init__.py +1 -0
  1694. esphome/components/mlx90393/sensor.py +135 -0
  1695. esphome/components/mlx90393/sensor_mlx90393.cpp +91 -0
  1696. esphome/components/mlx90393/sensor_mlx90393.h +59 -0
  1697. esphome/components/mlx90614/__init__.py +0 -0
  1698. esphome/components/mlx90614/mlx90614.cpp +122 -0
  1699. esphome/components/mlx90614/mlx90614.h +34 -0
  1700. esphome/components/mlx90614/sensor.py +63 -0
  1701. esphome/components/mmc5603/__init__.py +1 -0
  1702. esphome/components/mmc5603/mmc5603.cpp +162 -0
  1703. esphome/components/mmc5603/mmc5603.h +43 -0
  1704. esphome/components/mmc5603/sensor.py +90 -0
  1705. esphome/components/mmc5983/__init__.py +1 -0
  1706. esphome/components/mmc5983/mmc5983.cpp +141 -0
  1707. esphome/components/mmc5983/mmc5983.h +28 -0
  1708. esphome/components/mmc5983/sensor.py +55 -0
  1709. esphome/components/modbus/__init__.py +104 -0
  1710. esphome/components/modbus/modbus.cpp +249 -0
  1711. esphome/components/modbus/modbus.h +78 -0
  1712. esphome/components/modbus_controller/__init__.py +338 -0
  1713. esphome/components/modbus_controller/automation.h +35 -0
  1714. esphome/components/modbus_controller/binary_sensor/__init__.py +60 -0
  1715. esphome/components/modbus_controller/binary_sensor/modbus_binarysensor.cpp +38 -0
  1716. esphome/components/modbus_controller/binary_sensor/modbus_binarysensor.h +44 -0
  1717. esphome/components/modbus_controller/const.py +21 -0
  1718. esphome/components/modbus_controller/modbus_controller.cpp +722 -0
  1719. esphome/components/modbus_controller/modbus_controller.h +556 -0
  1720. esphome/components/modbus_controller/number/__init__.py +125 -0
  1721. esphome/components/modbus_controller/number/modbus_number.cpp +86 -0
  1722. esphome/components/modbus_controller/number/modbus_number.h +50 -0
  1723. esphome/components/modbus_controller/output/__init__.py +105 -0
  1724. esphome/components/modbus_controller/output/modbus_output.cpp +111 -0
  1725. esphome/components/modbus_controller/output/modbus_output.h +76 -0
  1726. esphome/components/modbus_controller/select/__init__.py +143 -0
  1727. esphome/components/modbus_controller/select/modbus_select.cpp +90 -0
  1728. esphome/components/modbus_controller/select/modbus_select.h +54 -0
  1729. esphome/components/modbus_controller/sensor/__init__.py +68 -0
  1730. esphome/components/modbus_controller/sensor/modbus_sensor.cpp +31 -0
  1731. esphome/components/modbus_controller/sensor/modbus_sensor.h +37 -0
  1732. esphome/components/modbus_controller/switch/__init__.py +77 -0
  1733. esphome/components/modbus_controller/switch/modbus_switch.cpp +104 -0
  1734. esphome/components/modbus_controller/switch/modbus_switch.h +50 -0
  1735. esphome/components/modbus_controller/text_sensor/__init__.py +84 -0
  1736. esphome/components/modbus_controller/text_sensor/modbus_textsensor.cpp +58 -0
  1737. esphome/components/modbus_controller/text_sensor/modbus_textsensor.h +44 -0
  1738. esphome/components/monochromatic/__init__.py +0 -0
  1739. esphome/components/monochromatic/light.py +24 -0
  1740. esphome/components/monochromatic/monochromatic_light_output.h +29 -0
  1741. esphome/components/mopeka_ble/__init__.py +30 -0
  1742. esphome/components/mopeka_ble/mopeka_ble.cpp +91 -0
  1743. esphome/components/mopeka_ble/mopeka_ble.h +27 -0
  1744. esphome/components/mopeka_pro_check/__init__.py +1 -0
  1745. esphome/components/mopeka_pro_check/mopeka_pro_check.cpp +159 -0
  1746. esphome/components/mopeka_pro_check/mopeka_pro_check.h +72 -0
  1747. esphome/components/mopeka_pro_check/sensor.py +174 -0
  1748. esphome/components/mopeka_std_check/__init__.py +1 -0
  1749. esphome/components/mopeka_std_check/mopeka_std_check.cpp +227 -0
  1750. esphome/components/mopeka_std_check/mopeka_std_check.h +80 -0
  1751. esphome/components/mopeka_std_check/sensor.py +138 -0
  1752. esphome/components/mpl3115a2/__init__.py +0 -0
  1753. esphome/components/mpl3115a2/mpl3115a2.cpp +99 -0
  1754. esphome/components/mpl3115a2/mpl3115a2.h +108 -0
  1755. esphome/components/mpl3115a2/sensor.py +75 -0
  1756. esphome/components/mpr121/__init__.py +127 -0
  1757. esphome/components/mpr121/binary_sensor/__init__.py +37 -0
  1758. esphome/components/mpr121/binary_sensor/mpr121_binary_sensor.cpp +20 -0
  1759. esphome/components/mpr121/binary_sensor/mpr121_binary_sensor.h +26 -0
  1760. esphome/components/mpr121/mpr121.cpp +165 -0
  1761. esphome/components/mpr121/mpr121.h +128 -0
  1762. esphome/components/mpu6050/__init__.py +0 -0
  1763. esphome/components/mpu6050/mpu6050.cpp +147 -0
  1764. esphome/components/mpu6050/mpu6050.h +39 -0
  1765. esphome/components/mpu6050/sensor.py +84 -0
  1766. esphome/components/mpu6886/__init__.py +1 -0
  1767. esphome/components/mpu6886/mpu6886.cpp +153 -0
  1768. esphome/components/mpu6886/mpu6886.h +39 -0
  1769. esphome/components/mpu6886/sensor.py +85 -0
  1770. esphome/components/mqtt/__init__.py +594 -0
  1771. esphome/components/mqtt/custom_mqtt_device.cpp +35 -0
  1772. esphome/components/mqtt/custom_mqtt_device.h +220 -0
  1773. esphome/components/mqtt/mqtt_alarm_control_panel.cpp +125 -0
  1774. esphome/components/mqtt/mqtt_alarm_control_panel.h +39 -0
  1775. esphome/components/mqtt/mqtt_backend.h +71 -0
  1776. esphome/components/mqtt/mqtt_backend_esp32.cpp +194 -0
  1777. esphome/components/mqtt/mqtt_backend_esp32.h +178 -0
  1778. esphome/components/mqtt/mqtt_backend_esp8266.h +74 -0
  1779. esphome/components/mqtt/mqtt_backend_libretiny.h +74 -0
  1780. esphome/components/mqtt/mqtt_binary_sensor.cpp +60 -0
  1781. esphome/components/mqtt/mqtt_binary_sensor.h +43 -0
  1782. esphome/components/mqtt/mqtt_button.cpp +46 -0
  1783. esphome/components/mqtt/mqtt_button.h +40 -0
  1784. esphome/components/mqtt/mqtt_client.cpp +723 -0
  1785. esphome/components/mqtt/mqtt_client.h +451 -0
  1786. esphome/components/mqtt/mqtt_climate.cpp +459 -0
  1787. esphome/components/mqtt/mqtt_climate.h +56 -0
  1788. esphome/components/mqtt/mqtt_component.cpp +320 -0
  1789. esphome/components/mqtt/mqtt_component.h +218 -0
  1790. esphome/components/mqtt/mqtt_const.h +543 -0
  1791. esphome/components/mqtt/mqtt_cover.cpp +118 -0
  1792. esphome/components/mqtt/mqtt_cover.h +43 -0
  1793. esphome/components/mqtt/mqtt_date.cpp +68 -0
  1794. esphome/components/mqtt/mqtt_date.h +45 -0
  1795. esphome/components/mqtt/mqtt_datetime.cpp +84 -0
  1796. esphome/components/mqtt/mqtt_datetime.h +45 -0
  1797. esphome/components/mqtt/mqtt_event.cpp +54 -0
  1798. esphome/components/mqtt/mqtt_event.h +39 -0
  1799. esphome/components/mqtt/mqtt_fan.cpp +143 -0
  1800. esphome/components/mqtt/mqtt_fan.h +52 -0
  1801. esphome/components/mqtt/mqtt_light.cpp +87 -0
  1802. esphome/components/mqtt/mqtt_light.h +41 -0
  1803. esphome/components/mqtt/mqtt_lock.cpp +57 -0
  1804. esphome/components/mqtt/mqtt_lock.h +41 -0
  1805. esphome/components/mqtt/mqtt_number.cpp +80 -0
  1806. esphome/components/mqtt/mqtt_number.h +46 -0
  1807. esphome/components/mqtt/mqtt_select.cpp +59 -0
  1808. esphome/components/mqtt/mqtt_select.h +46 -0
  1809. esphome/components/mqtt/mqtt_sensor.cpp +83 -0
  1810. esphome/components/mqtt/mqtt_sensor.h +59 -0
  1811. esphome/components/mqtt/mqtt_switch.cpp +62 -0
  1812. esphome/components/mqtt/mqtt_switch.h +41 -0
  1813. esphome/components/mqtt/mqtt_text.cpp +63 -0
  1814. esphome/components/mqtt/mqtt_text.h +46 -0
  1815. esphome/components/mqtt/mqtt_text_sensor.cpp +47 -0
  1816. esphome/components/mqtt/mqtt_text_sensor.h +40 -0
  1817. esphome/components/mqtt/mqtt_time.cpp +68 -0
  1818. esphome/components/mqtt/mqtt_time.h +45 -0
  1819. esphome/components/mqtt/mqtt_update.cpp +62 -0
  1820. esphome/components/mqtt/mqtt_update.h +41 -0
  1821. esphome/components/mqtt/mqtt_valve.cpp +90 -0
  1822. esphome/components/mqtt/mqtt_valve.h +41 -0
  1823. esphome/components/mqtt_subscribe/__init__.py +3 -0
  1824. esphome/components/mqtt_subscribe/sensor/__init__.py +40 -0
  1825. esphome/components/mqtt_subscribe/sensor/mqtt_subscribe_sensor.cpp +38 -0
  1826. esphome/components/mqtt_subscribe/sensor/mqtt_subscribe_sensor.h +33 -0
  1827. esphome/components/mqtt_subscribe/text_sensor/__init__.py +36 -0
  1828. esphome/components/mqtt_subscribe/text_sensor/mqtt_subscribe_text_sensor.cpp +28 -0
  1829. esphome/components/mqtt_subscribe/text_sensor/mqtt_subscribe_text_sensor.h +32 -0
  1830. esphome/components/ms5611/__init__.py +0 -0
  1831. esphome/components/ms5611/ms5611.cpp +130 -0
  1832. esphome/components/ms5611/ms5611.h +31 -0
  1833. esphome/components/ms5611/sensor.py +58 -0
  1834. esphome/components/ms8607/__init__.py +1 -0
  1835. esphome/components/ms8607/ms8607.cpp +444 -0
  1836. esphome/components/ms8607/ms8607.h +109 -0
  1837. esphome/components/ms8607/sensor.py +83 -0
  1838. esphome/components/my9231/__init__.py +41 -0
  1839. esphome/components/my9231/my9231.cpp +127 -0
  1840. esphome/components/my9231/my9231.h +64 -0
  1841. esphome/components/my9231/output.py +27 -0
  1842. esphome/components/nau7802/__init__.py +0 -0
  1843. esphome/components/nau7802/nau7802.cpp +323 -0
  1844. esphome/components/nau7802/nau7802.h +121 -0
  1845. esphome/components/nau7802/sensor.py +134 -0
  1846. esphome/components/neopixelbus/__init__.py +0 -0
  1847. esphome/components/neopixelbus/_methods.py +421 -0
  1848. esphome/components/neopixelbus/const.py +42 -0
  1849. esphome/components/neopixelbus/light.py +225 -0
  1850. esphome/components/neopixelbus/neopixelbus_light.h +146 -0
  1851. esphome/components/network/__init__.py +58 -0
  1852. esphome/components/network/ip_address.h +145 -0
  1853. esphome/components/network/util.cpp +66 -0
  1854. esphome/components/network/util.h +20 -0
  1855. esphome/components/nextion/__init__.py +10 -0
  1856. esphome/components/nextion/automation.h +122 -0
  1857. esphome/components/nextion/base_component.py +126 -0
  1858. esphome/components/nextion/binary_sensor/__init__.py +95 -0
  1859. esphome/components/nextion/binary_sensor/nextion_binarysensor.cpp +69 -0
  1860. esphome/components/nextion/binary_sensor/nextion_binarysensor.h +42 -0
  1861. esphome/components/nextion/display.py +168 -0
  1862. esphome/components/nextion/nextion.cpp +1172 -0
  1863. esphome/components/nextion/nextion.h +1357 -0
  1864. esphome/components/nextion/nextion_base.h +64 -0
  1865. esphome/components/nextion/nextion_commands.cpp +356 -0
  1866. esphome/components/nextion/nextion_component.cpp +116 -0
  1867. esphome/components/nextion/nextion_component.h +49 -0
  1868. esphome/components/nextion/nextion_component_base.h +103 -0
  1869. esphome/components/nextion/nextion_upload_arduino.cpp +387 -0
  1870. esphome/components/nextion/nextion_upload_idf.cpp +367 -0
  1871. esphome/components/nextion/sensor/__init__.py +130 -0
  1872. esphome/components/nextion/sensor/nextion_sensor.cpp +116 -0
  1873. esphome/components/nextion/sensor/nextion_sensor.h +49 -0
  1874. esphome/components/nextion/switch/__init__.py +71 -0
  1875. esphome/components/nextion/switch/nextion_switch.cpp +52 -0
  1876. esphome/components/nextion/switch/nextion_switch.h +34 -0
  1877. esphome/components/nextion/text_sensor/__init__.py +69 -0
  1878. esphome/components/nextion/text_sensor/nextion_textsensor.cpp +49 -0
  1879. esphome/components/nextion/text_sensor/nextion_textsensor.h +32 -0
  1880. esphome/components/nfc/__init__.py +13 -0
  1881. esphome/components/nfc/automation.cpp +9 -0
  1882. esphome/components/nfc/automation.h +17 -0
  1883. esphome/components/nfc/binary_sensor/__init__.py +72 -0
  1884. esphome/components/nfc/binary_sensor/binary_sensor.cpp +114 -0
  1885. esphome/components/nfc/binary_sensor/binary_sensor.h +38 -0
  1886. esphome/components/nfc/nci_core.h +144 -0
  1887. esphome/components/nfc/nci_message.cpp +166 -0
  1888. esphome/components/nfc/nci_message.h +50 -0
  1889. esphome/components/nfc/ndef_message.cpp +110 -0
  1890. esphome/components/nfc/ndef_message.h +42 -0
  1891. esphome/components/nfc/ndef_record.cpp +65 -0
  1892. esphome/components/nfc/ndef_record.h +57 -0
  1893. esphome/components/nfc/ndef_record_text.cpp +40 -0
  1894. esphome/components/nfc/ndef_record_text.h +43 -0
  1895. esphome/components/nfc/ndef_record_uri.cpp +48 -0
  1896. esphome/components/nfc/ndef_record_uri.h +78 -0
  1897. esphome/components/nfc/nfc.cpp +108 -0
  1898. esphome/components/nfc/nfc.h +84 -0
  1899. esphome/components/nfc/nfc_helpers.cpp +47 -0
  1900. esphome/components/nfc/nfc_helpers.h +17 -0
  1901. esphome/components/nfc/nfc_tag.cpp +9 -0
  1902. esphome/components/nfc/nfc_tag.h +57 -0
  1903. esphome/components/noblex/__init__.py +1 -0
  1904. esphome/components/noblex/climate.py +20 -0
  1905. esphome/components/noblex/noblex.cpp +309 -0
  1906. esphome/components/noblex/noblex.h +47 -0
  1907. esphome/components/npi19/__init__.py +0 -0
  1908. esphome/components/npi19/npi19.cpp +111 -0
  1909. esphome/components/npi19/npi19.h +30 -0
  1910. esphome/components/npi19/sensor.py +52 -0
  1911. esphome/components/ntc/__init__.py +0 -0
  1912. esphome/components/ntc/ntc.cpp +31 -0
  1913. esphome/components/ntc/ntc.h +29 -0
  1914. esphome/components/ntc/sensor.py +146 -0
  1915. esphome/components/number/__init__.py +414 -0
  1916. esphome/components/number/automation.cpp +56 -0
  1917. esphome/components/number/automation.h +95 -0
  1918. esphome/components/number/number.cpp +21 -0
  1919. esphome/components/number/number.h +70 -0
  1920. esphome/components/number/number_call.cpp +118 -0
  1921. esphome/components/number/number_call.h +43 -0
  1922. esphome/components/number/number_traits.cpp +10 -0
  1923. esphome/components/number/number_traits.h +39 -0
  1924. esphome/components/one_wire/__init__.py +40 -0
  1925. esphome/components/one_wire/one_wire.cpp +40 -0
  1926. esphome/components/one_wire/one_wire.h +44 -0
  1927. esphome/components/one_wire/one_wire_bus.cpp +88 -0
  1928. esphome/components/one_wire/one_wire_bus.h +61 -0
  1929. esphome/components/online_image/__init__.py +168 -0
  1930. esphome/components/online_image/image_decoder.cpp +44 -0
  1931. esphome/components/online_image/image_decoder.h +112 -0
  1932. esphome/components/online_image/online_image.cpp +277 -0
  1933. esphome/components/online_image/online_image.h +190 -0
  1934. esphome/components/online_image/png_image.cpp +72 -0
  1935. esphome/components/online_image/png_image.h +33 -0
  1936. esphome/components/opentherm/__init__.py +83 -0
  1937. esphome/components/opentherm/binary_sensor/__init__.py +33 -0
  1938. esphome/components/opentherm/const.py +11 -0
  1939. esphome/components/opentherm/generate.py +142 -0
  1940. esphome/components/opentherm/hub.cpp +382 -0
  1941. esphome/components/opentherm/hub.h +163 -0
  1942. esphome/components/opentherm/input.h +18 -0
  1943. esphome/components/opentherm/input.py +51 -0
  1944. esphome/components/opentherm/number/__init__.py +74 -0
  1945. esphome/components/opentherm/number/number.cpp +40 -0
  1946. esphome/components/opentherm/number/number.h +31 -0
  1947. esphome/components/opentherm/opentherm.cpp +582 -0
  1948. esphome/components/opentherm/opentherm.h +378 -0
  1949. esphome/components/opentherm/opentherm_macros.h +151 -0
  1950. esphome/components/opentherm/output/__init__.py +47 -0
  1951. esphome/components/opentherm/output/output.cpp +18 -0
  1952. esphome/components/opentherm/output/output.h +33 -0
  1953. esphome/components/opentherm/schema.py +814 -0
  1954. esphome/components/opentherm/sensor/__init__.py +51 -0
  1955. esphome/components/opentherm/switch/__init__.py +43 -0
  1956. esphome/components/opentherm/switch/switch.cpp +28 -0
  1957. esphome/components/opentherm/switch/switch.h +20 -0
  1958. esphome/components/opentherm/validate.py +31 -0
  1959. esphome/components/ota/__init__.py +122 -0
  1960. esphome/components/ota/automation.h +78 -0
  1961. esphome/components/ota/ota_backend.cpp +20 -0
  1962. esphome/components/ota/ota_backend.h +96 -0
  1963. esphome/components/ota/ota_backend_arduino_esp32.cpp +62 -0
  1964. esphome/components/ota/ota_backend_arduino_esp32.h +24 -0
  1965. esphome/components/ota/ota_backend_arduino_esp8266.cpp +75 -0
  1966. esphome/components/ota/ota_backend_arduino_esp8266.h +30 -0
  1967. esphome/components/ota/ota_backend_arduino_libretiny.cpp +62 -0
  1968. esphome/components/ota/ota_backend_arduino_libretiny.h +23 -0
  1969. esphome/components/ota/ota_backend_arduino_rp2040.cpp +75 -0
  1970. esphome/components/ota/ota_backend_arduino_rp2040.h +26 -0
  1971. esphome/components/ota/ota_backend_esp_idf.cpp +116 -0
  1972. esphome/components/ota/ota_backend_esp_idf.h +31 -0
  1973. esphome/components/output/__init__.py +110 -0
  1974. esphome/components/output/automation.cpp +10 -0
  1975. esphome/components/output/automation.h +44 -0
  1976. esphome/components/output/binary_output.h +73 -0
  1977. esphome/components/output/button/__init__.py +29 -0
  1978. esphome/components/output/button/output_button.cpp +21 -0
  1979. esphome/components/output/button/output_button.h +25 -0
  1980. esphome/components/output/float_output.cpp +46 -0
  1981. esphome/components/output/float_output.h +89 -0
  1982. esphome/components/output/lock/__init__.py +23 -0
  1983. esphome/components/output/lock/output_lock.cpp +22 -0
  1984. esphome/components/output/lock/output_lock.h +24 -0
  1985. esphome/components/output/switch/__init__.py +28 -0
  1986. esphome/components/output/switch/output_switch.cpp +31 -0
  1987. esphome/components/output/switch/output_switch.h +25 -0
  1988. esphome/components/packages/__init__.py +183 -0
  1989. esphome/components/partition/__init__.py +0 -0
  1990. esphome/components/partition/light.py +121 -0
  1991. esphome/components/partition/light_partition.cpp +10 -0
  1992. esphome/components/partition/light_partition.h +97 -0
  1993. esphome/components/pca6416a/__init__.py +78 -0
  1994. esphome/components/pca6416a/pca6416a.cpp +176 -0
  1995. esphome/components/pca6416a/pca6416a.h +63 -0
  1996. esphome/components/pca9554/__init__.py +86 -0
  1997. esphome/components/pca9554/pca9554.cpp +144 -0
  1998. esphome/components/pca9554/pca9554.h +76 -0
  1999. esphome/components/pca9685/__init__.py +47 -0
  2000. esphome/components/pca9685/output.py +26 -0
  2001. esphome/components/pca9685/pca9685_output.cpp +154 -0
  2002. esphome/components/pca9685/pca9685_output.h +73 -0
  2003. esphome/components/pcd8544/__init__.py +0 -0
  2004. esphome/components/pcd8544/display.py +60 -0
  2005. esphome/components/pcd8544/pcd_8544.cpp +126 -0
  2006. esphome/components/pcd8544/pcd_8544.h +78 -0
  2007. esphome/components/pcf85063/__init__.py +0 -0
  2008. esphome/components/pcf85063/pcf85063.cpp +109 -0
  2009. esphome/components/pcf85063/pcf85063.h +96 -0
  2010. esphome/components/pcf85063/time.py +60 -0
  2011. esphome/components/pcf8563/__init__.py +0 -0
  2012. esphome/components/pcf8563/pcf8563.cpp +109 -0
  2013. esphome/components/pcf8563/pcf8563.h +124 -0
  2014. esphome/components/pcf8563/time.py +62 -0
  2015. esphome/components/pcf8574/__init__.py +75 -0
  2016. esphome/components/pcf8574/pcf8574.cpp +106 -0
  2017. esphome/components/pcf8574/pcf8574.h +65 -0
  2018. esphome/components/pid/__init__.py +1 -0
  2019. esphome/components/pid/climate.py +194 -0
  2020. esphome/components/pid/pid_autotuner.cpp +361 -0
  2021. esphome/components/pid/pid_autotuner.h +115 -0
  2022. esphome/components/pid/pid_climate.cpp +187 -0
  2023. esphome/components/pid/pid_climate.h +160 -0
  2024. esphome/components/pid/pid_controller.cpp +129 -0
  2025. esphome/components/pid/pid_controller.h +71 -0
  2026. esphome/components/pid/pid_simulator.h +77 -0
  2027. esphome/components/pid/sensor/__init__.py +53 -0
  2028. esphome/components/pid/sensor/pid_climate_sensor.cpp +59 -0
  2029. esphome/components/pid/sensor/pid_climate_sensor.h +37 -0
  2030. esphome/components/pipsolar/__init__.py +32 -0
  2031. esphome/components/pipsolar/binary_sensor/__init__.py +141 -0
  2032. esphome/components/pipsolar/output/__init__.py +106 -0
  2033. esphome/components/pipsolar/output/pipsolar_output.cpp +22 -0
  2034. esphome/components/pipsolar/output/pipsolar_output.h +42 -0
  2035. esphome/components/pipsolar/pipsolar.cpp +912 -0
  2036. esphome/components/pipsolar/pipsolar.h +223 -0
  2037. esphome/components/pipsolar/sensor/__init__.py +279 -0
  2038. esphome/components/pipsolar/switch/__init__.py +50 -0
  2039. esphome/components/pipsolar/switch/pipsolar_switch.cpp +24 -0
  2040. esphome/components/pipsolar/switch/pipsolar_switch.h +25 -0
  2041. esphome/components/pipsolar/text_sensor/__init__.py +40 -0
  2042. esphome/components/pm1006/__init__.py +0 -0
  2043. esphome/components/pm1006/pm1006.cpp +103 -0
  2044. esphome/components/pm1006/pm1006.h +36 -0
  2045. esphome/components/pm1006/sensor.py +67 -0
  2046. esphome/components/pmsa003i/__init__.py +0 -0
  2047. esphome/components/pmsa003i/pmsa003i.cpp +110 -0
  2048. esphome/components/pmsa003i/pmsa003i.h +68 -0
  2049. esphome/components/pmsa003i/sensor.py +127 -0
  2050. esphome/components/pmsx003/__init__.py +0 -0
  2051. esphome/components/pmsx003/pmsx003.cpp +357 -0
  2052. esphome/components/pmsx003/pmsx003.h +101 -0
  2053. esphome/components/pmsx003/sensor.py +272 -0
  2054. esphome/components/pmwcs3/__init__.py +1 -0
  2055. esphome/components/pmwcs3/pmwcs3.cpp +116 -0
  2056. esphome/components/pmwcs3/pmwcs3.h +70 -0
  2057. esphome/components/pmwcs3/sensor.py +140 -0
  2058. esphome/components/pn532/__init__.py +96 -0
  2059. esphome/components/pn532/binary_sensor.py +48 -0
  2060. esphome/components/pn532/pn532.cpp +465 -0
  2061. esphome/components/pn532/pn532.h +150 -0
  2062. esphome/components/pn532/pn532_mifare_classic.cpp +262 -0
  2063. esphome/components/pn532/pn532_mifare_ultralight.cpp +192 -0
  2064. esphome/components/pn532_i2c/__init__.py +26 -0
  2065. esphome/components/pn532_i2c/pn532_i2c.cpp +129 -0
  2066. esphome/components/pn532_i2c/pn532_i2c.h +25 -0
  2067. esphome/components/pn532_spi/__init__.py +26 -0
  2068. esphome/components/pn532_spi/pn532_spi.cpp +138 -0
  2069. esphome/components/pn532_spi/pn532_spi.h +28 -0
  2070. esphome/components/pn7150/__init__.py +215 -0
  2071. esphome/components/pn7150/automation.h +82 -0
  2072. esphome/components/pn7150/pn7150.cpp +1143 -0
  2073. esphome/components/pn7150/pn7150.h +296 -0
  2074. esphome/components/pn7150/pn7150_mifare_classic.cpp +322 -0
  2075. esphome/components/pn7150/pn7150_mifare_ultralight.cpp +186 -0
  2076. esphome/components/pn7150_i2c/__init__.py +25 -0
  2077. esphome/components/pn7150_i2c/pn7150_i2c.cpp +49 -0
  2078. esphome/components/pn7150_i2c/pn7150_i2c.h +22 -0
  2079. esphome/components/pn7160/__init__.py +227 -0
  2080. esphome/components/pn7160/automation.h +82 -0
  2081. esphome/components/pn7160/pn7160.cpp +1167 -0
  2082. esphome/components/pn7160/pn7160.h +315 -0
  2083. esphome/components/pn7160/pn7160_mifare_classic.cpp +322 -0
  2084. esphome/components/pn7160/pn7160_mifare_ultralight.cpp +186 -0
  2085. esphome/components/pn7160_i2c/__init__.py +25 -0
  2086. esphome/components/pn7160_i2c/pn7160_i2c.cpp +49 -0
  2087. esphome/components/pn7160_i2c/pn7160_i2c.h +22 -0
  2088. esphome/components/pn7160_spi/__init__.py +26 -0
  2089. esphome/components/pn7160_spi/pn7160_spi.cpp +54 -0
  2090. esphome/components/pn7160_spi/pn7160_spi.h +30 -0
  2091. esphome/components/power_supply/__init__.py +42 -0
  2092. esphome/components/power_supply/power_supply.cpp +59 -0
  2093. esphome/components/power_supply/power_supply.h +67 -0
  2094. esphome/components/preferences/__init__.py +24 -0
  2095. esphome/components/preferences/syncer.h +23 -0
  2096. esphome/components/prometheus/__init__.py +58 -0
  2097. esphome/components/prometheus/prometheus_handler.cpp +516 -0
  2098. esphome/components/prometheus/prometheus_handler.h +139 -0
  2099. esphome/components/psram/__init__.py +60 -0
  2100. esphome/components/psram/psram.cpp +32 -0
  2101. esphome/components/psram/psram.h +17 -0
  2102. esphome/components/pulse_counter/__init__.py +0 -0
  2103. esphome/components/pulse_counter/automation.h +24 -0
  2104. esphome/components/pulse_counter/pulse_counter_sensor.cpp +194 -0
  2105. esphome/components/pulse_counter/pulse_counter_sensor.h +91 -0
  2106. esphome/components/pulse_counter/sensor.py +156 -0
  2107. esphome/components/pulse_meter/__init__.py +0 -0
  2108. esphome/components/pulse_meter/automation.h +24 -0
  2109. esphome/components/pulse_meter/pulse_meter_sensor.cpp +163 -0
  2110. esphome/components/pulse_meter/pulse_meter_sensor.h +83 -0
  2111. esphome/components/pulse_meter/sensor.py +114 -0
  2112. esphome/components/pulse_width/__init__.py +0 -0
  2113. esphome/components/pulse_width/pulse_width.cpp +31 -0
  2114. esphome/components/pulse_width/pulse_width.h +44 -0
  2115. esphome/components/pulse_width/sensor.py +40 -0
  2116. esphome/components/pvvx_mithermometer/__init__.py +0 -0
  2117. esphome/components/pvvx_mithermometer/display/__init__.py +55 -0
  2118. esphome/components/pvvx_mithermometer/display/pvvx_display.cpp +163 -0
  2119. esphome/components/pvvx_mithermometer/display/pvvx_display.h +135 -0
  2120. esphome/components/pvvx_mithermometer/pvvx_mithermometer.cpp +141 -0
  2121. esphome/components/pvvx_mithermometer/pvvx_mithermometer.h +51 -0
  2122. esphome/components/pvvx_mithermometer/sensor.py +100 -0
  2123. esphome/components/pylontech/__init__.py +46 -0
  2124. esphome/components/pylontech/pylontech.cpp +104 -0
  2125. esphome/components/pylontech/pylontech.h +53 -0
  2126. esphome/components/pylontech/sensor/__init__.py +97 -0
  2127. esphome/components/pylontech/sensor/pylontech_sensor.cpp +60 -0
  2128. esphome/components/pylontech/sensor/pylontech_sensor.h +32 -0
  2129. esphome/components/pylontech/text_sensor/__init__.py +41 -0
  2130. esphome/components/pylontech/text_sensor/pylontech_text_sensor.cpp +40 -0
  2131. esphome/components/pylontech/text_sensor/pylontech_text_sensor.h +26 -0
  2132. esphome/components/pzem004t/__init__.py +0 -0
  2133. esphome/components/pzem004t/pzem004t.cpp +126 -0
  2134. esphome/components/pzem004t/pzem004t.h +46 -0
  2135. esphome/components/pzem004t/sensor.py +82 -0
  2136. esphome/components/pzemac/__init__.py +0 -0
  2137. esphome/components/pzemac/pzemac.cpp +85 -0
  2138. esphome/components/pzemac/pzemac.h +53 -0
  2139. esphome/components/pzemac/sensor.py +125 -0
  2140. esphome/components/pzemdc/__init__.py +0 -0
  2141. esphome/components/pzemdc/pzemdc.cpp +73 -0
  2142. esphome/components/pzemdc/pzemdc.h +46 -0
  2143. esphome/components/pzemdc/sensor.py +101 -0
  2144. esphome/components/qmc5883l/__init__.py +0 -0
  2145. esphome/components/qmc5883l/qmc5883l.cpp +175 -0
  2146. esphome/components/qmc5883l/qmc5883l.h +63 -0
  2147. esphome/components/qmc5883l/sensor.py +145 -0
  2148. esphome/components/qmp6988/__init__.py +1 -0
  2149. esphome/components/qmp6988/qmp6988.cpp +397 -0
  2150. esphome/components/qmp6988/qmp6988.h +116 -0
  2151. esphome/components/qmp6988/sensor.py +101 -0
  2152. esphome/components/qr_code/__init__.py +41 -0
  2153. esphome/components/qr_code/qr_code.cpp +67 -0
  2154. esphome/components/qr_code/qr_code.h +36 -0
  2155. esphome/components/qspi_amoled/display.py +3 -0
  2156. esphome/components/qspi_dbi/__init__.py +1 -0
  2157. esphome/components/qspi_dbi/display.py +185 -0
  2158. esphome/components/qspi_dbi/models.py +67 -0
  2159. esphome/components/qspi_dbi/qspi_dbi.cpp +230 -0
  2160. esphome/components/qspi_dbi/qspi_dbi.h +173 -0
  2161. esphome/components/qwiic_pir/__init__.py +0 -0
  2162. esphome/components/qwiic_pir/binary_sensor.py +67 -0
  2163. esphome/components/qwiic_pir/qwiic_pir.cpp +137 -0
  2164. esphome/components/qwiic_pir/qwiic_pir.h +70 -0
  2165. esphome/components/radon_eye_ble/__init__.py +23 -0
  2166. esphome/components/radon_eye_ble/radon_eye_listener.cpp +32 -0
  2167. esphome/components/radon_eye_ble/radon_eye_listener.h +19 -0
  2168. esphome/components/radon_eye_rd200/__init__.py +1 -0
  2169. esphome/components/radon_eye_rd200/radon_eye_rd200.cpp +179 -0
  2170. esphome/components/radon_eye_rd200/radon_eye_rd200.h +59 -0
  2171. esphome/components/radon_eye_rd200/sensor.py +55 -0
  2172. esphome/components/rc522/__init__.py +56 -0
  2173. esphome/components/rc522/binary_sensor.py +48 -0
  2174. esphome/components/rc522/rc522.cpp +505 -0
  2175. esphome/components/rc522/rc522.h +280 -0
  2176. esphome/components/rc522_i2c/__init__.py +26 -0
  2177. esphome/components/rc522_i2c/rc522_i2c.cpp +70 -0
  2178. esphome/components/rc522_i2c/rc522_i2c.h +42 -0
  2179. esphome/components/rc522_spi/__init__.py +30 -0
  2180. esphome/components/rc522_spi/binary_sensor.py +9 -0
  2181. esphome/components/rc522_spi/rc522_spi.cpp +140 -0
  2182. esphome/components/rc522_spi/rc522_spi.h +54 -0
  2183. esphome/components/rdm6300/__init__.py +41 -0
  2184. esphome/components/rdm6300/binary_sensor.py +27 -0
  2185. esphome/components/rdm6300/rdm6300.cpp +68 -0
  2186. esphome/components/rdm6300/rdm6300.h +58 -0
  2187. esphome/components/remote_base/__init__.py +1965 -0
  2188. esphome/components/remote_base/abbwelcome_protocol.cpp +123 -0
  2189. esphome/components/remote_base/abbwelcome_protocol.h +253 -0
  2190. esphome/components/remote_base/aeha_protocol.cpp +102 -0
  2191. esphome/components/remote_base/aeha_protocol.h +46 -0
  2192. esphome/components/remote_base/byronsx_protocol.cpp +139 -0
  2193. esphome/components/remote_base/byronsx_protocol.h +46 -0
  2194. esphome/components/remote_base/canalsat_protocol.cpp +108 -0
  2195. esphome/components/remote_base/canalsat_protocol.h +78 -0
  2196. esphome/components/remote_base/coolix_protocol.cpp +113 -0
  2197. esphome/components/remote_base/coolix_protocol.h +41 -0
  2198. esphome/components/remote_base/dish_protocol.cpp +94 -0
  2199. esphome/components/remote_base/dish_protocol.h +38 -0
  2200. esphome/components/remote_base/dooya_protocol.cpp +120 -0
  2201. esphome/components/remote_base/dooya_protocol.h +49 -0
  2202. esphome/components/remote_base/drayton_protocol.cpp +240 -0
  2203. esphome/components/remote_base/drayton_protocol.h +46 -0
  2204. esphome/components/remote_base/haier_protocol.cpp +84 -0
  2205. esphome/components/remote_base/haier_protocol.h +39 -0
  2206. esphome/components/remote_base/jvc_protocol.cpp +52 -0
  2207. esphome/components/remote_base/jvc_protocol.h +37 -0
  2208. esphome/components/remote_base/keeloq_protocol.cpp +194 -0
  2209. esphome/components/remote_base/keeloq_protocol.h +53 -0
  2210. esphome/components/remote_base/lg_protocol.cpp +58 -0
  2211. esphome/components/remote_base/lg_protocol.h +41 -0
  2212. esphome/components/remote_base/magiquest_protocol.cpp +83 -0
  2213. esphome/components/remote_base/magiquest_protocol.h +52 -0
  2214. esphome/components/remote_base/midea_protocol.cpp +76 -0
  2215. esphome/components/remote_base/midea_protocol.h +83 -0
  2216. esphome/components/remote_base/mirage_protocol.cpp +84 -0
  2217. esphome/components/remote_base/mirage_protocol.h +39 -0
  2218. esphome/components/remote_base/nec_protocol.cpp +102 -0
  2219. esphome/components/remote_base/nec_protocol.h +41 -0
  2220. esphome/components/remote_base/nexa_protocol.cpp +240 -0
  2221. esphome/components/remote_base/nexa_protocol.h +54 -0
  2222. esphome/components/remote_base/panasonic_protocol.cpp +74 -0
  2223. esphome/components/remote_base/panasonic_protocol.h +41 -0
  2224. esphome/components/remote_base/pioneer_protocol.cpp +156 -0
  2225. esphome/components/remote_base/pioneer_protocol.h +38 -0
  2226. esphome/components/remote_base/pronto_protocol.cpp +243 -0
  2227. esphome/components/remote_base/pronto_protocol.h +55 -0
  2228. esphome/components/remote_base/raw_protocol.cpp +47 -0
  2229. esphome/components/remote_base/raw_protocol.h +81 -0
  2230. esphome/components/remote_base/rc5_protocol.cpp +90 -0
  2231. esphome/components/remote_base/rc5_protocol.h +39 -0
  2232. esphome/components/remote_base/rc6_protocol.cpp +181 -0
  2233. esphome/components/remote_base/rc6_protocol.h +46 -0
  2234. esphome/components/remote_base/rc_switch_protocol.cpp +271 -0
  2235. esphome/components/remote_base/rc_switch_protocol.h +221 -0
  2236. esphome/components/remote_base/remote_base.cpp +168 -0
  2237. esphome/components/remote_base/remote_base.h +313 -0
  2238. esphome/components/remote_base/roomba_protocol.cpp +56 -0
  2239. esphome/components/remote_base/roomba_protocol.h +35 -0
  2240. esphome/components/remote_base/samsung36_protocol.cpp +103 -0
  2241. esphome/components/remote_base/samsung36_protocol.h +41 -0
  2242. esphome/components/remote_base/samsung_protocol.cpp +65 -0
  2243. esphome/components/remote_base/samsung_protocol.h +39 -0
  2244. esphome/components/remote_base/sony_protocol.cpp +69 -0
  2245. esphome/components/remote_base/sony_protocol.h +41 -0
  2246. esphome/components/remote_base/toshiba_ac_protocol.cpp +115 -0
  2247. esphome/components/remote_base/toshiba_ac_protocol.h +39 -0
  2248. esphome/components/remote_receiver/__init__.py +143 -0
  2249. esphome/components/remote_receiver/binary_sensor.py +10 -0
  2250. esphome/components/remote_receiver/remote_receiver.h +75 -0
  2251. esphome/components/remote_receiver/remote_receiver_esp32.cpp +170 -0
  2252. esphome/components/remote_receiver/remote_receiver_esp8266.cpp +123 -0
  2253. esphome/components/remote_receiver/remote_receiver_libretiny.cpp +123 -0
  2254. esphome/components/remote_transmitter/__init__.py +50 -0
  2255. esphome/components/remote_transmitter/remote_transmitter.cpp +11 -0
  2256. esphome/components/remote_transmitter/remote_transmitter.h +69 -0
  2257. esphome/components/remote_transmitter/remote_transmitter_esp32.cpp +145 -0
  2258. esphome/components/remote_transmitter/remote_transmitter_esp8266.cpp +103 -0
  2259. esphome/components/remote_transmitter/remote_transmitter_libretiny.cpp +106 -0
  2260. esphome/components/resistance/__init__.py +0 -0
  2261. esphome/components/resistance/resistance_sensor.cpp +44 -0
  2262. esphome/components/resistance/resistance_sensor.h +39 -0
  2263. esphome/components/resistance/sensor.py +59 -0
  2264. esphome/components/resistance_sampler/__init__.py +6 -0
  2265. esphome/components/resistance_sampler/resistance_sampler.h +10 -0
  2266. esphome/components/restart/__init__.py +1 -0
  2267. esphome/components/restart/button/__init__.py +25 -0
  2268. esphome/components/restart/button/restart_button.cpp +20 -0
  2269. esphome/components/restart/button/restart_button.h +18 -0
  2270. esphome/components/restart/switch/__init__.py +22 -0
  2271. esphome/components/restart/switch/restart_switch.cpp +25 -0
  2272. esphome/components/restart/switch/restart_switch.h +18 -0
  2273. esphome/components/rf_bridge/__init__.py +242 -0
  2274. esphome/components/rf_bridge/rf_bridge.cpp +235 -0
  2275. esphome/components/rf_bridge/rf_bridge.h +196 -0
  2276. esphome/components/rgb/__init__.py +0 -0
  2277. esphome/components/rgb/light.py +28 -0
  2278. esphome/components/rgb/rgb_light_output.h +36 -0
  2279. esphome/components/rgbct/__init__.py +0 -0
  2280. esphome/components/rgbct/light.py +59 -0
  2281. esphome/components/rgbct/rgbct_light_output.h +59 -0
  2282. esphome/components/rgbw/__init__.py +0 -0
  2283. esphome/components/rgbw/light.py +40 -0
  2284. esphome/components/rgbw/rgbw_light_output.h +44 -0
  2285. esphome/components/rgbww/__init__.py +0 -0
  2286. esphome/components/rgbww/light.py +69 -0
  2287. esphome/components/rgbww/rgbww_light_output.h +55 -0
  2288. esphome/components/rotary_encoder/__init__.py +0 -0
  2289. esphome/components/rotary_encoder/rotary_encoder.cpp +245 -0
  2290. esphome/components/rotary_encoder/rotary_encoder.h +138 -0
  2291. esphome/components/rotary_encoder/sensor.py +148 -0
  2292. esphome/components/rp2040/__init__.py +243 -0
  2293. esphome/components/rp2040/boards.py +28 -0
  2294. esphome/components/rp2040/build_pio.py.script +47 -0
  2295. esphome/components/rp2040/const.py +7 -0
  2296. esphome/components/rp2040/core.cpp +33 -0
  2297. esphome/components/rp2040/core.h +14 -0
  2298. esphome/components/rp2040/gpio.cpp +103 -0
  2299. esphome/components/rp2040/gpio.h +38 -0
  2300. esphome/components/rp2040/gpio.py +99 -0
  2301. esphome/components/rp2040/post_build.py.script +23 -0
  2302. esphome/components/rp2040/preferences.cpp +160 -0
  2303. esphome/components/rp2040/preferences.h +14 -0
  2304. esphome/components/rp2040_pio/__init__.py +40 -0
  2305. esphome/components/rp2040_pio_led_strip/__init__.py +1 -0
  2306. esphome/components/rp2040_pio_led_strip/led_strip.cpp +215 -0
  2307. esphome/components/rp2040_pio_led_strip/led_strip.h +133 -0
  2308. esphome/components/rp2040_pio_led_strip/light.py +283 -0
  2309. esphome/components/rp2040_pwm/__init__.py +0 -0
  2310. esphome/components/rp2040_pwm/output.py +55 -0
  2311. esphome/components/rp2040_pwm/rp2040_pwm.cpp +68 -0
  2312. esphome/components/rp2040_pwm/rp2040_pwm.h +59 -0
  2313. esphome/components/rpi_dpi_rgb/__init__.py +1 -0
  2314. esphome/components/rpi_dpi_rgb/display.py +200 -0
  2315. esphome/components/rpi_dpi_rgb/rpi_dpi_rgb.cpp +166 -0
  2316. esphome/components/rpi_dpi_rgb/rpi_dpi_rgb.h +97 -0
  2317. esphome/components/rtl87xx/__init__.py +51 -0
  2318. esphome/components/rtl87xx/boards.py +1404 -0
  2319. esphome/components/rtttl/__init__.py +156 -0
  2320. esphome/components/rtttl/rtttl.cpp +395 -0
  2321. esphome/components/rtttl/rtttl.h +124 -0
  2322. esphome/components/ruuvi_ble/__init__.py +22 -0
  2323. esphome/components/ruuvi_ble/ruuvi_ble.cpp +144 -0
  2324. esphome/components/ruuvi_ble/ruuvi_ble.h +37 -0
  2325. esphome/components/ruuvitag/__init__.py +0 -0
  2326. esphome/components/ruuvitag/ruuvitag.cpp +29 -0
  2327. esphome/components/ruuvitag/ruuvitag.h +84 -0
  2328. esphome/components/ruuvitag/sensor.py +163 -0
  2329. esphome/components/safe_mode/__init__.py +75 -0
  2330. esphome/components/safe_mode/automation.h +17 -0
  2331. esphome/components/safe_mode/button/__init__.py +33 -0
  2332. esphome/components/safe_mode/button/safe_mode_button.cpp +27 -0
  2333. esphome/components/safe_mode/button/safe_mode_button.h +21 -0
  2334. esphome/components/safe_mode/safe_mode.cpp +131 -0
  2335. esphome/components/safe_mode/safe_mode.h +50 -0
  2336. esphome/components/safe_mode/switch/__init__.py +32 -0
  2337. esphome/components/safe_mode/switch/safe_mode_switch.cpp +32 -0
  2338. esphome/components/safe_mode/switch/safe_mode_switch.h +21 -0
  2339. esphome/components/scd30/__init__.py +0 -0
  2340. esphome/components/scd30/automation.h +23 -0
  2341. esphome/components/scd30/scd30.cpp +233 -0
  2342. esphome/components/scd30/scd30.h +53 -0
  2343. esphome/components/scd30/sensor.py +142 -0
  2344. esphome/components/scd4x/__init__.py +0 -0
  2345. esphome/components/scd4x/automation.h +28 -0
  2346. esphome/components/scd4x/scd4x.cpp +317 -0
  2347. esphome/components/scd4x/scd4x.h +61 -0
  2348. esphome/components/scd4x/sensor.py +171 -0
  2349. esphome/components/script/__init__.py +226 -0
  2350. esphome/components/script/script.cpp +14 -0
  2351. esphome/components/script/script.h +253 -0
  2352. esphome/components/sdl/__init__.py +1 -0
  2353. esphome/components/sdl/display.py +72 -0
  2354. esphome/components/sdl/sdl_esphome.cpp +113 -0
  2355. esphome/components/sdl/sdl_esphome.h +55 -0
  2356. esphome/components/sdl/touchscreen/__init__.py +22 -0
  2357. esphome/components/sdl/touchscreen/sdl_touchscreen.h +26 -0
  2358. esphome/components/sdm_meter/__init__.py +0 -0
  2359. esphome/components/sdm_meter/sdm_meter.cpp +111 -0
  2360. esphome/components/sdm_meter/sdm_meter.h +83 -0
  2361. esphome/components/sdm_meter/sdm_meter_registers.h +114 -0
  2362. esphome/components/sdm_meter/sensor.py +174 -0
  2363. esphome/components/sdp3x/__init__.py +0 -0
  2364. esphome/components/sdp3x/sdp3x.cpp +122 -0
  2365. esphome/components/sdp3x/sdp3x.h +30 -0
  2366. esphome/components/sdp3x/sensor.py +52 -0
  2367. esphome/components/sds011/__init__.py +0 -0
  2368. esphome/components/sds011/sds011.cpp +190 -0
  2369. esphome/components/sds011/sds011.h +49 -0
  2370. esphome/components/sds011/sensor.py +81 -0
  2371. esphome/components/seeed_mr24hpc1/__init__.py +51 -0
  2372. esphome/components/seeed_mr24hpc1/binary_sensor.py +23 -0
  2373. esphome/components/seeed_mr24hpc1/button/__init__.py +42 -0
  2374. esphome/components/seeed_mr24hpc1/button/custom_mode_end_button.cpp +9 -0
  2375. esphome/components/seeed_mr24hpc1/button/custom_mode_end_button.h +18 -0
  2376. esphome/components/seeed_mr24hpc1/button/restart_button.cpp +9 -0
  2377. esphome/components/seeed_mr24hpc1/button/restart_button.h +18 -0
  2378. esphome/components/seeed_mr24hpc1/number/__init__.py +132 -0
  2379. esphome/components/seeed_mr24hpc1/number/custom_mode_number.cpp +12 -0
  2380. esphome/components/seeed_mr24hpc1/number/custom_mode_number.h +18 -0
  2381. esphome/components/seeed_mr24hpc1/number/custom_unman_time_number.cpp +9 -0
  2382. esphome/components/seeed_mr24hpc1/number/custom_unman_time_number.h +18 -0
  2383. esphome/components/seeed_mr24hpc1/number/existence_threshold_number.cpp +9 -0
  2384. esphome/components/seeed_mr24hpc1/number/existence_threshold_number.h +18 -0
  2385. esphome/components/seeed_mr24hpc1/number/motion_threshold_number.cpp +9 -0
  2386. esphome/components/seeed_mr24hpc1/number/motion_threshold_number.h +18 -0
  2387. esphome/components/seeed_mr24hpc1/number/motion_trigger_time_number.cpp +9 -0
  2388. esphome/components/seeed_mr24hpc1/number/motion_trigger_time_number.h +18 -0
  2389. esphome/components/seeed_mr24hpc1/number/motiontorest_time_number.cpp +9 -0
  2390. esphome/components/seeed_mr24hpc1/number/motiontorest_time_number.h +18 -0
  2391. esphome/components/seeed_mr24hpc1/number/sensitivity_number.cpp +9 -0
  2392. esphome/components/seeed_mr24hpc1/number/sensitivity_number.h +18 -0
  2393. esphome/components/seeed_mr24hpc1/seeed_mr24hpc1.cpp +890 -0
  2394. esphome/components/seeed_mr24hpc1/seeed_mr24hpc1.h +217 -0
  2395. esphome/components/seeed_mr24hpc1/seeed_mr24hpc1_constants.h +173 -0
  2396. esphome/components/seeed_mr24hpc1/select/__init__.py +103 -0
  2397. esphome/components/seeed_mr24hpc1/select/existence_boundary_select.cpp +15 -0
  2398. esphome/components/seeed_mr24hpc1/select/existence_boundary_select.h +18 -0
  2399. esphome/components/seeed_mr24hpc1/select/motion_boundary_select.cpp +15 -0
  2400. esphome/components/seeed_mr24hpc1/select/motion_boundary_select.h +18 -0
  2401. esphome/components/seeed_mr24hpc1/select/scene_mode_select.cpp +15 -0
  2402. esphome/components/seeed_mr24hpc1/select/scene_mode_select.h +18 -0
  2403. esphome/components/seeed_mr24hpc1/select/unman_time_select.cpp +15 -0
  2404. esphome/components/seeed_mr24hpc1/select/unman_time_select.h +18 -0
  2405. esphome/components/seeed_mr24hpc1/sensor.py +82 -0
  2406. esphome/components/seeed_mr24hpc1/switch/__init__.py +32 -0
  2407. esphome/components/seeed_mr24hpc1/switch/underlyFuc_switch.cpp +12 -0
  2408. esphome/components/seeed_mr24hpc1/switch/underlyFuc_switch.h +18 -0
  2409. esphome/components/seeed_mr24hpc1/text_sensor.py +74 -0
  2410. esphome/components/seeed_mr60bha2/__init__.py +41 -0
  2411. esphome/components/seeed_mr60bha2/seeed_mr60bha2.cpp +173 -0
  2412. esphome/components/seeed_mr60bha2/seeed_mr60bha2.h +61 -0
  2413. esphome/components/seeed_mr60bha2/sensor.py +57 -0
  2414. esphome/components/seeed_mr60fda2/__init__.py +41 -0
  2415. esphome/components/seeed_mr60fda2/binary_sensor.py +33 -0
  2416. esphome/components/seeed_mr60fda2/button/__init__.py +45 -0
  2417. esphome/components/seeed_mr60fda2/button/get_radar_parameters_button.cpp +9 -0
  2418. esphome/components/seeed_mr60fda2/button/get_radar_parameters_button.h +18 -0
  2419. esphome/components/seeed_mr60fda2/button/reset_radar_button.cpp +9 -0
  2420. esphome/components/seeed_mr60fda2/button/reset_radar_button.h +18 -0
  2421. esphome/components/seeed_mr60fda2/seeed_mr60fda2.cpp +368 -0
  2422. esphome/components/seeed_mr60fda2/seeed_mr60fda2.h +101 -0
  2423. esphome/components/seeed_mr60fda2/select/__init__.py +59 -0
  2424. esphome/components/seeed_mr60fda2/select/height_threshold_select.cpp +15 -0
  2425. esphome/components/seeed_mr60fda2/select/height_threshold_select.h +18 -0
  2426. esphome/components/seeed_mr60fda2/select/install_height_select.cpp +15 -0
  2427. esphome/components/seeed_mr60fda2/select/install_height_select.h +18 -0
  2428. esphome/components/seeed_mr60fda2/select/sensitivity_select.cpp +15 -0
  2429. esphome/components/seeed_mr60fda2/select/sensitivity_select.h +18 -0
  2430. esphome/components/selec_meter/__init__.py +0 -0
  2431. esphome/components/selec_meter/selec_meter.cpp +108 -0
  2432. esphome/components/selec_meter/selec_meter.h +47 -0
  2433. esphome/components/selec_meter/selec_meter_registers.h +32 -0
  2434. esphome/components/selec_meter/sensor.py +165 -0
  2435. esphome/components/select/__init__.py +244 -0
  2436. esphome/components/select/automation.h +67 -0
  2437. esphome/components/select/select.cpp +62 -0
  2438. esphome/components/select/select.h +80 -0
  2439. esphome/components/select/select_call.cpp +120 -0
  2440. esphome/components/select/select_call.h +47 -0
  2441. esphome/components/select/select_traits.cpp +11 -0
  2442. esphome/components/select/select_traits.h +19 -0
  2443. esphome/components/sen0321/__init__.py +1 -0
  2444. esphome/components/sen0321/sen0321.cpp +36 -0
  2445. esphome/components/sen0321/sen0321.h +35 -0
  2446. esphome/components/sen0321/sensor.py +34 -0
  2447. esphome/components/sen21231/__init__.py +0 -0
  2448. esphome/components/sen21231/sen21231.cpp +32 -0
  2449. esphome/components/sen21231/sen21231.h +77 -0
  2450. esphome/components/sen21231/sensor.py +24 -0
  2451. esphome/components/sen5x/__init__.py +0 -0
  2452. esphome/components/sen5x/automation.h +21 -0
  2453. esphome/components/sen5x/sen5x.cpp +424 -0
  2454. esphome/components/sen5x/sen5x.h +134 -0
  2455. esphome/components/sen5x/sensor.py +250 -0
  2456. esphome/components/senseair/__init__.py +0 -0
  2457. esphome/components/senseair/senseair.cpp +150 -0
  2458. esphome/components/senseair/senseair.h +82 -0
  2459. esphome/components/senseair/sensor.py +93 -0
  2460. esphome/components/sensirion_common/__init__.py +10 -0
  2461. esphome/components/sensirion_common/i2c_sensirion.cpp +128 -0
  2462. esphome/components/sensirion_common/i2c_sensirion.h +157 -0
  2463. esphome/components/sensor/__init__.py +959 -0
  2464. esphome/components/sensor/automation.cpp +10 -0
  2465. esphome/components/sensor/automation.h +111 -0
  2466. esphome/components/sensor/filter.cpp +485 -0
  2467. esphome/components/sensor/filter.h +443 -0
  2468. esphome/components/sensor/sensor.cpp +100 -0
  2469. esphome/components/sensor/sensor.h +163 -0
  2470. esphome/components/servo/__init__.py +85 -0
  2471. esphome/components/servo/servo.cpp +107 -0
  2472. esphome/components/servo/servo.h +78 -0
  2473. esphome/components/sfa30/__init__.py +1 -0
  2474. esphome/components/sfa30/sensor.py +78 -0
  2475. esphome/components/sfa30/sfa30.cpp +99 -0
  2476. esphome/components/sfa30/sfa30.h +34 -0
  2477. esphome/components/sgp30/__init__.py +0 -0
  2478. esphome/components/sgp30/sensor.py +118 -0
  2479. esphome/components/sgp30/sgp30.cpp +305 -0
  2480. esphome/components/sgp30/sgp30.h +71 -0
  2481. esphome/components/sgp40/__init__.py +0 -0
  2482. esphome/components/sgp40/sensor.py +8 -0
  2483. esphome/components/sgp4x/__init__.py +0 -0
  2484. esphome/components/sgp4x/sensor.py +145 -0
  2485. esphome/components/sgp4x/sgp4x.cpp +310 -0
  2486. esphome/components/sgp4x/sgp4x.h +145 -0
  2487. esphome/components/shelly_dimmer/__init__.py +1 -0
  2488. esphome/components/shelly_dimmer/dev_table.h +159 -0
  2489. esphome/components/shelly_dimmer/light.py +221 -0
  2490. esphome/components/shelly_dimmer/shelly_dimmer.cpp +527 -0
  2491. esphome/components/shelly_dimmer/shelly_dimmer.h +123 -0
  2492. esphome/components/shelly_dimmer/stm32flash.cpp +1066 -0
  2493. esphome/components/shelly_dimmer/stm32flash.h +131 -0
  2494. esphome/components/sht3xd/__init__.py +0 -0
  2495. esphome/components/sht3xd/sensor.py +64 -0
  2496. esphome/components/sht3xd/sht3xd.cpp +107 -0
  2497. esphome/components/sht3xd/sht3xd.h +39 -0
  2498. esphome/components/sht4x/__init__.py +0 -0
  2499. esphome/components/sht4x/sensor.py +103 -0
  2500. esphome/components/sht4x/sht4x.cpp +86 -0
  2501. esphome/components/sht4x/sht4x.h +47 -0
  2502. esphome/components/shtcx/__init__.py +0 -0
  2503. esphome/components/shtcx/sensor.py +59 -0
  2504. esphome/components/shtcx/shtcx.cpp +125 -0
  2505. esphome/components/shtcx/shtcx.h +34 -0
  2506. esphome/components/shutdown/__init__.py +1 -0
  2507. esphome/components/shutdown/button/__init__.py +21 -0
  2508. esphome/components/shutdown/button/shutdown_button.cpp +33 -0
  2509. esphome/components/shutdown/button/shutdown_button.h +18 -0
  2510. esphome/components/shutdown/switch/__init__.py +22 -0
  2511. esphome/components/shutdown/switch/shutdown_switch.cpp +38 -0
  2512. esphome/components/shutdown/switch/shutdown_switch.h +18 -0
  2513. esphome/components/sigma_delta_output/__init__.py +1 -0
  2514. esphome/components/sigma_delta_output/output.py +66 -0
  2515. esphome/components/sigma_delta_output/sigma_delta_output.cpp +57 -0
  2516. esphome/components/sigma_delta_output/sigma_delta_output.h +47 -0
  2517. esphome/components/sim800l/__init__.py +209 -0
  2518. esphome/components/sim800l/binary_sensor.py +28 -0
  2519. esphome/components/sim800l/sensor.py +33 -0
  2520. esphome/components/sim800l/sim800l.cpp +489 -0
  2521. esphome/components/sim800l/sim800l.h +223 -0
  2522. esphome/components/slow_pwm/__init__.py +0 -0
  2523. esphome/components/slow_pwm/output.py +72 -0
  2524. esphome/components/slow_pwm/slow_pwm_output.cpp +77 -0
  2525. esphome/components/slow_pwm/slow_pwm_output.h +61 -0
  2526. esphome/components/sm10bit_base/__init__.py +44 -0
  2527. esphome/components/sm10bit_base/sm10bit_base.cpp +131 -0
  2528. esphome/components/sm10bit_base/sm10bit_base.h +63 -0
  2529. esphome/components/sm16716/__init__.py +38 -0
  2530. esphome/components/sm16716/output.py +27 -0
  2531. esphome/components/sm16716/sm16716.cpp +52 -0
  2532. esphome/components/sm16716/sm16716.h +72 -0
  2533. esphome/components/sm2135/__init__.py +71 -0
  2534. esphome/components/sm2135/output.py +28 -0
  2535. esphome/components/sm2135/sm2135.cpp +152 -0
  2536. esphome/components/sm2135/sm2135.h +90 -0
  2537. esphome/components/sm2235/__init__.py +22 -0
  2538. esphome/components/sm2235/output.py +28 -0
  2539. esphome/components/sm2235/sm2235.cpp +27 -0
  2540. esphome/components/sm2235/sm2235.h +19 -0
  2541. esphome/components/sm2335/__init__.py +22 -0
  2542. esphome/components/sm2335/output.py +28 -0
  2543. esphome/components/sm2335/sm2335.cpp +27 -0
  2544. esphome/components/sm2335/sm2335.h +19 -0
  2545. esphome/components/sm300d2/__init__.py +0 -0
  2546. esphome/components/sm300d2/sensor.py +117 -0
  2547. esphome/components/sm300d2/sm300d2.cpp +108 -0
  2548. esphome/components/sm300d2/sm300d2.h +38 -0
  2549. esphome/components/sml/__init__.py +68 -0
  2550. esphome/components/sml/automation.h +19 -0
  2551. esphome/components/sml/constants.h +27 -0
  2552. esphome/components/sml/sensor/__init__.py +30 -0
  2553. esphome/components/sml/sensor/sml_sensor.cpp +41 -0
  2554. esphome/components/sml/sensor/sml_sensor.h +16 -0
  2555. esphome/components/sml/sml.cpp +146 -0
  2556. esphome/components/sml/sml.h +48 -0
  2557. esphome/components/sml/sml_parser.cpp +155 -0
  2558. esphome/components/sml/sml_parser.h +54 -0
  2559. esphome/components/sml/text_sensor/__init__.py +43 -0
  2560. esphome/components/sml/text_sensor/sml_text_sensor.cpp +54 -0
  2561. esphome/components/sml/text_sensor/sml_text_sensor.h +21 -0
  2562. esphome/components/smt100/__init__.py +1 -0
  2563. esphome/components/smt100/sensor.py +94 -0
  2564. esphome/components/smt100/smt100.cpp +84 -0
  2565. esphome/components/smt100/smt100.h +43 -0
  2566. esphome/components/sn74hc165/__init__.py +95 -0
  2567. esphome/components/sn74hc165/sn74hc165.cpp +72 -0
  2568. esphome/components/sn74hc165/sn74hc165.h +61 -0
  2569. esphome/components/sn74hc595/__init__.py +121 -0
  2570. esphome/components/sn74hc595/sn74hc595.cpp +100 -0
  2571. esphome/components/sn74hc595/sn74hc595.h +94 -0
  2572. esphome/components/sntp/__init__.py +0 -0
  2573. esphome/components/sntp/sntp_component.cpp +73 -0
  2574. esphome/components/sntp/sntp_component.h +35 -0
  2575. esphome/components/sntp/time.py +51 -0
  2576. esphome/components/socket/__init__.py +39 -0
  2577. esphome/components/socket/bsd_sockets_impl.cpp +143 -0
  2578. esphome/components/socket/headers.h +185 -0
  2579. esphome/components/socket/lwip_raw_tcp_impl.cpp +612 -0
  2580. esphome/components/socket/lwip_sockets_impl.cpp +115 -0
  2581. esphome/components/socket/socket.cpp +78 -0
  2582. esphome/components/socket/socket.h +61 -0
  2583. esphome/components/sonoff_d1/__init__.py +1 -0
  2584. esphome/components/sonoff_d1/light.py +43 -0
  2585. esphome/components/sonoff_d1/sonoff_d1.cpp +309 -0
  2586. esphome/components/sonoff_d1/sonoff_d1.h +85 -0
  2587. esphome/components/speaker/__init__.py +143 -0
  2588. esphome/components/speaker/automation.h +83 -0
  2589. esphome/components/speaker/speaker.h +110 -0
  2590. esphome/components/speed/__init__.py +3 -0
  2591. esphome/components/speed/fan/__init__.py +51 -0
  2592. esphome/components/speed/fan/speed_fan.cpp +48 -0
  2593. esphome/components/speed/fan/speed_fan.h +37 -0
  2594. esphome/components/spi/__init__.py +408 -0
  2595. esphome/components/spi/spi.cpp +118 -0
  2596. esphome/components/spi/spi.h +477 -0
  2597. esphome/components/spi/spi_arduino.cpp +95 -0
  2598. esphome/components/spi/spi_esp_idf.cpp +244 -0
  2599. esphome/components/spi_device/__init__.py +36 -0
  2600. esphome/components/spi_device/spi_device.cpp +31 -0
  2601. esphome/components/spi_device/spi_device.h +22 -0
  2602. esphome/components/spi_led_strip/__init__.py +2 -0
  2603. esphome/components/spi_led_strip/light.py +25 -0
  2604. esphome/components/spi_led_strip/spi_led_strip.h +92 -0
  2605. esphome/components/sprinkler/__init__.py +837 -0
  2606. esphome/components/sprinkler/automation.h +185 -0
  2607. esphome/components/sprinkler/sprinkler.cpp +1735 -0
  2608. esphome/components/sprinkler/sprinkler.h +611 -0
  2609. esphome/components/sps30/__init__.py +0 -0
  2610. esphome/components/sps30/automation.h +21 -0
  2611. esphome/components/sps30/sensor.py +180 -0
  2612. esphome/components/sps30/sps30.cpp +238 -0
  2613. esphome/components/sps30/sps30.h +63 -0
  2614. esphome/components/ssd1306_base/__init__.py +103 -0
  2615. esphome/components/ssd1306_base/ssd1306_base.cpp +382 -0
  2616. esphome/components/ssd1306_base/ssd1306_base.h +88 -0
  2617. esphome/components/ssd1306_i2c/__init__.py +0 -0
  2618. esphome/components/ssd1306_i2c/display.py +29 -0
  2619. esphome/components/ssd1306_i2c/ssd1306_i2c.cpp +78 -0
  2620. esphome/components/ssd1306_i2c/ssd1306_i2c.h +23 -0
  2621. esphome/components/ssd1306_spi/__init__.py +0 -0
  2622. esphome/components/ssd1306_spi/display.py +38 -0
  2623. esphome/components/ssd1306_spi/ssd1306_spi.cpp +65 -0
  2624. esphome/components/ssd1306_spi/ssd1306_spi.h +29 -0
  2625. esphome/components/ssd1322_base/__init__.py +50 -0
  2626. esphome/components/ssd1322_base/ssd1322_base.cpp +204 -0
  2627. esphome/components/ssd1322_base/ssd1322_base.h +55 -0
  2628. esphome/components/ssd1322_spi/__init__.py +0 -0
  2629. esphome/components/ssd1322_spi/display.py +38 -0
  2630. esphome/components/ssd1322_spi/ssd1322_spi.cpp +71 -0
  2631. esphome/components/ssd1322_spi/ssd1322_spi.h +30 -0
  2632. esphome/components/ssd1325_base/__init__.py +54 -0
  2633. esphome/components/ssd1325_base/ssd1325_base.cpp +245 -0
  2634. esphome/components/ssd1325_base/ssd1325_base.h +60 -0
  2635. esphome/components/ssd1325_spi/__init__.py +0 -0
  2636. esphome/components/ssd1325_spi/display.py +38 -0
  2637. esphome/components/ssd1325_spi/ssd1325_spi.cpp +59 -0
  2638. esphome/components/ssd1325_spi/ssd1325_spi.h +29 -0
  2639. esphome/components/ssd1327_base/__init__.py +41 -0
  2640. esphome/components/ssd1327_base/ssd1327_base.cpp +180 -0
  2641. esphome/components/ssd1327_base/ssd1327_base.h +54 -0
  2642. esphome/components/ssd1327_i2c/__init__.py +0 -0
  2643. esphome/components/ssd1327_i2c/display.py +29 -0
  2644. esphome/components/ssd1327_i2c/ssd1327_i2c.cpp +44 -0
  2645. esphome/components/ssd1327_i2c/ssd1327_i2c.h +23 -0
  2646. esphome/components/ssd1327_spi/__init__.py +0 -0
  2647. esphome/components/ssd1327_spi/display.py +38 -0
  2648. esphome/components/ssd1327_spi/ssd1327_spi.cpp +58 -0
  2649. esphome/components/ssd1327_spi/ssd1327_spi.h +29 -0
  2650. esphome/components/ssd1331_base/__init__.py +32 -0
  2651. esphome/components/ssd1331_base/ssd1331_base.cpp +154 -0
  2652. esphome/components/ssd1331_base/ssd1331_base.h +47 -0
  2653. esphome/components/ssd1331_spi/__init__.py +0 -0
  2654. esphome/components/ssd1331_spi/display.py +38 -0
  2655. esphome/components/ssd1331_spi/ssd1331_spi.cpp +57 -0
  2656. esphome/components/ssd1331_spi/ssd1331_spi.h +29 -0
  2657. esphome/components/ssd1351_base/__init__.py +42 -0
  2658. esphome/components/ssd1351_base/ssd1351_base.cpp +196 -0
  2659. esphome/components/ssd1351_base/ssd1351_base.h +56 -0
  2660. esphome/components/ssd1351_spi/__init__.py +0 -0
  2661. esphome/components/ssd1351_spi/display.py +38 -0
  2662. esphome/components/ssd1351_spi/ssd1351_spi.cpp +71 -0
  2663. esphome/components/ssd1351_spi/ssd1351_spi.h +30 -0
  2664. esphome/components/st7567_base/__init__.py +55 -0
  2665. esphome/components/st7567_base/st7567_base.cpp +152 -0
  2666. esphome/components/st7567_base/st7567_base.h +100 -0
  2667. esphome/components/st7567_i2c/__init__.py +1 -0
  2668. esphome/components/st7567_i2c/display.py +29 -0
  2669. esphome/components/st7567_i2c/st7567_i2c.cpp +60 -0
  2670. esphome/components/st7567_i2c/st7567_i2c.h +23 -0
  2671. esphome/components/st7567_spi/__init__.py +1 -0
  2672. esphome/components/st7567_spi/display.py +38 -0
  2673. esphome/components/st7567_spi/st7567_spi.cpp +66 -0
  2674. esphome/components/st7567_spi/st7567_spi.h +29 -0
  2675. esphome/components/st7701s/__init__.py +1 -0
  2676. esphome/components/st7701s/display.py +255 -0
  2677. esphome/components/st7701s/init_sequences.py +363 -0
  2678. esphome/components/st7701s/st7701s.cpp +198 -0
  2679. esphome/components/st7701s/st7701s.h +118 -0
  2680. esphome/components/st7735/__init__.py +3 -0
  2681. esphome/components/st7735/display.py +105 -0
  2682. esphome/components/st7735/st7735.cpp +490 -0
  2683. esphome/components/st7735/st7735.h +90 -0
  2684. esphome/components/st7789v/__init__.py +3 -0
  2685. esphome/components/st7789v/display.py +209 -0
  2686. esphome/components/st7789v/st7789v.cpp +309 -0
  2687. esphome/components/st7789v/st7789v.h +172 -0
  2688. esphome/components/st7920/__init__.py +0 -0
  2689. esphome/components/st7920/display.py +41 -0
  2690. esphome/components/st7920/st7920.cpp +145 -0
  2691. esphome/components/st7920/st7920.h +51 -0
  2692. esphome/components/statsd/__init__.py +65 -0
  2693. esphome/components/statsd/statsd.cpp +158 -0
  2694. esphome/components/statsd/statsd.h +88 -0
  2695. esphome/components/status/__init__.py +0 -0
  2696. esphome/components/status/binary_sensor.py +25 -0
  2697. esphome/components/status/status_binary_sensor.cpp +37 -0
  2698. esphome/components/status/status_binary_sensor.h +22 -0
  2699. esphome/components/status_led/__init__.py +25 -0
  2700. esphome/components/status_led/light/__init__.py +35 -0
  2701. esphome/components/status_led/light/status_led_light.cpp +77 -0
  2702. esphome/components/status_led/light/status_led_light.h +44 -0
  2703. esphome/components/status_led/status_led.cpp +35 -0
  2704. esphome/components/status_led/status_led.h +26 -0
  2705. esphome/components/stepper/__init__.py +185 -0
  2706. esphome/components/stepper/stepper.cpp +51 -0
  2707. esphome/components/stepper/stepper.h +110 -0
  2708. esphome/components/sts3x/__init__.py +0 -0
  2709. esphome/components/sts3x/sensor.py +35 -0
  2710. esphome/components/sts3x/sts3x.cpp +71 -0
  2711. esphome/components/sts3x/sts3x.h +22 -0
  2712. esphome/components/substitutions/__init__.py +144 -0
  2713. esphome/components/sun/__init__.py +181 -0
  2714. esphome/components/sun/sensor/__init__.py +43 -0
  2715. esphome/components/sun/sensor/sun_sensor.cpp +12 -0
  2716. esphome/components/sun/sensor/sun_sensor.h +41 -0
  2717. esphome/components/sun/sun.cpp +322 -0
  2718. esphome/components/sun/sun.h +133 -0
  2719. esphome/components/sun/text_sensor/__init__.py +58 -0
  2720. esphome/components/sun/text_sensor/sun_text_sensor.cpp +12 -0
  2721. esphome/components/sun/text_sensor/sun_text_sensor.h +44 -0
  2722. esphome/components/sun_gtil2/__init__.py +26 -0
  2723. esphome/components/sun_gtil2/sensor.py +87 -0
  2724. esphome/components/sun_gtil2/sun_gtil2.cpp +135 -0
  2725. esphome/components/sun_gtil2/sun_gtil2.h +58 -0
  2726. esphome/components/sun_gtil2/text_sensor.py +31 -0
  2727. esphome/components/switch/__init__.py +211 -0
  2728. esphome/components/switch/automation.cpp +10 -0
  2729. esphome/components/switch/automation.h +84 -0
  2730. esphome/components/switch/binary_sensor/__init__.py +31 -0
  2731. esphome/components/switch/binary_sensor/switch_binary_sensor.cpp +17 -0
  2732. esphome/components/switch/binary_sensor/switch_binary_sensor.h +22 -0
  2733. esphome/components/switch/switch.cpp +96 -0
  2734. esphome/components/switch/switch.h +136 -0
  2735. esphome/components/sx1509/__init__.py +119 -0
  2736. esphome/components/sx1509/binary_sensor/__init__.py +26 -0
  2737. esphome/components/sx1509/binary_sensor/sx1509_binary_keypad_sensor.h +19 -0
  2738. esphome/components/sx1509/output/__init__.py +28 -0
  2739. esphome/components/sx1509/output/sx1509_float_output.cpp +31 -0
  2740. esphome/components/sx1509/output/sx1509_float_output.h +27 -0
  2741. esphome/components/sx1509/sx1509.cpp +290 -0
  2742. esphome/components/sx1509/sx1509.h +86 -0
  2743. esphome/components/sx1509/sx1509_gpio_pin.cpp +22 -0
  2744. esphome/components/sx1509/sx1509_gpio_pin.h +31 -0
  2745. esphome/components/sx1509/sx1509_registers.h +110 -0
  2746. esphome/components/t6615/__init__.py +0 -0
  2747. esphome/components/t6615/sensor.py +46 -0
  2748. esphome/components/t6615/t6615.cpp +95 -0
  2749. esphome/components/t6615/t6615.h +44 -0
  2750. esphome/components/tc74/__init__.py +1 -0
  2751. esphome/components/tc74/sensor.py +32 -0
  2752. esphome/components/tc74/tc74.cpp +68 -0
  2753. esphome/components/tc74/tc74.h +28 -0
  2754. esphome/components/tca9548a/__init__.py +43 -0
  2755. esphome/components/tca9548a/tca9548a.cpp +57 -0
  2756. esphome/components/tca9548a/tca9548a.h +39 -0
  2757. esphome/components/tca9555/__init__.py +72 -0
  2758. esphome/components/tca9555/tca9555.cpp +140 -0
  2759. esphome/components/tca9555/tca9555.h +64 -0
  2760. esphome/components/tcl112/__init__.py +0 -0
  2761. esphome/components/tcl112/climate.py +21 -0
  2762. esphome/components/tcl112/tcl112.cpp +244 -0
  2763. esphome/components/tcl112/tcl112.h +28 -0
  2764. esphome/components/tcs34725/__init__.py +0 -0
  2765. esphome/components/tcs34725/sensor.py +132 -0
  2766. esphome/components/tcs34725/tcs34725.cpp +354 -0
  2767. esphome/components/tcs34725/tcs34725.h +90 -0
  2768. esphome/components/tee501/__init__.py +0 -0
  2769. esphome/components/tee501/sensor.py +36 -0
  2770. esphome/components/tee501/tee501.cpp +85 -0
  2771. esphome/components/tee501/tee501.h +25 -0
  2772. esphome/components/teleinfo/__init__.py +40 -0
  2773. esphome/components/teleinfo/sensor/__init__.py +28 -0
  2774. esphome/components/teleinfo/sensor/teleinfo_sensor.cpp +14 -0
  2775. esphome/components/teleinfo/sensor/teleinfo_sensor.h +16 -0
  2776. esphome/components/teleinfo/teleinfo.cpp +209 -0
  2777. esphome/components/teleinfo/teleinfo.h +54 -0
  2778. esphome/components/teleinfo/text_sensor/__init__.py +21 -0
  2779. esphome/components/teleinfo/text_sensor/teleinfo_text_sensor.cpp +11 -0
  2780. esphome/components/teleinfo/text_sensor/teleinfo_text_sensor.h +13 -0
  2781. esphome/components/tem3200/__init__.py +0 -0
  2782. esphome/components/tem3200/sensor.py +55 -0
  2783. esphome/components/tem3200/tem3200.cpp +151 -0
  2784. esphome/components/tem3200/tem3200.h +30 -0
  2785. esphome/components/template/__init__.py +3 -0
  2786. esphome/components/template/alarm_control_panel/__init__.py +159 -0
  2787. esphome/components/template/alarm_control_panel/template_alarm_control_panel.cpp +266 -0
  2788. esphome/components/template/alarm_control_panel/template_alarm_control_panel.h +155 -0
  2789. esphome/components/template/binary_sensor/__init__.py +62 -0
  2790. esphome/components/template/binary_sensor/template_binary_sensor.cpp +31 -0
  2791. esphome/components/template/binary_sensor/template_binary_sensor.h +24 -0
  2792. esphome/components/template/button/__init__.py +11 -0
  2793. esphome/components/template/button/template_button.h +15 -0
  2794. esphome/components/template/cover/__init__.py +139 -0
  2795. esphome/components/template/cover/template_cover.cpp +141 -0
  2796. esphome/components/template/cover/template_cover.h +66 -0
  2797. esphome/components/template/datetime/__init__.py +151 -0
  2798. esphome/components/template/datetime/template_date.cpp +111 -0
  2799. esphome/components/template/datetime/template_date.h +46 -0
  2800. esphome/components/template/datetime/template_datetime.cpp +150 -0
  2801. esphome/components/template/datetime/template_datetime.h +46 -0
  2802. esphome/components/template/datetime/template_time.cpp +111 -0
  2803. esphome/components/template/datetime/template_time.h +46 -0
  2804. esphome/components/template/event/__init__.py +24 -0
  2805. esphome/components/template/event/template_event.h +12 -0
  2806. esphome/components/template/fan/__init__.py +43 -0
  2807. esphome/components/template/fan/template_fan.cpp +38 -0
  2808. esphome/components/template/fan/template_fan.h +33 -0
  2809. esphome/components/template/lock/__init__.py +103 -0
  2810. esphome/components/template/lock/template_lock.cpp +59 -0
  2811. esphome/components/template/lock/template_lock.h +38 -0
  2812. esphome/components/template/number/__init__.py +93 -0
  2813. esphome/components/template/number/template_number.cpp +56 -0
  2814. esphome/components/template/number/template_number.h +37 -0
  2815. esphome/components/template/output/__init__.py +47 -0
  2816. esphome/components/template/output/template_output.h +31 -0
  2817. esphome/components/template/select/__init__.py +84 -0
  2818. esphome/components/template/select/template_select.cpp +75 -0
  2819. esphome/components/template/select/template_select.h +37 -0
  2820. esphome/components/template/sensor/__init__.py +56 -0
  2821. esphome/components/template/sensor/template_sensor.cpp +27 -0
  2822. esphome/components/template/sensor/template_sensor.h +24 -0
  2823. esphome/components/template/switch/__init__.py +92 -0
  2824. esphome/components/template/switch/template_switch.cpp +62 -0
  2825. esphome/components/template/switch/template_switch.h +40 -0
  2826. esphome/components/template/text/__init__.py +92 -0
  2827. esphome/components/template/text/template_text.cpp +64 -0
  2828. esphome/components/template/text/template_text.h +87 -0
  2829. esphome/components/template/text_sensor/__init__.py +51 -0
  2830. esphome/components/template/text_sensor/template_text_sensor.cpp +23 -0
  2831. esphome/components/template/text_sensor/template_text_sensor.h +25 -0
  2832. esphome/components/template/valve/__init__.py +118 -0
  2833. esphome/components/template/valve/template_valve.cpp +131 -0
  2834. esphome/components/template/valve/template_valve.h +60 -0
  2835. esphome/components/text/__init__.py +146 -0
  2836. esphome/components/text/automation.h +33 -0
  2837. esphome/components/text/text.cpp +26 -0
  2838. esphome/components/text/text.h +55 -0
  2839. esphome/components/text/text_call.cpp +56 -0
  2840. esphome/components/text/text_call.h +25 -0
  2841. esphome/components/text/text_traits.h +39 -0
  2842. esphome/components/text_sensor/__init__.py +253 -0
  2843. esphome/components/text_sensor/automation.h +50 -0
  2844. esphome/components/text_sensor/filter.cpp +81 -0
  2845. esphome/components/text_sensor/filter.h +124 -0
  2846. esphome/components/text_sensor/text_sensor.cpp +72 -0
  2847. esphome/components/text_sensor/text_sensor.h +84 -0
  2848. esphome/components/thermostat/__init__.py +0 -0
  2849. esphome/components/thermostat/climate.py +951 -0
  2850. esphome/components/thermostat/thermostat_climate.cpp +1404 -0
  2851. esphome/components/thermostat/thermostat_climate.h +475 -0
  2852. esphome/components/time/__init__.py +346 -0
  2853. esphome/components/time/automation.cpp +96 -0
  2854. esphome/components/time/automation.h +52 -0
  2855. esphome/components/time/real_time_clock.cpp +62 -0
  2856. esphome/components/time/real_time_clock.h +64 -0
  2857. esphome/components/time_based/__init__.py +0 -0
  2858. esphome/components/time_based/cover.py +57 -0
  2859. esphome/components/time_based/time_based_cover.cpp +183 -0
  2860. esphome/components/time_based/time_based_cover.h +55 -0
  2861. esphome/components/tlc59208f/__init__.py +26 -0
  2862. esphome/components/tlc59208f/output.py +26 -0
  2863. esphome/components/tlc59208f/tlc59208f_output.cpp +156 -0
  2864. esphome/components/tlc59208f/tlc59208f_output.h +69 -0
  2865. esphome/components/tlc5947/__init__.py +49 -0
  2866. esphome/components/tlc5947/output/__init__.py +27 -0
  2867. esphome/components/tlc5947/output/tlc5947_output.cpp +12 -0
  2868. esphome/components/tlc5947/output/tlc5947_output.h +22 -0
  2869. esphome/components/tlc5947/tlc5947.cpp +73 -0
  2870. esphome/components/tlc5947/tlc5947.h +46 -0
  2871. esphome/components/tlc5971/__init__.py +40 -0
  2872. esphome/components/tlc5971/output/__init__.py +27 -0
  2873. esphome/components/tlc5971/output/tlc5971_output.cpp +12 -0
  2874. esphome/components/tlc5971/output/tlc5971_output.h +22 -0
  2875. esphome/components/tlc5971/tlc5971.cpp +101 -0
  2876. esphome/components/tlc5971/tlc5971.h +43 -0
  2877. esphome/components/tm1621/__init__.py +1 -0
  2878. esphome/components/tm1621/display.py +46 -0
  2879. esphome/components/tm1621/tm1621.cpp +283 -0
  2880. esphome/components/tm1621/tm1621.h +74 -0
  2881. esphome/components/tm1637/__init__.py +0 -0
  2882. esphome/components/tm1637/binary_sensor.py +25 -0
  2883. esphome/components/tm1637/display.py +52 -0
  2884. esphome/components/tm1637/tm1637.cpp +382 -0
  2885. esphome/components/tm1637/tm1637.h +102 -0
  2886. esphome/components/tm1638/__init__.py +0 -0
  2887. esphome/components/tm1638/binary_sensor/__init__.py +22 -0
  2888. esphome/components/tm1638/binary_sensor/tm1638_key.cpp +13 -0
  2889. esphome/components/tm1638/binary_sensor/tm1638_key.h +19 -0
  2890. esphome/components/tm1638/display.py +54 -0
  2891. esphome/components/tm1638/output/__init__.py +26 -0
  2892. esphome/components/tm1638/output/tm1638_output_led.cpp +17 -0
  2893. esphome/components/tm1638/output/tm1638_output_led.h +25 -0
  2894. esphome/components/tm1638/sevenseg.h +107 -0
  2895. esphome/components/tm1638/switch/__init__.py +25 -0
  2896. esphome/components/tm1638/switch/tm1638_switch_led.cpp +20 -0
  2897. esphome/components/tm1638/switch/tm1638_switch_led.h +23 -0
  2898. esphome/components/tm1638/tm1638.cpp +286 -0
  2899. esphome/components/tm1638/tm1638.h +78 -0
  2900. esphome/components/tm1651/__init__.py +139 -0
  2901. esphome/components/tm1651/tm1651.cpp +94 -0
  2902. esphome/components/tm1651/tm1651.h +96 -0
  2903. esphome/components/tmp102/__init__.py +9 -0
  2904. esphome/components/tmp102/sensor.py +44 -0
  2905. esphome/components/tmp102/tmp102.cpp +54 -0
  2906. esphome/components/tmp102/tmp102.h +22 -0
  2907. esphome/components/tmp1075/__init__.py +1 -0
  2908. esphome/components/tmp1075/sensor.py +92 -0
  2909. esphome/components/tmp1075/tmp1075.cpp +129 -0
  2910. esphome/components/tmp1075/tmp1075.h +92 -0
  2911. esphome/components/tmp117/__init__.py +0 -0
  2912. esphome/components/tmp117/sensor.py +80 -0
  2913. esphome/components/tmp117/tmp117.cpp +76 -0
  2914. esphome/components/tmp117/tmp117.h +27 -0
  2915. esphome/components/tof10120/__init__.py +0 -0
  2916. esphome/components/tof10120/sensor.py +34 -0
  2917. esphome/components/tof10120/tof10120_sensor.cpp +60 -0
  2918. esphome/components/tof10120/tof10120_sensor.h +19 -0
  2919. esphome/components/toshiba/__init__.py +0 -0
  2920. esphome/components/toshiba/climate.py +30 -0
  2921. esphome/components/toshiba/toshiba.cpp +768 -0
  2922. esphome/components/toshiba/toshiba.h +64 -0
  2923. esphome/components/total_daily_energy/__init__.py +0 -0
  2924. esphome/components/total_daily_energy/sensor.py +92 -0
  2925. esphome/components/total_daily_energy/total_daily_energy.cpp +75 -0
  2926. esphome/components/total_daily_energy/total_daily_energy.h +46 -0
  2927. esphome/components/touchscreen/__init__.py +158 -0
  2928. esphome/components/touchscreen/binary_sensor/__init__.py +83 -0
  2929. esphome/components/touchscreen/binary_sensor/touchscreen_binary_sensor.cpp +28 -0
  2930. esphome/components/touchscreen/binary_sensor/touchscreen_binary_sensor.h +46 -0
  2931. esphome/components/touchscreen/touchscreen.cpp +165 -0
  2932. esphome/components/touchscreen/touchscreen.h +119 -0
  2933. esphome/components/tsl2561/__init__.py +0 -0
  2934. esphome/components/tsl2561/sensor.py +69 -0
  2935. esphome/components/tsl2561/tsl2561.cpp +164 -0
  2936. esphome/components/tsl2561/tsl2561.h +87 -0
  2937. esphome/components/tsl2591/__init__.py +1 -0
  2938. esphome/components/tsl2591/sensor.py +172 -0
  2939. esphome/components/tsl2591/tsl2591.cpp +482 -0
  2940. esphome/components/tsl2591/tsl2591.h +276 -0
  2941. esphome/components/tt21100/__init__.py +5 -0
  2942. esphome/components/tt21100/binary_sensor/__init__.py +31 -0
  2943. esphome/components/tt21100/binary_sensor/tt21100_button.cpp +27 -0
  2944. esphome/components/tt21100/binary_sensor/tt21100_button.h +28 -0
  2945. esphome/components/tt21100/touchscreen/__init__.py +41 -0
  2946. esphome/components/tt21100/touchscreen/tt21100.cpp +145 -0
  2947. esphome/components/tt21100/touchscreen/tt21100.h +43 -0
  2948. esphome/components/ttp229_bsf/__init__.py +30 -0
  2949. esphome/components/ttp229_bsf/binary_sensor.py +23 -0
  2950. esphome/components/ttp229_bsf/ttp229_bsf.cpp +23 -0
  2951. esphome/components/ttp229_bsf/ttp229_bsf.h +56 -0
  2952. esphome/components/ttp229_lsf/__init__.py +31 -0
  2953. esphome/components/ttp229_lsf/binary_sensor.py +23 -0
  2954. esphome/components/ttp229_lsf/ttp229_lsf.cpp +45 -0
  2955. esphome/components/ttp229_lsf/ttp229_lsf.h +38 -0
  2956. esphome/components/tuya/__init__.py +133 -0
  2957. esphome/components/tuya/automation.cpp +67 -0
  2958. esphome/components/tuya/automation.h +55 -0
  2959. esphome/components/tuya/binary_sensor/__init__.py +34 -0
  2960. esphome/components/tuya/binary_sensor/tuya_binary_sensor.cpp +22 -0
  2961. esphome/components/tuya/binary_sensor/tuya_binary_sensor.h +24 -0
  2962. esphome/components/tuya/climate/__init__.py +274 -0
  2963. esphome/components/tuya/climate/tuya_climate.cpp +492 -0
  2964. esphome/components/tuya/climate/tuya_climate.h +128 -0
  2965. esphome/components/tuya/cover/__init__.py +79 -0
  2966. esphome/components/tuya/cover/tuya_cover.cpp +140 -0
  2967. esphome/components/tuya/cover/tuya_cover.h +50 -0
  2968. esphome/components/tuya/fan/__init__.py +45 -0
  2969. esphome/components/tuya/fan/tuya_fan.cpp +107 -0
  2970. esphome/components/tuya/fan/tuya_fan.h +36 -0
  2971. esphome/components/tuya/light/__init__.py +122 -0
  2972. esphome/components/tuya/light/tuya_light.cpp +224 -0
  2973. esphome/components/tuya/light/tuya_light.h +71 -0
  2974. esphome/components/tuya/number/__init__.py +95 -0
  2975. esphome/components/tuya/number/tuya_number.cpp +95 -0
  2976. esphome/components/tuya/number/tuya_number.h +38 -0
  2977. esphome/components/tuya/select/__init__.py +50 -0
  2978. esphome/components/tuya/select/tuya_select.cpp +52 -0
  2979. esphome/components/tuya/select/tuya_select.h +32 -0
  2980. esphome/components/tuya/sensor/__init__.py +32 -0
  2981. esphome/components/tuya/sensor/tuya_sensor.cpp +34 -0
  2982. esphome/components/tuya/sensor/tuya_sensor.h +24 -0
  2983. esphome/components/tuya/switch/__init__.py +31 -0
  2984. esphome/components/tuya/switch/tuya_switch.cpp +28 -0
  2985. esphome/components/tuya/switch/tuya_switch.h +26 -0
  2986. esphome/components/tuya/text_sensor/__init__.py +32 -0
  2987. esphome/components/tuya/text_sensor/tuya_text_sensor.cpp +41 -0
  2988. esphome/components/tuya/text_sensor/tuya_text_sensor.h +24 -0
  2989. esphome/components/tuya/tuya.cpp +714 -0
  2990. esphome/components/tuya/tuya.h +166 -0
  2991. esphome/components/tx20/__init__.py +0 -0
  2992. esphome/components/tx20/sensor.py +54 -0
  2993. esphome/components/tx20/tx20.cpp +197 -0
  2994. esphome/components/tx20/tx20.h +52 -0
  2995. esphome/components/uart/__init__.py +440 -0
  2996. esphome/components/uart/automation.h +38 -0
  2997. esphome/components/uart/button/__init__.py +35 -0
  2998. esphome/components/uart/button/uart_button.cpp +17 -0
  2999. esphome/components/uart/button/uart_button.h +24 -0
  3000. esphome/components/uart/switch/__init__.py +58 -0
  3001. esphome/components/uart/switch/uart_switch.cpp +61 -0
  3002. esphome/components/uart/switch/uart_switch.h +35 -0
  3003. esphome/components/uart/uart.cpp +47 -0
  3004. esphome/components/uart/uart.h +72 -0
  3005. esphome/components/uart/uart_component.cpp +24 -0
  3006. esphome/components/uart/uart_component.h +175 -0
  3007. esphome/components/uart/uart_component_esp32_arduino.cpp +213 -0
  3008. esphome/components/uart/uart_component_esp32_arduino.h +60 -0
  3009. esphome/components/uart/uart_component_esp8266.cpp +320 -0
  3010. esphome/components/uart/uart_component_esp8266.h +94 -0
  3011. esphome/components/uart/uart_component_esp_idf.cpp +248 -0
  3012. esphome/components/uart/uart_component_esp_idf.h +58 -0
  3013. esphome/components/uart/uart_component_host.cpp +299 -0
  3014. esphome/components/uart/uart_component_host.h +38 -0
  3015. esphome/components/uart/uart_component_libretiny.cpp +168 -0
  3016. esphome/components/uart/uart_component_libretiny.h +43 -0
  3017. esphome/components/uart/uart_component_rp2040.cpp +184 -0
  3018. esphome/components/uart/uart_component_rp2040.h +46 -0
  3019. esphome/components/uart/uart_debugger.cpp +202 -0
  3020. esphome/components/uart/uart_debugger.h +101 -0
  3021. esphome/components/udp/__init__.py +158 -0
  3022. esphome/components/udp/binary_sensor.py +27 -0
  3023. esphome/components/udp/sensor.py +27 -0
  3024. esphome/components/udp/udp_component.cpp +635 -0
  3025. esphome/components/udp/udp_component.h +160 -0
  3026. esphome/components/ufire_ec/__init__.py +1 -0
  3027. esphome/components/ufire_ec/sensor.py +126 -0
  3028. esphome/components/ufire_ec/ufire_ec.cpp +118 -0
  3029. esphome/components/ufire_ec/ufire_ec.h +87 -0
  3030. esphome/components/ufire_ise/__init__.py +1 -0
  3031. esphome/components/ufire_ise/sensor.py +127 -0
  3032. esphome/components/ufire_ise/ufire_ise.cpp +153 -0
  3033. esphome/components/ufire_ise/ufire_ise.h +95 -0
  3034. esphome/components/uln2003/__init__.py +0 -0
  3035. esphome/components/uln2003/stepper.py +56 -0
  3036. esphome/components/uln2003/uln2003.cpp +92 -0
  3037. esphome/components/uln2003/uln2003.h +44 -0
  3038. esphome/components/ultrasonic/__init__.py +1 -0
  3039. esphome/components/ultrasonic/sensor.py +53 -0
  3040. esphome/components/ultrasonic/ultrasonic_sensor.cpp +63 -0
  3041. esphome/components/ultrasonic/ultrasonic_sensor.h +46 -0
  3042. esphome/components/update/__init__.py +132 -0
  3043. esphome/components/update/automation.h +23 -0
  3044. esphome/components/update/update_entity.cpp +38 -0
  3045. esphome/components/update/update_entity.h +53 -0
  3046. esphome/components/uponor_smatrix/__init__.py +78 -0
  3047. esphome/components/uponor_smatrix/climate/__init__.py +33 -0
  3048. esphome/components/uponor_smatrix/climate/uponor_smatrix_climate.cpp +101 -0
  3049. esphome/components/uponor_smatrix/climate/uponor_smatrix_climate.h +28 -0
  3050. esphome/components/uponor_smatrix/sensor/__init__.py +70 -0
  3051. esphome/components/uponor_smatrix/sensor/uponor_smatrix_sensor.cpp +37 -0
  3052. esphome/components/uponor_smatrix/sensor/uponor_smatrix_sensor.h +23 -0
  3053. esphome/components/uponor_smatrix/uponor_smatrix.cpp +227 -0
  3054. esphome/components/uponor_smatrix/uponor_smatrix.h +129 -0
  3055. esphome/components/uptime/__init__.py +0 -0
  3056. esphome/components/uptime/sensor.py +61 -0
  3057. esphome/components/uptime/uptime_seconds_sensor.cpp +38 -0
  3058. esphome/components/uptime/uptime_seconds_sensor.h +23 -0
  3059. esphome/components/uptime/uptime_timestamp_sensor.cpp +39 -0
  3060. esphome/components/uptime/uptime_timestamp_sensor.h +30 -0
  3061. esphome/components/valve/__init__.py +204 -0
  3062. esphome/components/valve/automation.h +129 -0
  3063. esphome/components/valve/valve.cpp +179 -0
  3064. esphome/components/valve/valve.h +152 -0
  3065. esphome/components/valve/valve_traits.h +27 -0
  3066. esphome/components/vbus/__init__.py +33 -0
  3067. esphome/components/vbus/binary_sensor/__init__.py +348 -0
  3068. esphome/components/vbus/binary_sensor/vbus_binary_sensor.cpp +165 -0
  3069. esphome/components/vbus/binary_sensor/vbus_binary_sensor.h +136 -0
  3070. esphome/components/vbus/sensor/__init__.py +690 -0
  3071. esphome/components/vbus/sensor/vbus_sensor.cpp +250 -0
  3072. esphome/components/vbus/sensor/vbus_sensor.h +182 -0
  3073. esphome/components/vbus/vbus.cpp +125 -0
  3074. esphome/components/vbus/vbus.h +52 -0
  3075. esphome/components/veml3235/__init__.py +0 -0
  3076. esphome/components/veml3235/sensor.py +84 -0
  3077. esphome/components/veml3235/veml3235.cpp +230 -0
  3078. esphome/components/veml3235/veml3235.h +109 -0
  3079. esphome/components/veml7700/__init__.py +1 -0
  3080. esphome/components/veml7700/sensor.py +190 -0
  3081. esphome/components/veml7700/veml7700.cpp +437 -0
  3082. esphome/components/veml7700/veml7700.h +202 -0
  3083. esphome/components/version/__init__.py +1 -0
  3084. esphome/components/version/text_sensor.py +33 -0
  3085. esphome/components/version/version_text_sensor.cpp +24 -0
  3086. esphome/components/version/version_text_sensor.h +22 -0
  3087. esphome/components/vl53l0x/LICENSE.txt +80 -0
  3088. esphome/components/vl53l0x/__init__.py +0 -0
  3089. esphome/components/vl53l0x/sensor.py +76 -0
  3090. esphome/components/vl53l0x/vl53l0x_sensor.cpp +534 -0
  3091. esphome/components/vl53l0x/vl53l0x_sensor.h +75 -0
  3092. esphome/components/voice_assistant/__init__.py +398 -0
  3093. esphome/components/voice_assistant/voice_assistant.cpp +894 -0
  3094. esphome/components/voice_assistant/voice_assistant.h +341 -0
  3095. esphome/components/voltage_sampler/__init__.py +4 -0
  3096. esphome/components/voltage_sampler/voltage_sampler.h +16 -0
  3097. esphome/components/wake_on_lan/__init__.py +1 -0
  3098. esphome/components/wake_on_lan/button.py +37 -0
  3099. esphome/components/wake_on_lan/wake_on_lan.cpp +89 -0
  3100. esphome/components/wake_on_lan/wake_on_lan.h +36 -0
  3101. esphome/components/watchdog/__init__.py +1 -0
  3102. esphome/components/watchdog/watchdog.cpp +74 -0
  3103. esphome/components/watchdog/watchdog.h +24 -0
  3104. esphome/components/waveshare_epaper/__init__.py +1 -0
  3105. esphome/components/waveshare_epaper/display.py +234 -0
  3106. esphome/components/waveshare_epaper/waveshare_213v3.cpp +186 -0
  3107. esphome/components/waveshare_epaper/waveshare_epaper.cpp +3241 -0
  3108. esphome/components/waveshare_epaper/waveshare_epaper.h +853 -0
  3109. esphome/components/web_server/__init__.py +299 -0
  3110. esphome/components/web_server/list_entities.cpp +192 -0
  3111. esphome/components/web_server/list_entities.h +82 -0
  3112. esphome/components/web_server/server_index_v2.h +646 -0
  3113. esphome/components/web_server/server_index_v3.h +4030 -0
  3114. esphome/components/web_server/web_server.cpp +1869 -0
  3115. esphome/components/web_server/web_server.h +382 -0
  3116. esphome/components/web_server/web_server_v1.cpp +217 -0
  3117. esphome/components/web_server_base/__init__.py +40 -0
  3118. esphome/components/web_server_base/web_server_base.cpp +125 -0
  3119. esphome/components/web_server_base/web_server_base.h +149 -0
  3120. esphome/components/web_server_idf/__init__.py +14 -0
  3121. esphome/components/web_server_idf/utils.cpp +93 -0
  3122. esphome/components/web_server_idf/utils.h +17 -0
  3123. esphome/components/web_server_idf/web_server_idf.cpp +371 -0
  3124. esphome/components/web_server_idf/web_server_idf.h +285 -0
  3125. esphome/components/weikai/__init__.py +108 -0
  3126. esphome/components/weikai/weikai.cpp +615 -0
  3127. esphome/components/weikai/weikai.h +443 -0
  3128. esphome/components/weikai/wk_reg_def.h +304 -0
  3129. esphome/components/weikai_i2c/__init__.py +1 -0
  3130. esphome/components/weikai_i2c/weikai_i2c.cpp +177 -0
  3131. esphome/components/weikai_i2c/weikai_i2c.h +61 -0
  3132. esphome/components/weikai_spi/__init__.py +1 -0
  3133. esphome/components/weikai_spi/weikai_spi.cpp +189 -0
  3134. esphome/components/weikai_spi/weikai_spi.h +54 -0
  3135. esphome/components/whirlpool/__init__.py +0 -0
  3136. esphome/components/whirlpool/climate.py +29 -0
  3137. esphome/components/whirlpool/whirlpool.cpp +296 -0
  3138. esphome/components/whirlpool/whirlpool.h +65 -0
  3139. esphome/components/whynter/__init__.py +1 -0
  3140. esphome/components/whynter/climate.py +23 -0
  3141. esphome/components/whynter/whynter.cpp +181 -0
  3142. esphome/components/whynter/whynter.h +53 -0
  3143. esphome/components/wiegand/__init__.py +77 -0
  3144. esphome/components/wiegand/wiegand.cpp +127 -0
  3145. esphome/components/wiegand/wiegand.h +54 -0
  3146. esphome/components/wifi/__init__.py +527 -0
  3147. esphome/components/wifi/wifi_component.cpp +860 -0
  3148. esphome/components/wifi/wifi_component.h +527 -0
  3149. esphome/components/wifi/wifi_component_esp32_arduino.cpp +827 -0
  3150. esphome/components/wifi/wifi_component_esp8266.cpp +854 -0
  3151. esphome/components/wifi/wifi_component_esp_idf.cpp +1029 -0
  3152. esphome/components/wifi/wifi_component_libretiny.cpp +486 -0
  3153. esphome/components/wifi/wifi_component_pico_w.cpp +222 -0
  3154. esphome/components/wifi/wpa2_eap.py +152 -0
  3155. esphome/components/wifi_info/__init__.py +0 -0
  3156. esphome/components/wifi_info/text_sensor.py +88 -0
  3157. esphome/components/wifi_info/wifi_info_text_sensor.cpp +19 -0
  3158. esphome/components/wifi_info/wifi_info_text_sensor.h +135 -0
  3159. esphome/components/wifi_signal/__init__.py +0 -0
  3160. esphome/components/wifi_signal/sensor.py +29 -0
  3161. esphome/components/wifi_signal/wifi_signal_sensor.cpp +14 -0
  3162. esphome/components/wifi_signal/wifi_signal_sensor.h +22 -0
  3163. esphome/components/wireguard/__init__.py +184 -0
  3164. esphome/components/wireguard/binary_sensor.py +36 -0
  3165. esphome/components/wireguard/sensor.py +29 -0
  3166. esphome/components/wireguard/text_sensor.py +26 -0
  3167. esphome/components/wireguard/wireguard.cpp +292 -0
  3168. esphome/components/wireguard/wireguard.h +174 -0
  3169. esphome/components/wk2132_i2c/__init__.py +30 -0
  3170. esphome/components/wk2132_i2c/wk2132_i2c.cpp +4 -0
  3171. esphome/components/wk2132_spi/__init__.py +31 -0
  3172. esphome/components/wk2168_i2c/__init__.py +64 -0
  3173. esphome/components/wk2168_spi/__init__.py +62 -0
  3174. esphome/components/wk2204_i2c/__init__.py +30 -0
  3175. esphome/components/wk2204_spi/__init__.py +30 -0
  3176. esphome/components/wk2212_i2c/__init__.py +64 -0
  3177. esphome/components/wk2212_spi/__init__.py +62 -0
  3178. esphome/components/wl_134/__init__.py +0 -0
  3179. esphome/components/wl_134/text_sensor.py +31 -0
  3180. esphome/components/wl_134/wl_134.cpp +113 -0
  3181. esphome/components/wl_134/wl_134.h +63 -0
  3182. esphome/components/wled/__init__.py +30 -0
  3183. esphome/components/wled/wled_light_effect.cpp +287 -0
  3184. esphome/components/wled/wled_light_effect.h +47 -0
  3185. esphome/components/x9c/__init__.py +0 -0
  3186. esphome/components/x9c/output.py +55 -0
  3187. esphome/components/x9c/x9c.cpp +77 -0
  3188. esphome/components/x9c/x9c.h +34 -0
  3189. esphome/components/xgzp68xx/__init__.py +1 -0
  3190. esphome/components/xgzp68xx/sensor.py +62 -0
  3191. esphome/components/xgzp68xx/xgzp68xx.cpp +93 -0
  3192. esphome/components/xgzp68xx/xgzp68xx.h +27 -0
  3193. esphome/components/xiaomi_ble/__init__.py +22 -0
  3194. esphome/components/xiaomi_ble/xiaomi_ble.cpp +398 -0
  3195. esphome/components/xiaomi_ble/xiaomi_ble.h +83 -0
  3196. esphome/components/xiaomi_cgd1/__init__.py +0 -0
  3197. esphome/components/xiaomi_cgd1/sensor.py +76 -0
  3198. esphome/components/xiaomi_cgd1/xiaomi_cgd1.cpp +73 -0
  3199. esphome/components/xiaomi_cgd1/xiaomi_cgd1.h +36 -0
  3200. esphome/components/xiaomi_cgdk2/__init__.py +0 -0
  3201. esphome/components/xiaomi_cgdk2/sensor.py +76 -0
  3202. esphome/components/xiaomi_cgdk2/xiaomi_cgdk2.cpp +73 -0
  3203. esphome/components/xiaomi_cgdk2/xiaomi_cgdk2.h +36 -0
  3204. esphome/components/xiaomi_cgg1/__init__.py +0 -0
  3205. esphome/components/xiaomi_cgg1/sensor.py +77 -0
  3206. esphome/components/xiaomi_cgg1/xiaomi_cgg1.cpp +73 -0
  3207. esphome/components/xiaomi_cgg1/xiaomi_cgg1.h +37 -0
  3208. esphome/components/xiaomi_cgpr1/__init__.py +0 -0
  3209. esphome/components/xiaomi_cgpr1/binary_sensor.py +77 -0
  3210. esphome/components/xiaomi_cgpr1/xiaomi_cgpr1.cpp +75 -0
  3211. esphome/components/xiaomi_cgpr1/xiaomi_cgpr1.h +40 -0
  3212. esphome/components/xiaomi_gcls002/__init__.py +0 -0
  3213. esphome/components/xiaomi_gcls002/sensor.py +84 -0
  3214. esphome/components/xiaomi_gcls002/xiaomi_gcls002.cpp +62 -0
  3215. esphome/components/xiaomi_gcls002/xiaomi_gcls002.h +37 -0
  3216. esphome/components/xiaomi_hhccjcy01/__init__.py +0 -0
  3217. esphome/components/xiaomi_hhccjcy01/sensor.py +97 -0
  3218. esphome/components/xiaomi_hhccjcy01/xiaomi_hhccjcy01.cpp +65 -0
  3219. esphome/components/xiaomi_hhccjcy01/xiaomi_hhccjcy01.h +39 -0
  3220. esphome/components/xiaomi_hhccjcy10/__init__.py +1 -0
  3221. esphome/components/xiaomi_hhccjcy10/sensor.py +96 -0
  3222. esphome/components/xiaomi_hhccjcy10/xiaomi_hhccjcy10.cpp +68 -0
  3223. esphome/components/xiaomi_hhccjcy10/xiaomi_hhccjcy10.h +38 -0
  3224. esphome/components/xiaomi_hhccpot002/__init__.py +0 -0
  3225. esphome/components/xiaomi_hhccpot002/sensor.py +60 -0
  3226. esphome/components/xiaomi_hhccpot002/xiaomi_hhccpot002.cpp +56 -0
  3227. esphome/components/xiaomi_hhccpot002/xiaomi_hhccpot002.h +33 -0
  3228. esphome/components/xiaomi_jqjcy01ym/__init__.py +0 -0
  3229. esphome/components/xiaomi_jqjcy01ym/sensor.py +85 -0
  3230. esphome/components/xiaomi_jqjcy01ym/xiaomi_jqjcy01ym.cpp +62 -0
  3231. esphome/components/xiaomi_jqjcy01ym/xiaomi_jqjcy01ym.h +37 -0
  3232. esphome/components/xiaomi_lywsd02/__init__.py +0 -0
  3233. esphome/components/xiaomi_lywsd02/sensor.py +73 -0
  3234. esphome/components/xiaomi_lywsd02/xiaomi_lywsd02.cpp +59 -0
  3235. esphome/components/xiaomi_lywsd02/xiaomi_lywsd02.h +35 -0
  3236. esphome/components/xiaomi_lywsd02mmc/__init__.py +0 -0
  3237. esphome/components/xiaomi_lywsd02mmc/sensor.py +77 -0
  3238. esphome/components/xiaomi_lywsd02mmc/xiaomi_lywsd02mmc.cpp +73 -0
  3239. esphome/components/xiaomi_lywsd02mmc/xiaomi_lywsd02mmc.h +37 -0
  3240. esphome/components/xiaomi_lywsd03mmc/__init__.py +0 -0
  3241. esphome/components/xiaomi_lywsd03mmc/sensor.py +78 -0
  3242. esphome/components/xiaomi_lywsd03mmc/xiaomi_lywsd03mmc.cpp +77 -0
  3243. esphome/components/xiaomi_lywsd03mmc/xiaomi_lywsd03mmc.h +36 -0
  3244. esphome/components/xiaomi_lywsdcgq/__init__.py +0 -0
  3245. esphome/components/xiaomi_lywsdcgq/sensor.py +73 -0
  3246. esphome/components/xiaomi_lywsdcgq/xiaomi_lywsdcgq.cpp +59 -0
  3247. esphome/components/xiaomi_lywsdcgq/xiaomi_lywsdcgq.h +35 -0
  3248. esphome/components/xiaomi_mhoc303/__init__.py +1 -0
  3249. esphome/components/xiaomi_mhoc303/sensor.py +73 -0
  3250. esphome/components/xiaomi_mhoc303/xiaomi_mhoc303.cpp +59 -0
  3251. esphome/components/xiaomi_mhoc303/xiaomi_mhoc303.h +35 -0
  3252. esphome/components/xiaomi_mhoc401/__init__.py +0 -0
  3253. esphome/components/xiaomi_mhoc401/sensor.py +77 -0
  3254. esphome/components/xiaomi_mhoc401/xiaomi_mhoc401.cpp +77 -0
  3255. esphome/components/xiaomi_mhoc401/xiaomi_mhoc401.h +36 -0
  3256. esphome/components/xiaomi_miscale/__init__.py +0 -0
  3257. esphome/components/xiaomi_miscale/sensor.py +62 -0
  3258. esphome/components/xiaomi_miscale/xiaomi_miscale.cpp +169 -0
  3259. esphome/components/xiaomi_miscale/xiaomi_miscale.h +47 -0
  3260. esphome/components/xiaomi_miscale2/__init__.py +0 -0
  3261. esphome/components/xiaomi_miscale2/sensor.py +5 -0
  3262. esphome/components/xiaomi_mjyd02yla/__init__.py +0 -0
  3263. esphome/components/xiaomi_mjyd02yla/binary_sensor.py +89 -0
  3264. esphome/components/xiaomi_mjyd02yla/xiaomi_mjyd02yla.cpp +78 -0
  3265. esphome/components/xiaomi_mjyd02yla/xiaomi_mjyd02yla.h +42 -0
  3266. esphome/components/xiaomi_mue4094rt/__init__.py +0 -0
  3267. esphome/components/xiaomi_mue4094rt/binary_sensor.py +45 -0
  3268. esphome/components/xiaomi_mue4094rt/xiaomi_mue4094rt.cpp +55 -0
  3269. esphome/components/xiaomi_mue4094rt/xiaomi_mue4094rt.h +33 -0
  3270. esphome/components/xiaomi_rtcgq02lm/__init__.py +36 -0
  3271. esphome/components/xiaomi_rtcgq02lm/binary_sensor.py +63 -0
  3272. esphome/components/xiaomi_rtcgq02lm/sensor.py +37 -0
  3273. esphome/components/xiaomi_rtcgq02lm/xiaomi_rtcgq02lm.cpp +91 -0
  3274. esphome/components/xiaomi_rtcgq02lm/xiaomi_rtcgq02lm.h +61 -0
  3275. esphome/components/xiaomi_wx08zm/__init__.py +0 -0
  3276. esphome/components/xiaomi_wx08zm/binary_sensor.py +64 -0
  3277. esphome/components/xiaomi_wx08zm/xiaomi_wx08zm.cpp +60 -0
  3278. esphome/components/xiaomi_wx08zm/xiaomi_wx08zm.h +36 -0
  3279. esphome/components/xl9535/__init__.py +79 -0
  3280. esphome/components/xl9535/xl9535.cpp +122 -0
  3281. esphome/components/xl9535/xl9535.h +54 -0
  3282. esphome/components/xpt2046/__init__.py +5 -0
  3283. esphome/components/xpt2046/touchscreen/__init__.py +43 -0
  3284. esphome/components/xpt2046/touchscreen/xpt2046.cpp +112 -0
  3285. esphome/components/xpt2046/touchscreen/xpt2046.h +41 -0
  3286. esphome/components/yashima/__init__.py +0 -0
  3287. esphome/components/yashima/climate.py +39 -0
  3288. esphome/components/yashima/yashima.cpp +197 -0
  3289. esphome/components/yashima/yashima.h +40 -0
  3290. esphome/components/zhlt01/__init__.py +0 -0
  3291. esphome/components/zhlt01/climate.py +19 -0
  3292. esphome/components/zhlt01/zhlt01.cpp +238 -0
  3293. esphome/components/zhlt01/zhlt01.h +167 -0
  3294. esphome/components/zio_ultrasonic/__init__.py +0 -0
  3295. esphome/components/zio_ultrasonic/sensor.py +34 -0
  3296. esphome/components/zio_ultrasonic/zio_ultrasonic.cpp +31 -0
  3297. esphome/components/zio_ultrasonic/zio_ultrasonic.h +22 -0
  3298. esphome/components/zyaura/__init__.py +0 -0
  3299. esphome/components/zyaura/sensor.py +71 -0
  3300. esphome/components/zyaura/zyaura.cpp +125 -0
  3301. esphome/components/zyaura/zyaura.h +86 -0
  3302. esphome/config.py +1124 -0
  3303. esphome/config_helpers.py +105 -0
  3304. esphome/config_validation.py +2223 -0
  3305. esphome/const.py +1232 -0
  3306. esphome/core/__init__.py +868 -0
  3307. esphome/core/application.cpp +155 -0
  3308. esphome/core/application.h +555 -0
  3309. esphome/core/automation.h +255 -0
  3310. esphome/core/base_automation.h +407 -0
  3311. esphome/core/color.cpp +11 -0
  3312. esphome/core/color.h +177 -0
  3313. esphome/core/component.cpp +243 -0
  3314. esphome/core/component.h +332 -0
  3315. esphome/core/component_iterator.cpp +395 -0
  3316. esphome/core/component_iterator.h +174 -0
  3317. esphome/core/config.py +407 -0
  3318. esphome/core/controller.cpp +132 -0
  3319. esphome/core/controller.h +135 -0
  3320. esphome/core/datatypes.h +61 -0
  3321. esphome/core/defines.h +177 -0
  3322. esphome/core/entity_base.cpp +96 -0
  3323. esphome/core/entity_base.h +88 -0
  3324. esphome/core/entity_helpers.py +56 -0
  3325. esphome/core/gpio.h +99 -0
  3326. esphome/core/hal.h +48 -0
  3327. esphome/core/helpers.cpp +786 -0
  3328. esphome/core/helpers.h +751 -0
  3329. esphome/core/log.cpp +62 -0
  3330. esphome/core/log.h +198 -0
  3331. esphome/core/macros.h +4 -0
  3332. esphome/core/optional.h +215 -0
  3333. esphome/core/preferences.h +70 -0
  3334. esphome/core/ring_buffer.cpp +127 -0
  3335. esphome/core/ring_buffer.h +98 -0
  3336. esphome/core/scheduler.cpp +364 -0
  3337. esphome/core/scheduler.h +84 -0
  3338. esphome/core/string_ref.cpp +12 -0
  3339. esphome/core/string_ref.h +135 -0
  3340. esphome/core/time.cpp +243 -0
  3341. esphome/core/time.h +118 -0
  3342. esphome/core/util.cpp +37 -0
  3343. esphome/core/util.h +15 -0
  3344. esphome/core/version.h +12 -0
  3345. esphome/coroutine.py +253 -0
  3346. esphome/cpp_generator.py +1034 -0
  3347. esphome/cpp_helpers.py +148 -0
  3348. esphome/cpp_types.py +43 -0
  3349. esphome/dashboard/__init__.py +0 -0
  3350. esphome/dashboard/const.py +12 -0
  3351. esphome/dashboard/core.py +179 -0
  3352. esphome/dashboard/dashboard.py +153 -0
  3353. esphome/dashboard/dns.py +43 -0
  3354. esphome/dashboard/entries.py +397 -0
  3355. esphome/dashboard/enum.py +20 -0
  3356. esphome/dashboard/settings.py +93 -0
  3357. esphome/dashboard/status/__init__.py +0 -0
  3358. esphome/dashboard/status/mdns.py +97 -0
  3359. esphome/dashboard/status/mqtt.py +67 -0
  3360. esphome/dashboard/status/ping.py +107 -0
  3361. esphome/dashboard/util/__init__.py +0 -0
  3362. esphome/dashboard/util/file.py +63 -0
  3363. esphome/dashboard/util/itertools.py +22 -0
  3364. esphome/dashboard/util/password.py +11 -0
  3365. esphome/dashboard/util/subprocess.py +31 -0
  3366. esphome/dashboard/util/text.py +25 -0
  3367. esphome/dashboard/web_server.py +1231 -0
  3368. esphome/espota2.py +360 -0
  3369. esphome/external_files.py +107 -0
  3370. esphome/final_validate.py +58 -0
  3371. esphome/git.py +175 -0
  3372. esphome/helpers.py +422 -0
  3373. esphome/loader.py +207 -0
  3374. esphome/log.py +90 -0
  3375. esphome/mqtt.py +285 -0
  3376. esphome/pins.py +334 -0
  3377. esphome/platformio_api.py +334 -0
  3378. esphome/schema_extractors.py +93 -0
  3379. esphome/storage_json.py +286 -0
  3380. esphome/types.py +19 -0
  3381. esphome/util.py +312 -0
  3382. esphome/voluptuous_schema.py +231 -0
  3383. esphome/vscode.py +113 -0
  3384. esphome/wizard.py +514 -0
  3385. esphome/writer.py +378 -0
  3386. esphome/yaml_util.py +584 -0
  3387. esphome/zeroconf.py +201 -0
  3388. esphome-2024.12.3.dist-info/LICENSE +709 -0
  3389. esphome-2024.12.3.dist-info/METADATA +80 -0
  3390. esphome-2024.12.3.dist-info/RECORD +3393 -0
  3391. esphome-2024.12.3.dist-info/WHEEL +5 -0
  3392. esphome-2024.12.3.dist-info/entry_points.txt +2 -0
  3393. esphome-2024.12.3.dist-info/top_level.txt +1 -0
@@ -0,0 +1,1735 @@
1
+ #include "automation.h"
2
+ #include "sprinkler.h"
3
+
4
+ #include "esphome/core/application.h"
5
+ #include "esphome/core/helpers.h"
6
+ #include "esphome/core/log.h"
7
+ #include <cinttypes>
8
+ #include <utility>
9
+
10
+ namespace esphome {
11
+ namespace sprinkler {
12
+
13
+ static const char *const TAG = "sprinkler";
14
+
15
+ SprinklerSwitch::SprinklerSwitch() {}
16
+ SprinklerSwitch::SprinklerSwitch(switch_::Switch *sprinkler_switch) : on_switch_(sprinkler_switch) {}
17
+ SprinklerSwitch::SprinklerSwitch(switch_::Switch *off_switch, switch_::Switch *on_switch, uint32_t pulse_duration)
18
+ : pulse_duration_(pulse_duration), off_switch_(off_switch), on_switch_(on_switch) {}
19
+
20
+ bool SprinklerSwitch::is_latching_valve() { return (this->off_switch_ != nullptr) && (this->on_switch_ != nullptr); }
21
+
22
+ void SprinklerSwitch::loop() {
23
+ if ((this->pinned_millis_) && (millis() > this->pinned_millis_ + this->pulse_duration_)) {
24
+ this->pinned_millis_ = 0; // reset tracker
25
+ if (this->off_switch_->state) {
26
+ this->off_switch_->turn_off();
27
+ }
28
+ if (this->on_switch_->state) {
29
+ this->on_switch_->turn_off();
30
+ }
31
+ }
32
+ }
33
+
34
+ void SprinklerSwitch::turn_off() {
35
+ if (!this->state()) { // do nothing if we're already in the requested state
36
+ return;
37
+ }
38
+ if (this->off_switch_ != nullptr) { // latching valve, start a pulse
39
+ if (!this->off_switch_->state) {
40
+ this->off_switch_->turn_on();
41
+ }
42
+ this->pinned_millis_ = millis();
43
+ } else if (this->on_switch_ != nullptr) { // non-latching valve
44
+ this->on_switch_->turn_off();
45
+ }
46
+ this->state_ = false;
47
+ }
48
+
49
+ void SprinklerSwitch::turn_on() {
50
+ if (this->state()) { // do nothing if we're already in the requested state
51
+ return;
52
+ }
53
+ if (this->off_switch_ != nullptr) { // latching valve, start a pulse
54
+ if (!this->on_switch_->state) {
55
+ this->on_switch_->turn_on();
56
+ }
57
+ this->pinned_millis_ = millis();
58
+ } else if (this->on_switch_ != nullptr) { // non-latching valve
59
+ this->on_switch_->turn_on();
60
+ }
61
+ this->state_ = true;
62
+ }
63
+
64
+ bool SprinklerSwitch::state() {
65
+ if ((this->off_switch_ == nullptr) && (this->on_switch_ != nullptr)) { // latching valve is not configured...
66
+ return this->on_switch_->state; // ...so just return the pump switch state
67
+ }
68
+ return this->state_;
69
+ }
70
+
71
+ void SprinklerSwitch::sync_valve_state(bool latch_state) {
72
+ if (this->is_latching_valve()) {
73
+ this->state_ = latch_state;
74
+ } else if (this->on_switch_ != nullptr) {
75
+ this->state_ = this->on_switch_->state;
76
+ }
77
+ }
78
+
79
+ void SprinklerControllerNumber::setup() {
80
+ float value;
81
+ if (!this->restore_value_) {
82
+ value = this->initial_value_;
83
+ } else {
84
+ this->pref_ = global_preferences->make_preference<float>(this->get_object_id_hash());
85
+ if (!this->pref_.load(&value)) {
86
+ if (!std::isnan(this->initial_value_)) {
87
+ value = this->initial_value_;
88
+ } else {
89
+ value = this->traits.get_min_value();
90
+ }
91
+ }
92
+ }
93
+ this->publish_state(value);
94
+ }
95
+
96
+ void SprinklerControllerNumber::control(float value) {
97
+ this->set_trigger_->trigger(value);
98
+
99
+ this->publish_state(value);
100
+
101
+ if (this->restore_value_)
102
+ this->pref_.save(&value);
103
+ }
104
+
105
+ void SprinklerControllerNumber::dump_config() { LOG_NUMBER("", "Sprinkler Controller Number", this); }
106
+
107
+ SprinklerControllerSwitch::SprinklerControllerSwitch()
108
+ : turn_on_trigger_(new Trigger<>()), turn_off_trigger_(new Trigger<>()) {}
109
+
110
+ void SprinklerControllerSwitch::loop() {
111
+ if (!this->f_.has_value())
112
+ return;
113
+ auto s = (*this->f_)();
114
+ if (!s.has_value())
115
+ return;
116
+
117
+ this->publish_state(*s);
118
+ }
119
+
120
+ void SprinklerControllerSwitch::write_state(bool state) {
121
+ if (this->prev_trigger_ != nullptr) {
122
+ this->prev_trigger_->stop_action();
123
+ }
124
+
125
+ if (state) {
126
+ this->prev_trigger_ = this->turn_on_trigger_;
127
+ this->turn_on_trigger_->trigger();
128
+ } else {
129
+ this->prev_trigger_ = this->turn_off_trigger_;
130
+ this->turn_off_trigger_->trigger();
131
+ }
132
+
133
+ this->publish_state(state);
134
+ }
135
+
136
+ void SprinklerControllerSwitch::set_state_lambda(std::function<optional<bool>()> &&f) { this->f_ = f; }
137
+ float SprinklerControllerSwitch::get_setup_priority() const { return setup_priority::HARDWARE; }
138
+
139
+ Trigger<> *SprinklerControllerSwitch::get_turn_on_trigger() const { return this->turn_on_trigger_; }
140
+ Trigger<> *SprinklerControllerSwitch::get_turn_off_trigger() const { return this->turn_off_trigger_; }
141
+
142
+ void SprinklerControllerSwitch::setup() { this->state = this->get_initial_state_with_restore_mode().value_or(false); }
143
+
144
+ void SprinklerControllerSwitch::dump_config() { LOG_SWITCH("", "Sprinkler Switch", this); }
145
+
146
+ SprinklerValveOperator::SprinklerValveOperator() {}
147
+ SprinklerValveOperator::SprinklerValveOperator(SprinklerValve *valve, Sprinkler *controller)
148
+ : controller_(controller), valve_(valve) {}
149
+
150
+ void SprinklerValveOperator::loop() {
151
+ if (millis() >= this->start_millis_) { // dummy check
152
+ switch (this->state_) {
153
+ case STARTING:
154
+ if (millis() > (this->start_millis_ + this->start_delay_)) {
155
+ this->run_(); // start_delay_ has been exceeded, so ensure both valves are on and update the state
156
+ }
157
+ break;
158
+
159
+ case ACTIVE:
160
+ if (millis() > (this->start_millis_ + this->start_delay_ + this->run_duration_)) {
161
+ this->stop(); // start_delay_ + run_duration_ has been exceeded, start shutting down
162
+ }
163
+ break;
164
+
165
+ case STOPPING:
166
+ if (millis() > (this->stop_millis_ + this->stop_delay_)) {
167
+ this->kill_(); // stop_delay_has been exceeded, ensure all valves are off
168
+ }
169
+ break;
170
+
171
+ default:
172
+ break;
173
+ }
174
+ } else { // perhaps millis() rolled over...or something else is horribly wrong!
175
+ this->stop(); // bail out (TODO: handle this highly unlikely situation better...)
176
+ }
177
+ }
178
+
179
+ void SprinklerValveOperator::set_controller(Sprinkler *controller) {
180
+ if (controller != nullptr) {
181
+ this->controller_ = controller;
182
+ }
183
+ }
184
+
185
+ void SprinklerValveOperator::set_valve(SprinklerValve *valve) {
186
+ if (valve != nullptr) {
187
+ this->state_ = IDLE; // reset state
188
+ this->run_duration_ = 0; // reset to ensure the valve isn't started without updating it
189
+ this->start_millis_ = 0; // reset because (new) valve has not been started yet
190
+ this->stop_millis_ = 0; // reset because (new) valve has not been started yet
191
+ this->kill_(); // ensure everything is off before we let go!
192
+ this->valve_ = valve; // finally, set the pointer to the new valve
193
+ }
194
+ }
195
+
196
+ void SprinklerValveOperator::set_run_duration(uint32_t run_duration) {
197
+ if (run_duration) {
198
+ this->run_duration_ = run_duration * 1000;
199
+ }
200
+ }
201
+
202
+ void SprinklerValveOperator::set_start_delay(uint32_t start_delay, bool start_delay_is_valve_delay) {
203
+ this->start_delay_is_valve_delay_ = start_delay_is_valve_delay;
204
+ this->start_delay_ = start_delay * 1000; // because 1000 milliseconds is one second
205
+ }
206
+
207
+ void SprinklerValveOperator::set_stop_delay(uint32_t stop_delay, bool stop_delay_is_valve_delay) {
208
+ this->stop_delay_is_valve_delay_ = stop_delay_is_valve_delay;
209
+ this->stop_delay_ = stop_delay * 1000; // because 1000 milliseconds is one second
210
+ }
211
+
212
+ void SprinklerValveOperator::start() {
213
+ if (!this->run_duration_) { // can't start if zero run duration
214
+ return;
215
+ }
216
+ if (this->start_delay_ && (this->pump_switch() != nullptr)) {
217
+ this->state_ = STARTING; // STARTING state requires both a pump and a start_delay_
218
+ if (this->start_delay_is_valve_delay_) {
219
+ this->pump_on_();
220
+ } else if (!this->pump_switch()->state()) { // if the pump is already on, wait to switch on the valve
221
+ this->valve_on_(); // to ensure consistent run time
222
+ }
223
+ } else {
224
+ this->run_(); // there is no start_delay_, so just start the pump and valve
225
+ }
226
+ this->stop_millis_ = 0;
227
+ this->start_millis_ = millis(); // save the time the start request was made
228
+ }
229
+
230
+ void SprinklerValveOperator::stop() {
231
+ if ((this->state_ == IDLE) || (this->state_ == STOPPING)) { // can't stop if already stopped or stopping
232
+ return;
233
+ }
234
+ if (this->stop_delay_ && (this->pump_switch() != nullptr)) {
235
+ this->state_ = STOPPING; // STOPPING state requires both a pump and a stop_delay_
236
+ if (this->stop_delay_is_valve_delay_) {
237
+ this->pump_off_();
238
+ } else {
239
+ this->valve_off_();
240
+ }
241
+ if (this->pump_switch()->state()) { // if the pump is still on at this point, it may be in use...
242
+ this->valve_off_(); // ...so just switch the valve off now to ensure consistent run time
243
+ }
244
+ } else {
245
+ this->kill_(); // there is no stop_delay_, so just stop the pump and valve
246
+ }
247
+ this->stop_millis_ = millis(); // save the time the stop request was made
248
+ }
249
+
250
+ uint32_t SprinklerValveOperator::run_duration() { return this->run_duration_ / 1000; }
251
+
252
+ uint32_t SprinklerValveOperator::time_remaining() {
253
+ if (this->start_millis_ == 0) {
254
+ return this->run_duration(); // hasn't been started yet
255
+ }
256
+
257
+ if (this->stop_millis_) {
258
+ if (this->stop_millis_ - this->start_millis_ >= this->start_delay_ + this->run_duration_) {
259
+ return 0; // valve was active for more than its configured duration, so we are done
260
+ } else {
261
+ // we're stopped; return time remaining
262
+ return (this->run_duration_ - (this->stop_millis_ - this->start_millis_)) / 1000;
263
+ }
264
+ }
265
+
266
+ auto completed_millis = this->start_millis_ + this->start_delay_ + this->run_duration_;
267
+ if (completed_millis > millis()) {
268
+ return (completed_millis - millis()) / 1000; // running now
269
+ }
270
+ return 0; // run completed
271
+ }
272
+
273
+ SprinklerState SprinklerValveOperator::state() { return this->state_; }
274
+
275
+ SprinklerSwitch *SprinklerValveOperator::pump_switch() {
276
+ if ((this->controller_ == nullptr) || (this->valve_ == nullptr)) {
277
+ return nullptr;
278
+ }
279
+ if (this->valve_->pump_switch_index.has_value()) {
280
+ return this->controller_->valve_pump_switch_by_pump_index(this->valve_->pump_switch_index.value());
281
+ }
282
+ return nullptr;
283
+ }
284
+
285
+ void SprinklerValveOperator::pump_off_() {
286
+ if ((this->valve_ == nullptr) || (this->pump_switch() == nullptr)) { // safety first!
287
+ return;
288
+ }
289
+ if (this->controller_ == nullptr) { // safety first!
290
+ this->pump_switch()->turn_off(); // if no controller was set, just switch off the pump
291
+ } else { // ...otherwise, do it "safely"
292
+ auto state = this->state_; // this is silly, but...
293
+ this->state_ = BYPASS; // ...exclude me from the pump-in-use check that set_pump_state() does
294
+ this->controller_->set_pump_state(this->pump_switch(), false);
295
+ this->state_ = state;
296
+ }
297
+ }
298
+
299
+ void SprinklerValveOperator::pump_on_() {
300
+ if ((this->valve_ == nullptr) || (this->pump_switch() == nullptr)) { // safety first!
301
+ return;
302
+ }
303
+ if (this->controller_ == nullptr) { // safety first!
304
+ this->pump_switch()->turn_on(); // if no controller was set, just switch on the pump
305
+ } else { // ...otherwise, do it "safely"
306
+ auto state = this->state_; // this is silly, but...
307
+ this->state_ = BYPASS; // ...exclude me from the pump-in-use check that set_pump_state() does
308
+ this->controller_->set_pump_state(this->pump_switch(), true);
309
+ this->state_ = state;
310
+ }
311
+ }
312
+
313
+ void SprinklerValveOperator::valve_off_() {
314
+ if (this->valve_ == nullptr) { // safety first!
315
+ return;
316
+ }
317
+ if (this->valve_->valve_switch.state()) {
318
+ this->valve_->valve_switch.turn_off();
319
+ }
320
+ }
321
+
322
+ void SprinklerValveOperator::valve_on_() {
323
+ if (this->valve_ == nullptr) { // safety first!
324
+ return;
325
+ }
326
+ if (!this->valve_->valve_switch.state()) {
327
+ this->valve_->valve_switch.turn_on();
328
+ }
329
+ }
330
+
331
+ void SprinklerValveOperator::kill_() {
332
+ this->state_ = IDLE;
333
+ this->valve_off_();
334
+ this->pump_off_();
335
+ }
336
+
337
+ void SprinklerValveOperator::run_() {
338
+ this->state_ = ACTIVE;
339
+ this->valve_on_();
340
+ this->pump_on_();
341
+ }
342
+
343
+ SprinklerValveRunRequest::SprinklerValveRunRequest() {}
344
+ SprinklerValveRunRequest::SprinklerValveRunRequest(size_t valve_number, uint32_t run_duration,
345
+ SprinklerValveOperator *valve_op)
346
+ : valve_number_(valve_number), run_duration_(run_duration), valve_op_(valve_op) {}
347
+
348
+ bool SprinklerValveRunRequest::has_request() { return this->has_valve_; }
349
+ bool SprinklerValveRunRequest::has_valve_operator() { return !(this->valve_op_ == nullptr); }
350
+
351
+ void SprinklerValveRunRequest::set_request_from(SprinklerValveRunRequestOrigin origin) { this->origin_ = origin; }
352
+
353
+ void SprinklerValveRunRequest::set_run_duration(uint32_t run_duration) { this->run_duration_ = run_duration; }
354
+
355
+ void SprinklerValveRunRequest::set_valve(size_t valve_number) {
356
+ this->valve_number_ = valve_number;
357
+ this->run_duration_ = 0;
358
+ this->valve_op_ = nullptr;
359
+ this->has_valve_ = true;
360
+ }
361
+
362
+ void SprinklerValveRunRequest::set_valve_operator(SprinklerValveOperator *valve_op) {
363
+ if (valve_op != nullptr) {
364
+ this->valve_op_ = valve_op;
365
+ }
366
+ }
367
+
368
+ void SprinklerValveRunRequest::reset() {
369
+ this->has_valve_ = false;
370
+ this->origin_ = USER;
371
+ this->run_duration_ = 0;
372
+ this->valve_op_ = nullptr;
373
+ }
374
+
375
+ uint32_t SprinklerValveRunRequest::run_duration() { return this->run_duration_; }
376
+
377
+ size_t SprinklerValveRunRequest::valve() { return this->valve_number_; }
378
+
379
+ optional<size_t> SprinklerValveRunRequest::valve_as_opt() {
380
+ if (this->has_valve_) {
381
+ return this->valve_number_;
382
+ }
383
+ return nullopt;
384
+ }
385
+
386
+ SprinklerValveOperator *SprinklerValveRunRequest::valve_operator() { return this->valve_op_; }
387
+
388
+ SprinklerValveRunRequestOrigin SprinklerValveRunRequest::request_is_from() { return this->origin_; }
389
+
390
+ Sprinkler::Sprinkler() {}
391
+ Sprinkler::Sprinkler(const std::string &name) {
392
+ // The `name` is needed to set timers up, hence non-default constructor
393
+ // replaces `set_name()` method previously existed
394
+ this->name_ = name;
395
+ this->timer_.push_back({this->name_ + "sm", false, 0, 0, std::bind(&Sprinkler::sm_timer_callback_, this)});
396
+ this->timer_.push_back({this->name_ + "vs", false, 0, 0, std::bind(&Sprinkler::valve_selection_callback_, this)});
397
+ }
398
+
399
+ void Sprinkler::setup() { this->all_valves_off_(true); }
400
+
401
+ void Sprinkler::loop() {
402
+ for (auto &p : this->pump_) {
403
+ p.loop();
404
+ }
405
+ for (auto &v : this->valve_) {
406
+ v.valve_switch.loop();
407
+ }
408
+ for (auto &vo : this->valve_op_) {
409
+ vo.loop();
410
+ }
411
+ if (this->prev_req_.has_request() && this->prev_req_.valve_operator()->state() == IDLE) {
412
+ this->prev_req_.reset();
413
+ }
414
+ }
415
+
416
+ void Sprinkler::add_valve(SprinklerControllerSwitch *valve_sw, SprinklerControllerSwitch *enable_sw) {
417
+ auto new_valve_number = this->number_of_valves();
418
+ this->valve_.resize(new_valve_number + 1);
419
+ SprinklerValve *new_valve = &this->valve_[new_valve_number];
420
+
421
+ new_valve->controller_switch = valve_sw;
422
+ new_valve->controller_switch->set_state_lambda([this, new_valve_number]() -> optional<bool> {
423
+ if (this->valve_pump_switch(new_valve_number) != nullptr) {
424
+ return this->valve_switch(new_valve_number)->state() && this->valve_pump_switch(new_valve_number)->state();
425
+ }
426
+ return this->valve_switch(new_valve_number)->state();
427
+ });
428
+
429
+ new_valve->valve_turn_off_automation =
430
+ make_unique<Automation<>>(new_valve->controller_switch->get_turn_off_trigger());
431
+ new_valve->valve_shutdown_action = make_unique<sprinkler::ShutdownAction<>>(this);
432
+ new_valve->valve_turn_off_automation->add_actions({new_valve->valve_shutdown_action.get()});
433
+
434
+ new_valve->valve_turn_on_automation = make_unique<Automation<>>(new_valve->controller_switch->get_turn_on_trigger());
435
+ new_valve->valve_resumeorstart_action = make_unique<sprinkler::StartSingleValveAction<>>(this);
436
+ new_valve->valve_resumeorstart_action->set_valve_to_start(new_valve_number);
437
+ new_valve->valve_turn_on_automation->add_actions({new_valve->valve_resumeorstart_action.get()});
438
+
439
+ if (enable_sw != nullptr) {
440
+ new_valve->enable_switch = enable_sw;
441
+ }
442
+ }
443
+
444
+ void Sprinkler::add_controller(Sprinkler *other_controller) { this->other_controllers_.push_back(other_controller); }
445
+
446
+ void Sprinkler::set_controller_main_switch(SprinklerControllerSwitch *controller_switch) {
447
+ this->controller_sw_ = controller_switch;
448
+ controller_switch->set_state_lambda([this]() -> optional<bool> {
449
+ for (size_t valve_number = 0; valve_number < this->number_of_valves(); valve_number++) {
450
+ if (this->valve_[valve_number].controller_switch->state) {
451
+ return true;
452
+ }
453
+ }
454
+ return this->active_req_.has_request();
455
+ });
456
+
457
+ this->sprinkler_turn_off_automation_ = make_unique<Automation<>>(controller_switch->get_turn_off_trigger());
458
+ this->sprinkler_shutdown_action_ = make_unique<sprinkler::ShutdownAction<>>(this);
459
+ this->sprinkler_turn_off_automation_->add_actions({sprinkler_shutdown_action_.get()});
460
+
461
+ this->sprinkler_turn_on_automation_ = make_unique<Automation<>>(controller_switch->get_turn_on_trigger());
462
+ this->sprinkler_resumeorstart_action_ = make_unique<sprinkler::ResumeOrStartAction<>>(this);
463
+ this->sprinkler_turn_on_automation_->add_actions({sprinkler_resumeorstart_action_.get()});
464
+ }
465
+
466
+ void Sprinkler::set_controller_auto_adv_switch(SprinklerControllerSwitch *auto_adv_switch) {
467
+ this->auto_adv_sw_ = auto_adv_switch;
468
+ }
469
+
470
+ void Sprinkler::set_controller_queue_enable_switch(SprinklerControllerSwitch *queue_enable_switch) {
471
+ this->queue_enable_sw_ = queue_enable_switch;
472
+ }
473
+
474
+ void Sprinkler::set_controller_reverse_switch(SprinklerControllerSwitch *reverse_switch) {
475
+ this->reverse_sw_ = reverse_switch;
476
+ }
477
+
478
+ void Sprinkler::set_controller_standby_switch(SprinklerControllerSwitch *standby_switch) {
479
+ this->standby_sw_ = standby_switch;
480
+
481
+ this->sprinkler_standby_turn_on_automation_ = make_unique<Automation<>>(standby_switch->get_turn_on_trigger());
482
+ this->sprinkler_standby_shutdown_action_ = make_unique<sprinkler::ShutdownAction<>>(this);
483
+ this->sprinkler_standby_turn_on_automation_->add_actions({sprinkler_standby_shutdown_action_.get()});
484
+ }
485
+
486
+ void Sprinkler::set_controller_multiplier_number(SprinklerControllerNumber *multiplier_number) {
487
+ this->multiplier_number_ = multiplier_number;
488
+ }
489
+
490
+ void Sprinkler::set_controller_repeat_number(SprinklerControllerNumber *repeat_number) {
491
+ this->repeat_number_ = repeat_number;
492
+ }
493
+
494
+ void Sprinkler::configure_valve_switch(size_t valve_number, switch_::Switch *valve_switch, uint32_t run_duration) {
495
+ if (this->is_a_valid_valve(valve_number)) {
496
+ this->valve_[valve_number].valve_switch.set_on_switch(valve_switch);
497
+ this->valve_[valve_number].run_duration = run_duration;
498
+ }
499
+ }
500
+
501
+ void Sprinkler::configure_valve_switch_pulsed(size_t valve_number, switch_::Switch *valve_switch_off,
502
+ switch_::Switch *valve_switch_on, uint32_t pulse_duration,
503
+ uint32_t run_duration) {
504
+ if (this->is_a_valid_valve(valve_number)) {
505
+ this->valve_[valve_number].valve_switch.set_off_switch(valve_switch_off);
506
+ this->valve_[valve_number].valve_switch.set_on_switch(valve_switch_on);
507
+ this->valve_[valve_number].valve_switch.set_pulse_duration(pulse_duration);
508
+ this->valve_[valve_number].run_duration = run_duration;
509
+ }
510
+ }
511
+
512
+ void Sprinkler::configure_valve_pump_switch(size_t valve_number, switch_::Switch *pump_switch) {
513
+ if (this->is_a_valid_valve(valve_number)) {
514
+ for (size_t i = 0; i < this->pump_.size(); i++) { // check each existing registered pump
515
+ if (this->pump_[i].on_switch() == pump_switch) { // if the "new" pump matches one we already have...
516
+ this->valve_[valve_number].pump_switch_index = i; // ...save its index in the SprinklerSwitch vector pump_...
517
+ return; // ...and we are done
518
+ }
519
+ } // if we end up here, no pumps matched, so add a new one and set the valve's SprinklerSwitch at it
520
+ this->pump_.resize(this->pump_.size() + 1);
521
+ this->pump_.back().set_on_switch(pump_switch);
522
+ this->valve_[valve_number].pump_switch_index = this->pump_.size() - 1; // save the index to the new pump
523
+ }
524
+ }
525
+
526
+ void Sprinkler::configure_valve_pump_switch_pulsed(size_t valve_number, switch_::Switch *pump_switch_off,
527
+ switch_::Switch *pump_switch_on, uint32_t pulse_duration) {
528
+ if (this->is_a_valid_valve(valve_number)) {
529
+ for (size_t i = 0; i < this->pump_.size(); i++) { // check each existing registered pump
530
+ if ((this->pump_[i].off_switch() == pump_switch_off) &&
531
+ (this->pump_[i].on_switch() == pump_switch_on)) { // if the "new" pump matches one we already have...
532
+ this->valve_[valve_number].pump_switch_index = i; // ...save its index in the SprinklerSwitch vector pump_...
533
+ return; // ...and we are done
534
+ }
535
+ } // if we end up here, no pumps matched, so add a new one and set the valve's SprinklerSwitch at it
536
+ this->pump_.resize(this->pump_.size() + 1);
537
+ this->pump_.back().set_off_switch(pump_switch_off);
538
+ this->pump_.back().set_on_switch(pump_switch_on);
539
+ this->pump_.back().set_pulse_duration(pulse_duration);
540
+ this->valve_[valve_number].pump_switch_index = this->pump_.size() - 1; // save the index to the new pump
541
+ }
542
+ }
543
+
544
+ void Sprinkler::configure_valve_run_duration_number(size_t valve_number,
545
+ SprinklerControllerNumber *run_duration_number) {
546
+ if (this->is_a_valid_valve(valve_number)) {
547
+ this->valve_[valve_number].run_duration_number = run_duration_number;
548
+ }
549
+ }
550
+
551
+ void Sprinkler::set_divider(optional<uint32_t> divider) {
552
+ if (!divider.has_value()) {
553
+ return;
554
+ }
555
+ if (divider.value() > 0) {
556
+ this->set_multiplier(1.0 / divider.value());
557
+ this->set_repeat(divider.value() - 1);
558
+ } else if (divider.value() == 0) {
559
+ this->set_multiplier(1.0);
560
+ this->set_repeat(0);
561
+ }
562
+ }
563
+
564
+ void Sprinkler::set_multiplier(const optional<float> multiplier) {
565
+ if ((!multiplier.has_value()) || (multiplier.value() < 0)) {
566
+ return;
567
+ }
568
+ this->multiplier_ = multiplier.value();
569
+ if (this->multiplier_number_ == nullptr) {
570
+ return;
571
+ }
572
+ if (this->multiplier_number_->state == multiplier.value()) {
573
+ return;
574
+ }
575
+ auto call = this->multiplier_number_->make_call();
576
+ call.set_value(multiplier.value());
577
+ call.perform();
578
+ }
579
+
580
+ void Sprinkler::set_next_prev_ignore_disabled_valves(bool ignore_disabled) {
581
+ this->next_prev_ignore_disabled_ = ignore_disabled;
582
+ }
583
+
584
+ void Sprinkler::set_pump_start_delay(uint32_t start_delay) {
585
+ this->start_delay_is_valve_delay_ = false;
586
+ this->start_delay_ = start_delay;
587
+ }
588
+
589
+ void Sprinkler::set_pump_stop_delay(uint32_t stop_delay) {
590
+ this->stop_delay_is_valve_delay_ = false;
591
+ this->stop_delay_ = stop_delay;
592
+ }
593
+
594
+ void Sprinkler::set_valve_start_delay(uint32_t start_delay) {
595
+ this->start_delay_is_valve_delay_ = true;
596
+ this->start_delay_ = start_delay;
597
+ }
598
+
599
+ void Sprinkler::set_valve_stop_delay(uint32_t stop_delay) {
600
+ this->stop_delay_is_valve_delay_ = true;
601
+ this->stop_delay_ = stop_delay;
602
+ }
603
+
604
+ void Sprinkler::set_pump_switch_off_during_valve_open_delay(bool pump_switch_off_during_valve_open_delay) {
605
+ this->pump_switch_off_during_valve_open_delay_ = pump_switch_off_during_valve_open_delay;
606
+ }
607
+
608
+ void Sprinkler::set_valve_open_delay(const uint32_t valve_open_delay) {
609
+ if (valve_open_delay > 0) {
610
+ this->valve_overlap_ = false;
611
+ this->switching_delay_ = valve_open_delay;
612
+ } else {
613
+ this->switching_delay_.reset();
614
+ }
615
+ }
616
+
617
+ void Sprinkler::set_valve_overlap(uint32_t valve_overlap) {
618
+ if (valve_overlap > 0) {
619
+ this->valve_overlap_ = true;
620
+ this->switching_delay_ = valve_overlap;
621
+ } else {
622
+ this->switching_delay_.reset();
623
+ }
624
+ this->pump_switch_off_during_valve_open_delay_ = false; // incompatible option
625
+ }
626
+
627
+ void Sprinkler::set_manual_selection_delay(uint32_t manual_selection_delay) {
628
+ if (manual_selection_delay > 0) {
629
+ this->manual_selection_delay_ = manual_selection_delay;
630
+ } else {
631
+ this->manual_selection_delay_.reset();
632
+ }
633
+ }
634
+
635
+ void Sprinkler::set_valve_run_duration(const optional<size_t> valve_number, const optional<uint32_t> run_duration) {
636
+ if (!valve_number.has_value() || !run_duration.has_value()) {
637
+ return;
638
+ }
639
+ if (!this->is_a_valid_valve(valve_number.value())) {
640
+ return;
641
+ }
642
+ this->valve_[valve_number.value()].run_duration = run_duration.value();
643
+ if (this->valve_[valve_number.value()].run_duration_number == nullptr) {
644
+ return;
645
+ }
646
+ if (this->valve_[valve_number.value()].run_duration_number->state == run_duration.value()) {
647
+ return;
648
+ }
649
+ auto call = this->valve_[valve_number.value()].run_duration_number->make_call();
650
+ if (this->valve_[valve_number.value()].run_duration_number->traits.get_unit_of_measurement() == MIN_STR) {
651
+ call.set_value(run_duration.value() / 60.0);
652
+ } else {
653
+ call.set_value(run_duration.value());
654
+ }
655
+ call.perform();
656
+ }
657
+
658
+ void Sprinkler::set_auto_advance(const bool auto_advance) {
659
+ if (this->auto_adv_sw_ == nullptr) {
660
+ return;
661
+ }
662
+ if (this->auto_adv_sw_->state == auto_advance) {
663
+ return;
664
+ }
665
+ if (auto_advance) {
666
+ this->auto_adv_sw_->turn_on();
667
+ } else {
668
+ this->auto_adv_sw_->turn_off();
669
+ }
670
+ }
671
+
672
+ void Sprinkler::set_repeat(optional<uint32_t> repeat) {
673
+ this->target_repeats_ = repeat;
674
+ if (this->repeat_number_ == nullptr) {
675
+ return;
676
+ }
677
+ if (this->repeat_number_->state == repeat.value()) {
678
+ return;
679
+ }
680
+ auto call = this->repeat_number_->make_call();
681
+ call.set_value(repeat.value_or(0));
682
+ call.perform();
683
+ }
684
+
685
+ void Sprinkler::set_queue_enable(bool queue_enable) {
686
+ if (this->queue_enable_sw_ == nullptr) {
687
+ return;
688
+ }
689
+ if (this->queue_enable_sw_->state == queue_enable) {
690
+ return;
691
+ }
692
+ if (queue_enable) {
693
+ this->queue_enable_sw_->turn_on();
694
+ } else {
695
+ this->queue_enable_sw_->turn_off();
696
+ }
697
+ }
698
+
699
+ void Sprinkler::set_reverse(const bool reverse) {
700
+ if (this->reverse_sw_ == nullptr) {
701
+ return;
702
+ }
703
+ if (this->reverse_sw_->state == reverse) {
704
+ return;
705
+ }
706
+ if (reverse) {
707
+ this->reverse_sw_->turn_on();
708
+ } else {
709
+ this->reverse_sw_->turn_off();
710
+ }
711
+ }
712
+
713
+ void Sprinkler::set_standby(const bool standby) {
714
+ if (this->standby_sw_ == nullptr) {
715
+ return;
716
+ }
717
+ if (this->standby_sw_->state == standby) {
718
+ return;
719
+ }
720
+ if (standby) {
721
+ this->standby_sw_->turn_on();
722
+ } else {
723
+ this->standby_sw_->turn_off();
724
+ }
725
+ }
726
+
727
+ uint32_t Sprinkler::valve_run_duration(const size_t valve_number) {
728
+ if (!this->is_a_valid_valve(valve_number)) {
729
+ return 0;
730
+ }
731
+ if (this->valve_[valve_number].run_duration_number != nullptr) {
732
+ if (this->valve_[valve_number].run_duration_number->traits.get_unit_of_measurement() == MIN_STR) {
733
+ return static_cast<uint32_t>(roundf(this->valve_[valve_number].run_duration_number->state * 60));
734
+ } else {
735
+ return static_cast<uint32_t>(roundf(this->valve_[valve_number].run_duration_number->state));
736
+ }
737
+ }
738
+ return this->valve_[valve_number].run_duration;
739
+ }
740
+
741
+ uint32_t Sprinkler::valve_run_duration_adjusted(const size_t valve_number) {
742
+ uint32_t run_duration = 0;
743
+
744
+ if (this->is_a_valid_valve(valve_number)) {
745
+ run_duration = this->valve_run_duration(valve_number);
746
+ }
747
+ run_duration = static_cast<uint32_t>(roundf(run_duration * this->multiplier()));
748
+ // run_duration must not be less than any of these
749
+ if ((run_duration < this->start_delay_) || (run_duration < this->stop_delay_) ||
750
+ (run_duration < this->switching_delay_.value_or(0) * 2)) {
751
+ return std::max(this->switching_delay_.value_or(0) * 2, std::max(this->start_delay_, this->stop_delay_));
752
+ }
753
+ return run_duration;
754
+ }
755
+
756
+ bool Sprinkler::auto_advance() {
757
+ if (this->auto_adv_sw_ != nullptr) {
758
+ return this->auto_adv_sw_->state;
759
+ }
760
+ return true;
761
+ }
762
+
763
+ float Sprinkler::multiplier() {
764
+ if (this->multiplier_number_ != nullptr) {
765
+ return this->multiplier_number_->state;
766
+ }
767
+ return this->multiplier_;
768
+ }
769
+
770
+ optional<uint32_t> Sprinkler::repeat() {
771
+ if (this->repeat_number_ != nullptr) {
772
+ return static_cast<uint32_t>(roundf(this->repeat_number_->state));
773
+ }
774
+ return this->target_repeats_;
775
+ }
776
+
777
+ optional<uint32_t> Sprinkler::repeat_count() {
778
+ // if there is an active valve and auto-advance is enabled, we may be repeating, so return the count
779
+ if (this->active_req_.has_request() && this->auto_advance()) {
780
+ return this->repeat_count_;
781
+ }
782
+ return nullopt;
783
+ }
784
+
785
+ bool Sprinkler::queue_enabled() {
786
+ if (this->queue_enable_sw_ != nullptr) {
787
+ return this->queue_enable_sw_->state;
788
+ }
789
+ return true;
790
+ }
791
+
792
+ bool Sprinkler::reverse() {
793
+ if (this->reverse_sw_ != nullptr) {
794
+ return this->reverse_sw_->state;
795
+ }
796
+ return false;
797
+ }
798
+
799
+ bool Sprinkler::standby() {
800
+ if (this->standby_sw_ != nullptr) {
801
+ return this->standby_sw_->state;
802
+ }
803
+ return false;
804
+ }
805
+
806
+ void Sprinkler::start_from_queue() {
807
+ if (this->standby()) {
808
+ ESP_LOGD(TAG, "start_from_queue called but standby is enabled; no action taken");
809
+ return;
810
+ }
811
+ if (this->multiplier() == 0) {
812
+ ESP_LOGD(TAG, "start_from_queue called but multiplier is set to zero; no action taken");
813
+ return;
814
+ }
815
+ if (this->queued_valves_.empty()) {
816
+ return; // if there is nothing in the queue, don't do anything
817
+ }
818
+ if (this->queue_enabled() && this->active_valve().has_value()) {
819
+ return; // if there is already a valve running from the queue, do nothing
820
+ }
821
+
822
+ this->set_auto_advance(false);
823
+ this->set_queue_enable(true);
824
+
825
+ this->reset_cycle_states_(); // just in case auto-advance is switched on later
826
+ this->repeat_count_ = 0;
827
+ this->fsm_kick_(); // will automagically pick up from the queue (it has priority)
828
+ }
829
+
830
+ void Sprinkler::start_full_cycle() {
831
+ if (this->standby()) {
832
+ ESP_LOGD(TAG, "start_full_cycle called but standby is enabled; no action taken");
833
+ return;
834
+ }
835
+ if (this->multiplier() == 0) {
836
+ ESP_LOGD(TAG, "start_full_cycle called but multiplier is set to zero; no action taken");
837
+ return;
838
+ }
839
+ if (this->auto_advance() && this->active_valve().has_value()) {
840
+ return; // if auto-advance is already enabled and there is already a valve running, do nothing
841
+ }
842
+
843
+ this->set_queue_enable(false);
844
+
845
+ this->prep_full_cycle_();
846
+ this->repeat_count_ = 0;
847
+ // if there is no active valve already, start the first valve in the cycle
848
+ if (!this->active_req_.has_request()) {
849
+ this->fsm_kick_();
850
+ }
851
+ }
852
+
853
+ void Sprinkler::start_single_valve(const optional<size_t> valve_number, optional<uint32_t> run_duration) {
854
+ if (this->standby()) {
855
+ ESP_LOGD(TAG, "start_single_valve called but standby is enabled; no action taken");
856
+ return;
857
+ }
858
+ if (this->multiplier() == 0) {
859
+ ESP_LOGD(TAG, "start_single_valve called but multiplier is set to zero; no action taken");
860
+ return;
861
+ }
862
+ if (!valve_number.has_value() || (valve_number == this->active_valve())) {
863
+ return;
864
+ }
865
+
866
+ this->set_auto_advance(false);
867
+ this->set_queue_enable(false);
868
+
869
+ this->reset_cycle_states_(); // just in case auto-advance is switched on later
870
+ this->repeat_count_ = 0;
871
+ this->fsm_request_(valve_number.value(), run_duration.value_or(0));
872
+ }
873
+
874
+ void Sprinkler::queue_valve(optional<size_t> valve_number, optional<uint32_t> run_duration) {
875
+ if (valve_number.has_value()) {
876
+ if (this->is_a_valid_valve(valve_number.value()) && (this->queued_valves_.size() < this->max_queue_size_)) {
877
+ SprinklerQueueItem item{valve_number.value(), run_duration.value()};
878
+ this->queued_valves_.insert(this->queued_valves_.begin(), item);
879
+ ESP_LOGD(TAG, "Valve %zu placed into queue with run duration of %" PRIu32 " seconds", valve_number.value_or(0),
880
+ run_duration.value_or(0));
881
+ }
882
+ }
883
+ }
884
+
885
+ void Sprinkler::clear_queued_valves() {
886
+ this->queued_valves_.clear();
887
+ ESP_LOGD(TAG, "Queue cleared");
888
+ }
889
+
890
+ void Sprinkler::next_valve() {
891
+ if (this->state_ == IDLE) {
892
+ this->reset_cycle_states_(); // just in case auto-advance is switched on later
893
+ }
894
+
895
+ this->manual_valve_ = this->next_valve_number_(
896
+ this->manual_valve_.value_or(this->active_req_.valve_as_opt().value_or(this->number_of_valves() - 1)),
897
+ !this->next_prev_ignore_disabled_, true);
898
+
899
+ if (!this->manual_valve_.has_value()) {
900
+ ESP_LOGD(TAG, "next_valve was called but no valve could be started; perhaps next_prev_ignore_disabled allows only "
901
+ "enabled valves and no valves are enabled?");
902
+ return;
903
+ }
904
+
905
+ if (this->manual_selection_delay_.has_value()) {
906
+ this->set_timer_duration_(sprinkler::TIMER_VALVE_SELECTION, this->manual_selection_delay_.value());
907
+ this->start_timer_(sprinkler::TIMER_VALVE_SELECTION);
908
+ } else {
909
+ this->fsm_request_(this->manual_valve_.value());
910
+ }
911
+ }
912
+
913
+ void Sprinkler::previous_valve() {
914
+ if (this->state_ == IDLE) {
915
+ this->reset_cycle_states_(); // just in case auto-advance is switched on later
916
+ }
917
+
918
+ this->manual_valve_ =
919
+ this->previous_valve_number_(this->manual_valve_.value_or(this->active_req_.valve_as_opt().value_or(0)),
920
+ !this->next_prev_ignore_disabled_, true);
921
+
922
+ if (!this->manual_valve_.has_value()) {
923
+ ESP_LOGD(TAG, "previous_valve was called but no valve could be started; perhaps next_prev_ignore_disabled allows "
924
+ "only enabled valves and no valves are enabled?");
925
+ return;
926
+ }
927
+
928
+ if (this->manual_selection_delay_.has_value()) {
929
+ this->set_timer_duration_(sprinkler::TIMER_VALVE_SELECTION, this->manual_selection_delay_.value());
930
+ this->start_timer_(sprinkler::TIMER_VALVE_SELECTION);
931
+ } else {
932
+ this->fsm_request_(this->manual_valve_.value());
933
+ }
934
+ }
935
+
936
+ void Sprinkler::shutdown(bool clear_queue) {
937
+ this->cancel_timer_(sprinkler::TIMER_VALVE_SELECTION);
938
+ this->active_req_.reset();
939
+ this->manual_valve_.reset();
940
+ this->next_req_.reset();
941
+ for (auto &vo : this->valve_op_) {
942
+ vo.stop();
943
+ }
944
+ this->fsm_transition_to_shutdown_();
945
+ if (clear_queue) {
946
+ this->clear_queued_valves();
947
+ this->repeat_count_ = 0;
948
+ }
949
+ }
950
+
951
+ void Sprinkler::pause() {
952
+ if (this->paused_valve_.has_value() || !this->active_req_.has_request()) {
953
+ return; // we can't pause if we're already paused or if there is no active valve
954
+ }
955
+ this->paused_valve_ = this->active_valve();
956
+ this->resume_duration_ = this->time_remaining_active_valve();
957
+ this->shutdown(false);
958
+ ESP_LOGD(TAG, "Paused valve %zu with %" PRIu32 " seconds remaining", this->paused_valve_.value_or(0),
959
+ this->resume_duration_.value_or(0));
960
+ }
961
+
962
+ void Sprinkler::resume() {
963
+ if (this->standby()) {
964
+ ESP_LOGD(TAG, "resume called but standby is enabled; no action taken");
965
+ return;
966
+ }
967
+
968
+ if (this->paused_valve_.has_value() && (this->resume_duration_.has_value())) {
969
+ // Resume only if valve has not been completed yet
970
+ if (!this->valve_cycle_complete_(this->paused_valve_.value())) {
971
+ ESP_LOGD(TAG, "Resuming valve %zu with %" PRIu32 " seconds remaining", this->paused_valve_.value_or(0),
972
+ this->resume_duration_.value_or(0));
973
+ this->fsm_request_(this->paused_valve_.value(), this->resume_duration_.value());
974
+ }
975
+ this->reset_resume();
976
+ } else {
977
+ ESP_LOGD(TAG, "No valve to resume!");
978
+ }
979
+ }
980
+
981
+ void Sprinkler::resume_or_start_full_cycle() {
982
+ if (this->paused_valve_.has_value() && (this->resume_duration_.has_value())) {
983
+ this->resume();
984
+ } else {
985
+ this->start_full_cycle();
986
+ }
987
+ }
988
+
989
+ void Sprinkler::reset_resume() {
990
+ this->paused_valve_.reset();
991
+ this->resume_duration_.reset();
992
+ }
993
+
994
+ const char *Sprinkler::valve_name(const size_t valve_number) {
995
+ if (this->is_a_valid_valve(valve_number)) {
996
+ return this->valve_[valve_number].controller_switch->get_name().c_str();
997
+ }
998
+ return nullptr;
999
+ }
1000
+
1001
+ optional<SprinklerValveRunRequestOrigin> Sprinkler::active_valve_request_is_from() {
1002
+ if (this->active_req_.has_request()) {
1003
+ return this->active_req_.request_is_from();
1004
+ }
1005
+ return nullopt;
1006
+ }
1007
+
1008
+ optional<size_t> Sprinkler::active_valve() {
1009
+ if (!this->valve_overlap_ && this->prev_req_.has_request() &&
1010
+ (this->prev_req_.valve_operator()->state() == STARTING || this->prev_req_.valve_operator()->state() == ACTIVE)) {
1011
+ return this->prev_req_.valve_as_opt();
1012
+ }
1013
+ return this->active_req_.valve_as_opt();
1014
+ }
1015
+
1016
+ optional<size_t> Sprinkler::paused_valve() { return this->paused_valve_; }
1017
+
1018
+ optional<size_t> Sprinkler::queued_valve() {
1019
+ if (!this->queued_valves_.empty()) {
1020
+ return this->queued_valves_.back().valve_number;
1021
+ }
1022
+ return nullopt;
1023
+ }
1024
+
1025
+ optional<size_t> Sprinkler::manual_valve() { return this->manual_valve_; }
1026
+
1027
+ size_t Sprinkler::number_of_valves() { return this->valve_.size(); }
1028
+
1029
+ bool Sprinkler::is_a_valid_valve(const size_t valve_number) {
1030
+ return ((valve_number >= 0) && (valve_number < this->number_of_valves()));
1031
+ }
1032
+
1033
+ bool Sprinkler::pump_in_use(SprinklerSwitch *pump_switch) {
1034
+ if (pump_switch == nullptr) {
1035
+ return false; // we can't do anything if there's nothing to check
1036
+ }
1037
+ // a pump must be considered "in use" if a (distribution) valve it supplies is active. this means:
1038
+ // - at least one SprinklerValveOperator:
1039
+ // - has a valve loaded that depends on this pump
1040
+ // - is in a state that depends on the pump: (ACTIVE and _possibly_ STARTING/STOPPING)
1041
+ // - if NO SprinklerValveOperator is active but there is a run request pending (active_req_.has_request()) and the
1042
+ // controller state is STARTING, valve open delay is configured but NOT pump_switch_off_during_valve_open_delay_
1043
+ for (auto &vo : this->valve_op_) { // first, check if any SprinklerValveOperator has a valve dependent on this pump
1044
+ if ((vo.state() != BYPASS) && (vo.pump_switch() != nullptr)) {
1045
+ // the SprinklerValveOperator is configured with a pump; now check if it is the pump of interest
1046
+ if ((vo.pump_switch()->off_switch() == pump_switch->off_switch()) &&
1047
+ (vo.pump_switch()->on_switch() == pump_switch->on_switch())) {
1048
+ // now if the SprinklerValveOperator has a pump and it is either ACTIVE, is STARTING with a valve delay or
1049
+ // is STOPPING with a valve delay, its pump can be considered "in use", so just return indicating this now
1050
+ if ((vo.state() == ACTIVE) ||
1051
+ ((vo.state() == STARTING) && this->start_delay_ && this->start_delay_is_valve_delay_) ||
1052
+ ((vo.state() == STOPPING) && this->stop_delay_ && this->stop_delay_is_valve_delay_)) {
1053
+ return true;
1054
+ }
1055
+ }
1056
+ }
1057
+ } // if we end up here, no SprinklerValveOperator was in a "give-away" state indicating that the pump is in use...
1058
+ if (!this->valve_overlap_ && !this->pump_switch_off_during_valve_open_delay_ && this->switching_delay_.has_value() &&
1059
+ this->active_req_.has_request() && (this->state_ != STOPPING)) {
1060
+ // ...the controller is configured to keep the pump on during a valve open delay, so just return
1061
+ // whether or not the next valve shares the same pump
1062
+ return (pump_switch->off_switch() == this->valve_pump_switch(this->active_req_.valve())->off_switch()) &&
1063
+ (pump_switch->on_switch() == this->valve_pump_switch(this->active_req_.valve())->on_switch());
1064
+ }
1065
+ return false;
1066
+ }
1067
+
1068
+ void Sprinkler::set_pump_state(SprinklerSwitch *pump_switch, bool state) {
1069
+ if (pump_switch == nullptr) {
1070
+ return; // we can't do anything if there's nothing to check
1071
+ }
1072
+
1073
+ bool hold_pump_on = false;
1074
+
1075
+ for (auto &controller : this->other_controllers_) { // check if the pump is in use by another controller
1076
+ if (controller != this) { // dummy check
1077
+ if (controller->pump_in_use(pump_switch)) {
1078
+ hold_pump_on = true; // if another controller says it's using this pump, keep it on
1079
+ // at this point we know if there exists another SprinklerSwitch that is "on" with its
1080
+ // off_switch_ and on_switch_ pointers pointing to the same pair of switch objects
1081
+ }
1082
+ }
1083
+ }
1084
+ if (hold_pump_on) {
1085
+ // at this point we know if there exists another SprinklerSwitch that is "on" with its
1086
+ // off_switch_ and on_switch_ pointers pointing to the same pair of switch objects...
1087
+ pump_switch->sync_valve_state(true); // ...so ensure our state is consistent
1088
+ ESP_LOGD(TAG, "Leaving pump on because another controller instance is using it");
1089
+ }
1090
+
1091
+ if (state) { // ...and now we can set the new state of the switch
1092
+ pump_switch->turn_on();
1093
+ } else if (!hold_pump_on && !this->pump_in_use(pump_switch)) {
1094
+ pump_switch->turn_off();
1095
+ } else if (hold_pump_on) { // we must assume the other controller will switch off the pump when done...
1096
+ pump_switch->sync_valve_state(false); // ...this only impacts latching valves
1097
+ }
1098
+ }
1099
+
1100
+ uint32_t Sprinkler::total_cycle_time_all_valves() {
1101
+ uint32_t total_time_remaining = 0;
1102
+
1103
+ for (size_t valve = 0; valve < this->number_of_valves(); valve++) {
1104
+ total_time_remaining += this->valve_run_duration_adjusted(valve);
1105
+ }
1106
+
1107
+ if (this->valve_overlap_) {
1108
+ total_time_remaining -= this->switching_delay_.value_or(0) * (this->number_of_valves() - 1);
1109
+ } else {
1110
+ total_time_remaining += this->switching_delay_.value_or(0) * (this->number_of_valves() - 1);
1111
+ }
1112
+
1113
+ return total_time_remaining;
1114
+ }
1115
+
1116
+ uint32_t Sprinkler::total_cycle_time_enabled_valves() {
1117
+ uint32_t total_time_remaining = 0;
1118
+ uint32_t valve_count = 0;
1119
+
1120
+ for (size_t valve = 0; valve < this->number_of_valves(); valve++) {
1121
+ if (this->valve_is_enabled_(valve)) {
1122
+ total_time_remaining += this->valve_run_duration_adjusted(valve);
1123
+ valve_count++;
1124
+ }
1125
+ }
1126
+
1127
+ if (valve_count) {
1128
+ if (this->valve_overlap_) {
1129
+ total_time_remaining -= this->switching_delay_.value_or(0) * (valve_count - 1);
1130
+ } else {
1131
+ total_time_remaining += this->switching_delay_.value_or(0) * (valve_count - 1);
1132
+ }
1133
+ }
1134
+
1135
+ return total_time_remaining;
1136
+ }
1137
+
1138
+ uint32_t Sprinkler::total_cycle_time_enabled_incomplete_valves() {
1139
+ uint32_t total_time_remaining = 0;
1140
+ uint32_t enabled_valve_count = 0;
1141
+ uint32_t incomplete_valve_count = 0;
1142
+
1143
+ for (size_t valve = 0; valve < this->number_of_valves(); valve++) {
1144
+ if (this->valve_is_enabled_(valve)) {
1145
+ enabled_valve_count++;
1146
+ if (!this->valve_cycle_complete_(valve)) {
1147
+ if (!this->active_valve().has_value() || (valve != this->active_valve().value())) {
1148
+ total_time_remaining += this->valve_run_duration_adjusted(valve);
1149
+ incomplete_valve_count++;
1150
+ } else {
1151
+ // to get here, there must be an active valve and this valve must be equal to 'valve'
1152
+ if (this->active_req_.valve_operator() == nullptr) { // no SVO has been assigned yet so it hasn't started
1153
+ total_time_remaining += this->valve_run_duration_adjusted(valve);
1154
+ incomplete_valve_count++;
1155
+ }
1156
+ }
1157
+ }
1158
+ }
1159
+ }
1160
+
1161
+ if (incomplete_valve_count >= enabled_valve_count) {
1162
+ incomplete_valve_count--;
1163
+ }
1164
+ if (incomplete_valve_count) {
1165
+ if (this->valve_overlap_) {
1166
+ total_time_remaining -= this->switching_delay_.value_or(0) * incomplete_valve_count;
1167
+ } else {
1168
+ total_time_remaining += this->switching_delay_.value_or(0) * incomplete_valve_count;
1169
+ }
1170
+ }
1171
+
1172
+ return total_time_remaining;
1173
+ }
1174
+
1175
+ uint32_t Sprinkler::total_queue_time() {
1176
+ uint32_t total_time_remaining = 0;
1177
+ uint32_t valve_count = 0;
1178
+
1179
+ for (auto &valve : this->queued_valves_) {
1180
+ if (valve.run_duration) {
1181
+ total_time_remaining += valve.run_duration;
1182
+ } else {
1183
+ total_time_remaining += this->valve_run_duration_adjusted(valve.valve_number);
1184
+ }
1185
+ valve_count++;
1186
+ }
1187
+
1188
+ if (valve_count) {
1189
+ if (this->valve_overlap_) {
1190
+ total_time_remaining -= this->switching_delay_.value_or(0) * (valve_count - 1);
1191
+ } else {
1192
+ total_time_remaining += this->switching_delay_.value_or(0) * (valve_count - 1);
1193
+ }
1194
+ }
1195
+
1196
+ return total_time_remaining;
1197
+ }
1198
+
1199
+ optional<uint32_t> Sprinkler::time_remaining_active_valve() {
1200
+ if (this->active_req_.has_request()) { // first try to return the value based on active_req_...
1201
+ if (this->active_req_.valve_operator() != nullptr) {
1202
+ return this->active_req_.valve_operator()->time_remaining();
1203
+ }
1204
+ }
1205
+ if (this->prev_req_.has_request()) { // try to return the value based on prev_req_...
1206
+ if (this->prev_req_.valve_operator() != nullptr) {
1207
+ return this->prev_req_.valve_operator()->time_remaining();
1208
+ }
1209
+ }
1210
+ return nullopt;
1211
+ }
1212
+
1213
+ optional<uint32_t> Sprinkler::time_remaining_current_operation() {
1214
+ if (!this->time_remaining_active_valve().has_value() && this->state_ == IDLE) {
1215
+ return nullopt;
1216
+ }
1217
+
1218
+ auto total_time_remaining = this->time_remaining_active_valve().value_or(0);
1219
+ if (this->auto_advance()) {
1220
+ total_time_remaining += this->total_cycle_time_enabled_incomplete_valves();
1221
+ if (this->repeat().value_or(0) > 0) {
1222
+ total_time_remaining +=
1223
+ (this->total_cycle_time_enabled_valves() * (this->repeat().value_or(0) - this->repeat_count().value_or(0)));
1224
+ }
1225
+ }
1226
+
1227
+ if (this->queue_enabled()) {
1228
+ total_time_remaining += this->total_queue_time();
1229
+ }
1230
+ return total_time_remaining;
1231
+ }
1232
+
1233
+ bool Sprinkler::any_controller_is_active() {
1234
+ if (this->state_ != IDLE) {
1235
+ return true;
1236
+ }
1237
+
1238
+ for (auto &controller : this->other_controllers_) {
1239
+ if (controller != this) { // dummy check
1240
+ if (controller->controller_state() != IDLE) {
1241
+ return true;
1242
+ }
1243
+ }
1244
+ }
1245
+ return false;
1246
+ }
1247
+
1248
+ SprinklerControllerSwitch *Sprinkler::control_switch(size_t valve_number) {
1249
+ if (this->is_a_valid_valve(valve_number)) {
1250
+ return this->valve_[valve_number].controller_switch;
1251
+ }
1252
+ return nullptr;
1253
+ }
1254
+
1255
+ SprinklerControllerSwitch *Sprinkler::enable_switch(size_t valve_number) {
1256
+ if (this->is_a_valid_valve(valve_number)) {
1257
+ return this->valve_[valve_number].enable_switch;
1258
+ }
1259
+ return nullptr;
1260
+ }
1261
+
1262
+ SprinklerSwitch *Sprinkler::valve_switch(const size_t valve_number) {
1263
+ if (this->is_a_valid_valve(valve_number)) {
1264
+ return &this->valve_[valve_number].valve_switch;
1265
+ }
1266
+ return nullptr;
1267
+ }
1268
+
1269
+ SprinklerSwitch *Sprinkler::valve_pump_switch(const size_t valve_number) {
1270
+ if (this->is_a_valid_valve(valve_number) && this->valve_[valve_number].pump_switch_index.has_value()) {
1271
+ return &this->pump_[this->valve_[valve_number].pump_switch_index.value()];
1272
+ }
1273
+ return nullptr;
1274
+ }
1275
+
1276
+ SprinklerSwitch *Sprinkler::valve_pump_switch_by_pump_index(size_t pump_index) {
1277
+ if (pump_index < this->pump_.size()) {
1278
+ return &this->pump_[pump_index];
1279
+ }
1280
+ return nullptr;
1281
+ }
1282
+
1283
+ bool Sprinkler::valve_is_enabled_(const size_t valve_number) {
1284
+ if (this->is_a_valid_valve(valve_number)) {
1285
+ if (this->valve_[valve_number].enable_switch != nullptr) {
1286
+ return this->valve_[valve_number].enable_switch->state;
1287
+ } else {
1288
+ return true;
1289
+ }
1290
+ }
1291
+ return false;
1292
+ }
1293
+
1294
+ void Sprinkler::mark_valve_cycle_complete_(const size_t valve_number) {
1295
+ if (this->is_a_valid_valve(valve_number)) {
1296
+ ESP_LOGD(TAG, "Marking valve %u complete", valve_number);
1297
+ this->valve_[valve_number].valve_cycle_complete = true;
1298
+ }
1299
+ }
1300
+
1301
+ bool Sprinkler::valve_cycle_complete_(const size_t valve_number) {
1302
+ if (this->is_a_valid_valve(valve_number)) {
1303
+ return this->valve_[valve_number].valve_cycle_complete;
1304
+ }
1305
+ return false;
1306
+ }
1307
+
1308
+ optional<size_t> Sprinkler::next_valve_number_(const optional<size_t> first_valve, const bool include_disabled,
1309
+ const bool include_complete) {
1310
+ auto valve = first_valve.value_or(0);
1311
+ size_t start = first_valve.has_value() ? 1 : 0;
1312
+
1313
+ if (!this->is_a_valid_valve(valve)) {
1314
+ valve = 0;
1315
+ }
1316
+
1317
+ for (size_t offset = start; offset < this->number_of_valves(); offset++) {
1318
+ auto valve_of_interest = valve + offset;
1319
+ if (!this->is_a_valid_valve(valve_of_interest)) {
1320
+ valve_of_interest -= this->number_of_valves();
1321
+ }
1322
+
1323
+ if ((this->valve_is_enabled_(valve_of_interest) || include_disabled) &&
1324
+ (!this->valve_cycle_complete_(valve_of_interest) || include_complete)) {
1325
+ return valve_of_interest;
1326
+ }
1327
+ }
1328
+ return nullopt;
1329
+ }
1330
+
1331
+ optional<size_t> Sprinkler::previous_valve_number_(const optional<size_t> first_valve, const bool include_disabled,
1332
+ const bool include_complete) {
1333
+ auto valve = first_valve.value_or(this->number_of_valves() - 1);
1334
+ size_t start = first_valve.has_value() ? 1 : 0;
1335
+
1336
+ if (!this->is_a_valid_valve(valve)) {
1337
+ valve = this->number_of_valves() - 1;
1338
+ }
1339
+
1340
+ for (size_t offset = start; offset < this->number_of_valves(); offset++) {
1341
+ auto valve_of_interest = valve - offset;
1342
+ if (!this->is_a_valid_valve(valve_of_interest)) {
1343
+ valve_of_interest += this->number_of_valves();
1344
+ }
1345
+
1346
+ if ((this->valve_is_enabled_(valve_of_interest) || include_disabled) &&
1347
+ (!this->valve_cycle_complete_(valve_of_interest) || include_complete)) {
1348
+ return valve_of_interest;
1349
+ }
1350
+ }
1351
+ return nullopt;
1352
+ }
1353
+
1354
+ optional<size_t> Sprinkler::next_valve_number_in_cycle_(const optional<size_t> first_valve) {
1355
+ if (this->reverse()) {
1356
+ return this->previous_valve_number_(first_valve, false, false);
1357
+ }
1358
+ return this->next_valve_number_(first_valve, false, false);
1359
+ }
1360
+
1361
+ void Sprinkler::load_next_valve_run_request_(const optional<size_t> first_valve) {
1362
+ if (this->active_req_.has_request()) {
1363
+ this->prev_req_ = this->active_req_;
1364
+ } else {
1365
+ this->prev_req_.reset();
1366
+ }
1367
+
1368
+ if (this->next_req_.has_request()) {
1369
+ if (!this->next_req_.run_duration()) { // ensure the run duration is set correctly for consumption later on
1370
+ this->next_req_.set_run_duration(this->valve_run_duration_adjusted(this->next_req_.valve()));
1371
+ }
1372
+ return; // there is already a request pending
1373
+ } else if (this->queue_enabled() && !this->queued_valves_.empty()) {
1374
+ this->next_req_.set_valve(this->queued_valves_.back().valve_number);
1375
+ this->next_req_.set_request_from(QUEUE);
1376
+ if (this->queued_valves_.back().run_duration) {
1377
+ this->next_req_.set_run_duration(this->queued_valves_.back().run_duration);
1378
+ this->queued_valves_.pop_back();
1379
+ } else if (this->multiplier()) {
1380
+ this->next_req_.set_run_duration(this->valve_run_duration_adjusted(this->queued_valves_.back().valve_number));
1381
+ this->queued_valves_.pop_back();
1382
+ } else {
1383
+ this->next_req_.reset();
1384
+ }
1385
+ } else if (this->auto_advance() && this->multiplier()) {
1386
+ if (this->next_valve_number_in_cycle_(first_valve).has_value()) {
1387
+ // if there is another valve to run as a part of a cycle, load that
1388
+ this->next_req_.set_valve(this->next_valve_number_in_cycle_(first_valve).value_or(0));
1389
+ this->next_req_.set_request_from(CYCLE);
1390
+ this->next_req_.set_run_duration(
1391
+ this->valve_run_duration_adjusted(this->next_valve_number_in_cycle_(first_valve).value_or(0)));
1392
+ } else if ((this->repeat_count_++ < this->repeat().value_or(0))) {
1393
+ ESP_LOGD(TAG, "Repeating - starting cycle %" PRIu32 " of %" PRIu32, this->repeat_count_ + 1,
1394
+ this->repeat().value_or(0) + 1);
1395
+ // if there are repeats remaining and no more valves were left in the cycle, start a new cycle
1396
+ this->prep_full_cycle_();
1397
+ if (this->next_valve_number_in_cycle_().has_value()) { // this should always succeed here, but just in case...
1398
+ this->next_req_.set_valve(this->next_valve_number_in_cycle_().value_or(0));
1399
+ this->next_req_.set_request_from(CYCLE);
1400
+ this->next_req_.set_run_duration(
1401
+ this->valve_run_duration_adjusted(this->next_valve_number_in_cycle_().value_or(0)));
1402
+ }
1403
+ }
1404
+ }
1405
+ }
1406
+
1407
+ bool Sprinkler::any_valve_is_enabled_() {
1408
+ for (size_t valve_number = 0; valve_number < this->number_of_valves(); valve_number++) {
1409
+ if (this->valve_is_enabled_(valve_number))
1410
+ return true;
1411
+ }
1412
+ return false;
1413
+ }
1414
+
1415
+ void Sprinkler::start_valve_(SprinklerValveRunRequest *req) {
1416
+ if (!req->has_request()) {
1417
+ return; // we can't do anything if the request contains nothing
1418
+ }
1419
+ if (!this->is_a_valid_valve(req->valve())) {
1420
+ return; // we can't do anything if the valve number isn't valid
1421
+ }
1422
+ for (auto &vo : this->valve_op_) { // find the first available SprinklerValveOperator, load it and start it up
1423
+ if (vo.state() == IDLE) {
1424
+ auto run_duration = req->run_duration() ? req->run_duration() : this->valve_run_duration_adjusted(req->valve());
1425
+ ESP_LOGD(TAG, "%s is starting valve %zu for %" PRIu32 " seconds, cycle %" PRIu32 " of %" PRIu32,
1426
+ this->req_as_str_(req->request_is_from()).c_str(), req->valve(), run_duration, this->repeat_count_ + 1,
1427
+ this->repeat().value_or(0) + 1);
1428
+ req->set_valve_operator(&vo);
1429
+ vo.set_controller(this);
1430
+ vo.set_valve(&this->valve_[req->valve()]);
1431
+ vo.set_run_duration(run_duration);
1432
+ vo.set_start_delay(this->start_delay_, this->start_delay_is_valve_delay_);
1433
+ vo.set_stop_delay(this->stop_delay_, this->stop_delay_is_valve_delay_);
1434
+ vo.start();
1435
+ return;
1436
+ }
1437
+ }
1438
+ }
1439
+
1440
+ void Sprinkler::all_valves_off_(const bool include_pump) {
1441
+ for (size_t valve_index = 0; valve_index < this->number_of_valves(); valve_index++) {
1442
+ if (this->valve_[valve_index].valve_switch.state()) {
1443
+ this->valve_[valve_index].valve_switch.turn_off();
1444
+ }
1445
+ if (include_pump) {
1446
+ this->set_pump_state(this->valve_pump_switch(valve_index), false);
1447
+ }
1448
+ }
1449
+ ESP_LOGD(TAG, "All valves stopped%s", include_pump ? ", including pumps" : "");
1450
+ }
1451
+
1452
+ void Sprinkler::prep_full_cycle_() {
1453
+ this->set_auto_advance(true);
1454
+
1455
+ if (!this->any_valve_is_enabled_()) {
1456
+ for (auto &valve : this->valve_) {
1457
+ if (valve.enable_switch != nullptr) {
1458
+ if (!valve.enable_switch->state) {
1459
+ valve.enable_switch->turn_on();
1460
+ }
1461
+ }
1462
+ }
1463
+ }
1464
+ this->reset_cycle_states_();
1465
+ }
1466
+
1467
+ void Sprinkler::reset_cycle_states_() {
1468
+ for (auto &valve : this->valve_) {
1469
+ valve.valve_cycle_complete = false;
1470
+ }
1471
+ }
1472
+
1473
+ void Sprinkler::fsm_request_(size_t requested_valve, uint32_t requested_run_duration) {
1474
+ this->next_req_.set_valve(requested_valve);
1475
+ this->next_req_.set_run_duration(requested_run_duration);
1476
+ // if state is IDLE or ACTIVE, call fsm_transition_() to start it immediately;
1477
+ // otherwise, fsm_transition() will pick up next_req_ at the next appropriate transition
1478
+ this->fsm_kick_();
1479
+ }
1480
+
1481
+ void Sprinkler::fsm_kick_() {
1482
+ if ((this->state_ == IDLE) || (this->state_ == ACTIVE)) {
1483
+ this->fsm_transition_();
1484
+ }
1485
+ }
1486
+
1487
+ void Sprinkler::fsm_transition_() {
1488
+ ESP_LOGVV(TAG, "fsm_transition_ called; state is %s", this->state_as_str_(this->state_).c_str());
1489
+ switch (this->state_) {
1490
+ case IDLE: // the system was off -> start it up
1491
+ // advances to ACTIVE
1492
+ this->fsm_transition_from_shutdown_();
1493
+ break;
1494
+
1495
+ case ACTIVE:
1496
+ // advances to STOPPING or ACTIVE (again)
1497
+ this->fsm_transition_from_valve_run_();
1498
+ break;
1499
+
1500
+ case STARTING: {
1501
+ // follows valve open delay interval
1502
+ this->set_timer_duration_(sprinkler::TIMER_SM,
1503
+ this->active_req_.run_duration() - this->switching_delay_.value_or(0));
1504
+ this->start_timer_(sprinkler::TIMER_SM);
1505
+ this->start_valve_(&this->active_req_);
1506
+ this->state_ = ACTIVE;
1507
+ if (this->next_req_.has_request()) {
1508
+ // another valve has been requested, so restart the timer so we pick it up quickly
1509
+ this->set_timer_duration_(sprinkler::TIMER_SM, this->manual_selection_delay_.value_or(1));
1510
+ this->start_timer_(sprinkler::TIMER_SM);
1511
+ }
1512
+ break;
1513
+ }
1514
+
1515
+ case STOPPING:
1516
+ // stop_delay_ has elapsed so just shut everything off
1517
+ this->active_req_.reset();
1518
+ this->manual_valve_.reset();
1519
+ this->all_valves_off_(true);
1520
+ this->state_ = IDLE;
1521
+ break;
1522
+
1523
+ default:
1524
+ break;
1525
+ }
1526
+ if (this->next_req_.has_request() && (this->state_ == IDLE)) {
1527
+ // another valve has been requested, so restart the timer so we pick it up quickly
1528
+ this->set_timer_duration_(sprinkler::TIMER_SM, this->manual_selection_delay_.value_or(1));
1529
+ this->start_timer_(sprinkler::TIMER_SM);
1530
+ }
1531
+ ESP_LOGVV(TAG, "fsm_transition_ complete; new state is %s", this->state_as_str_(this->state_).c_str());
1532
+ }
1533
+
1534
+ void Sprinkler::fsm_transition_from_shutdown_() {
1535
+ this->load_next_valve_run_request_();
1536
+
1537
+ if (this->next_req_.has_request()) { // there is a valve to run...
1538
+ this->active_req_.set_valve(this->next_req_.valve());
1539
+ this->active_req_.set_request_from(this->next_req_.request_is_from());
1540
+ this->active_req_.set_run_duration(this->next_req_.run_duration());
1541
+ this->next_req_.reset();
1542
+
1543
+ this->set_timer_duration_(sprinkler::TIMER_SM,
1544
+ this->active_req_.run_duration() - this->switching_delay_.value_or(0));
1545
+ this->start_timer_(sprinkler::TIMER_SM);
1546
+ this->start_valve_(&this->active_req_);
1547
+ this->state_ = ACTIVE;
1548
+ }
1549
+ }
1550
+
1551
+ void Sprinkler::fsm_transition_from_valve_run_() {
1552
+ if (!this->active_req_.has_request()) { // dummy check...
1553
+ this->fsm_transition_to_shutdown_();
1554
+ return;
1555
+ }
1556
+
1557
+ if (!this->timer_active_(sprinkler::TIMER_SM)) { // only flag the valve as "complete" if the timer finished
1558
+ if ((this->active_req_.request_is_from() == CYCLE) || (this->active_req_.request_is_from() == USER)) {
1559
+ this->mark_valve_cycle_complete_(this->active_req_.valve());
1560
+ }
1561
+ } else {
1562
+ ESP_LOGD(TAG, "Valve cycle interrupted - NOT flagging valve as complete and stopping current valve");
1563
+ for (auto &vo : this->valve_op_) {
1564
+ vo.stop();
1565
+ }
1566
+ }
1567
+
1568
+ this->load_next_valve_run_request_(this->active_req_.valve());
1569
+
1570
+ if (this->next_req_.has_request()) { // there is another valve to run...
1571
+ bool same_pump =
1572
+ this->valve_pump_switch(this->active_req_.valve()) == this->valve_pump_switch(this->next_req_.valve());
1573
+
1574
+ this->active_req_.set_valve(this->next_req_.valve());
1575
+ this->active_req_.set_request_from(this->next_req_.request_is_from());
1576
+ this->active_req_.set_run_duration(this->next_req_.run_duration());
1577
+ this->next_req_.reset();
1578
+
1579
+ // this->state_ = ACTIVE; // state isn't changing
1580
+ if (this->valve_overlap_ || !this->switching_delay_.has_value()) {
1581
+ this->set_timer_duration_(sprinkler::TIMER_SM,
1582
+ this->active_req_.run_duration() - this->switching_delay_.value_or(0));
1583
+ this->start_timer_(sprinkler::TIMER_SM);
1584
+ this->start_valve_(&this->active_req_);
1585
+ } else {
1586
+ this->set_timer_duration_(
1587
+ sprinkler::TIMER_SM,
1588
+ this->switching_delay_.value() * 2 +
1589
+ (this->pump_switch_off_during_valve_open_delay_ && same_pump ? this->stop_delay_ : 0));
1590
+ this->start_timer_(sprinkler::TIMER_SM);
1591
+ this->state_ = STARTING;
1592
+ }
1593
+ } else { // there is NOT another valve to run...
1594
+ this->fsm_transition_to_shutdown_();
1595
+ }
1596
+ }
1597
+
1598
+ void Sprinkler::fsm_transition_to_shutdown_() {
1599
+ this->state_ = STOPPING;
1600
+ this->set_timer_duration_(sprinkler::TIMER_SM,
1601
+ this->start_delay_ + this->stop_delay_ + this->switching_delay_.value_or(0) + 1);
1602
+ this->start_timer_(sprinkler::TIMER_SM);
1603
+ }
1604
+
1605
+ std::string Sprinkler::req_as_str_(SprinklerValveRunRequestOrigin origin) {
1606
+ switch (origin) {
1607
+ case USER:
1608
+ return "USER";
1609
+
1610
+ case CYCLE:
1611
+ return "CYCLE";
1612
+
1613
+ case QUEUE:
1614
+ return "QUEUE";
1615
+
1616
+ default:
1617
+ return "UNKNOWN";
1618
+ }
1619
+ }
1620
+
1621
+ std::string Sprinkler::state_as_str_(SprinklerState state) {
1622
+ switch (state) {
1623
+ case IDLE:
1624
+ return "IDLE";
1625
+
1626
+ case STARTING:
1627
+ return "STARTING";
1628
+
1629
+ case ACTIVE:
1630
+ return "ACTIVE";
1631
+
1632
+ case STOPPING:
1633
+ return "STOPPING";
1634
+
1635
+ case BYPASS:
1636
+ return "BYPASS";
1637
+
1638
+ default:
1639
+ return "UNKNOWN";
1640
+ }
1641
+ }
1642
+
1643
+ void Sprinkler::start_timer_(const SprinklerTimerIndex timer_index) {
1644
+ if (this->timer_duration_(timer_index) > 0) {
1645
+ this->set_timeout(this->timer_[timer_index].name, this->timer_duration_(timer_index),
1646
+ this->timer_cbf_(timer_index));
1647
+ this->timer_[timer_index].start_time = millis();
1648
+ this->timer_[timer_index].active = true;
1649
+ }
1650
+ ESP_LOGVV(TAG, "Timer %zu started for %" PRIu32 " sec", static_cast<size_t>(timer_index),
1651
+ this->timer_duration_(timer_index) / 1000);
1652
+ }
1653
+
1654
+ bool Sprinkler::cancel_timer_(const SprinklerTimerIndex timer_index) {
1655
+ this->timer_[timer_index].active = false;
1656
+ return this->cancel_timeout(this->timer_[timer_index].name);
1657
+ }
1658
+
1659
+ bool Sprinkler::timer_active_(const SprinklerTimerIndex timer_index) { return this->timer_[timer_index].active; }
1660
+
1661
+ void Sprinkler::set_timer_duration_(const SprinklerTimerIndex timer_index, const uint32_t time) {
1662
+ this->timer_[timer_index].time = 1000 * time;
1663
+ }
1664
+
1665
+ uint32_t Sprinkler::timer_duration_(const SprinklerTimerIndex timer_index) { return this->timer_[timer_index].time; }
1666
+
1667
+ std::function<void()> Sprinkler::timer_cbf_(const SprinklerTimerIndex timer_index) {
1668
+ return this->timer_[timer_index].func;
1669
+ }
1670
+
1671
+ void Sprinkler::valve_selection_callback_() {
1672
+ this->timer_[sprinkler::TIMER_VALVE_SELECTION].active = false;
1673
+ ESP_LOGVV(TAG, "Valve selection timer expired");
1674
+ if (this->manual_valve_.has_value()) {
1675
+ this->fsm_request_(this->manual_valve_.value());
1676
+ this->manual_valve_.reset();
1677
+ }
1678
+ }
1679
+
1680
+ void Sprinkler::sm_timer_callback_() {
1681
+ this->timer_[sprinkler::TIMER_SM].active = false;
1682
+ ESP_LOGVV(TAG, "State machine timer expired");
1683
+ this->fsm_transition_();
1684
+ }
1685
+
1686
+ void Sprinkler::dump_config() {
1687
+ ESP_LOGCONFIG(TAG, "Sprinkler Controller -- %s", this->name_.c_str());
1688
+ if (this->manual_selection_delay_.has_value()) {
1689
+ ESP_LOGCONFIG(TAG, " Manual Selection Delay: %" PRIu32 " seconds", this->manual_selection_delay_.value_or(0));
1690
+ }
1691
+ if (this->repeat().has_value()) {
1692
+ ESP_LOGCONFIG(TAG, " Repeat Cycles: %" PRIu32 " times", this->repeat().value_or(0));
1693
+ }
1694
+ if (this->start_delay_) {
1695
+ if (this->start_delay_is_valve_delay_) {
1696
+ ESP_LOGCONFIG(TAG, " Pump Start Valve Delay: %" PRIu32 " seconds", this->start_delay_);
1697
+ } else {
1698
+ ESP_LOGCONFIG(TAG, " Pump Start Pump Delay: %" PRIu32 " seconds", this->start_delay_);
1699
+ }
1700
+ }
1701
+ if (this->stop_delay_) {
1702
+ if (this->stop_delay_is_valve_delay_) {
1703
+ ESP_LOGCONFIG(TAG, " Pump Stop Valve Delay: %" PRIu32 " seconds", this->stop_delay_);
1704
+ } else {
1705
+ ESP_LOGCONFIG(TAG, " Pump Stop Pump Delay: %" PRIu32 " seconds", this->stop_delay_);
1706
+ }
1707
+ }
1708
+ if (this->switching_delay_.has_value()) {
1709
+ if (this->valve_overlap_) {
1710
+ ESP_LOGCONFIG(TAG, " Valve Overlap: %" PRIu32 " seconds", this->switching_delay_.value_or(0));
1711
+ } else {
1712
+ ESP_LOGCONFIG(TAG, " Valve Open Delay: %" PRIu32 " seconds", this->switching_delay_.value_or(0));
1713
+ ESP_LOGCONFIG(TAG, " Pump Switch Off During Valve Open Delay: %s",
1714
+ YESNO(this->pump_switch_off_during_valve_open_delay_));
1715
+ }
1716
+ }
1717
+ for (size_t valve_number = 0; valve_number < this->number_of_valves(); valve_number++) {
1718
+ ESP_LOGCONFIG(TAG, " Valve %zu:", valve_number);
1719
+ ESP_LOGCONFIG(TAG, " Name: %s", this->valve_name(valve_number));
1720
+ ESP_LOGCONFIG(TAG, " Run Duration: %" PRIu32 " seconds", this->valve_run_duration(valve_number));
1721
+ if (this->valve_[valve_number].valve_switch.pulse_duration()) {
1722
+ ESP_LOGCONFIG(TAG, " Pulse Duration: %" PRIu32 " milliseconds",
1723
+ this->valve_[valve_number].valve_switch.pulse_duration());
1724
+ }
1725
+ }
1726
+ if (!this->pump_.empty()) {
1727
+ ESP_LOGCONFIG(TAG, " Total number of pumps: %zu", this->pump_.size());
1728
+ }
1729
+ if (!this->valve_.empty()) {
1730
+ ESP_LOGCONFIG(TAG, " Total number of valves: %zu", this->valve_.size());
1731
+ }
1732
+ }
1733
+
1734
+ } // namespace sprinkler
1735
+ } // namespace esphome