esphome 2024.7.2__py3-none-any.whl → 2024.8.0__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 (353) hide show
  1. esphome/__main__.py +15 -81
  2. esphome/automation.py +1 -1
  3. esphome/codegen.py +53 -53
  4. esphome/components/ade7953/sensor.py +1 -1
  5. esphome/components/ade7953_spi/ade7953_spi.cpp +1 -1
  6. esphome/components/airthings_wave_plus/airthings_wave_plus.cpp +5 -2
  7. esphome/components/airthings_wave_plus/airthings_wave_plus.h +2 -0
  8. esphome/components/airthings_wave_plus/sensor.py +12 -0
  9. esphome/components/alarm_control_panel/__init__.py +75 -66
  10. esphome/components/apds9306/__init__.py +4 -0
  11. esphome/components/apds9306/apds9306.cpp +151 -0
  12. esphome/components/apds9306/apds9306.h +66 -0
  13. esphome/components/apds9306/sensor.py +95 -0
  14. esphome/components/api/__init__.py +80 -52
  15. esphome/components/api/api_connection.cpp +14 -1
  16. esphome/components/api/api_pb2.cpp +33 -4
  17. esphome/components/api/api_pb2.h +8 -1
  18. esphome/components/api/api_server.cpp +10 -0
  19. esphome/components/api/api_server.h +3 -0
  20. esphome/components/atm90e32/__init__.py +7 -0
  21. esphome/components/atm90e32/atm90e32.cpp +68 -16
  22. esphome/components/atm90e32/atm90e32.h +20 -7
  23. esphome/components/atm90e32/atm90e32_reg.h +2 -0
  24. esphome/components/atm90e32/button/__init__.py +43 -0
  25. esphome/components/atm90e32/button/atm90e32_button.cpp +20 -0
  26. esphome/components/atm90e32/button/atm90e32_button.h +27 -0
  27. esphome/components/atm90e32/sensor.py +15 -11
  28. esphome/components/bedjet/bedjet_codec.h +1 -1
  29. esphome/components/binary/light/binary_light_output.h +3 -2
  30. esphome/components/binary_sensor/__init__.py +5 -5
  31. esphome/components/ble_client/__init__.py +3 -3
  32. esphome/components/ble_client/output/__init__.py +1 -1
  33. esphome/components/ble_client/sensor/__init__.py +4 -3
  34. esphome/components/ble_client/switch/__init__.py +2 -1
  35. esphome/components/ble_client/text_sensor/__init__.py +4 -3
  36. esphome/components/ble_presence/binary_sensor.py +3 -3
  37. esphome/components/ble_rssi/sensor.py +2 -2
  38. esphome/components/ble_scanner/text_sensor.py +1 -1
  39. esphome/components/bluetooth_proxy/__init__.py +3 -3
  40. esphome/components/bme68x_bsec2/__init__.py +196 -0
  41. esphome/components/bme68x_bsec2/bme68x_bsec2.cpp +523 -0
  42. esphome/components/bme68x_bsec2/bme68x_bsec2.h +163 -0
  43. esphome/components/bme68x_bsec2/sensor.py +130 -0
  44. esphome/components/bme68x_bsec2/text_sensor.py +33 -0
  45. esphome/components/bme68x_bsec2_i2c/__init__.py +28 -0
  46. esphome/components/bme68x_bsec2_i2c/bme68x_bsec2_i2c.cpp +53 -0
  47. esphome/components/bme68x_bsec2_i2c/bme68x_bsec2_i2c.h +28 -0
  48. esphome/components/bmp3xx/sensor.py +1 -1
  49. esphome/components/button/__init__.py +4 -4
  50. esphome/components/climate/__init__.py +5 -5
  51. esphome/components/climate/climate.h +1 -1
  52. esphome/components/cover/__init__.py +8 -8
  53. esphome/components/cst226/touchscreen/cst226_touchscreen.cpp +11 -7
  54. esphome/components/cst226/touchscreen/cst226_touchscreen.h +1 -1
  55. esphome/components/datetime/__init__.py +11 -13
  56. esphome/components/demo/demo_sensor.h +3 -2
  57. esphome/components/display/display.cpp +31 -0
  58. esphome/components/display/display.h +3 -0
  59. esphome/components/display_menu_base/__init__.py +14 -13
  60. esphome/components/ens160/sensor.py +1 -1
  61. esphome/components/esp32/__init__.py +22 -10
  62. esphome/components/esp32/boards.py +1 -1
  63. esphome/components/esp32/gpio.py +12 -13
  64. esphome/components/esp32/gpio_esp32.py +1 -2
  65. esphome/components/esp32/gpio_esp32_c2.py +1 -2
  66. esphome/components/esp32/gpio_esp32_c3.py +1 -5
  67. esphome/components/esp32/gpio_esp32_c6.py +1 -2
  68. esphome/components/esp32/gpio_esp32_h2.py +1 -2
  69. esphome/components/esp32/gpio_esp32_s2.py +1 -2
  70. esphome/components/esp32/gpio_esp32_s3.py +1 -6
  71. esphome/components/esp32_ble/__init__.py +20 -3
  72. esphome/components/esp32_ble/ble.cpp +9 -1
  73. esphome/components/esp32_ble/ble.h +9 -0
  74. esphome/components/esp32_ble/ble_advertising.cpp +42 -9
  75. esphome/components/esp32_ble/ble_advertising.h +21 -1
  76. esphome/components/esp32_ble_beacon/__init__.py +17 -7
  77. esphome/components/esp32_ble_beacon/esp32_ble_beacon.cpp +45 -113
  78. esphome/components/esp32_ble_beacon/esp32_ble_beacon.h +17 -19
  79. esphome/components/esp32_ble_client/__init__.py +0 -1
  80. esphome/components/esp32_ble_server/__init__.py +2 -3
  81. esphome/components/esp32_ble_tracker/__init__.py +2 -2
  82. esphome/components/esp32_improv/__init__.py +2 -4
  83. esphome/components/ethernet/__init__.py +17 -17
  84. esphome/components/ethernet_info/text_sensor.py +2 -2
  85. esphome/components/event/__init__.py +5 -5
  86. esphome/components/fan/__init__.py +14 -14
  87. esphome/components/fan/fan.cpp +2 -2
  88. esphome/components/fingerprint_grow/fingerprint_grow.cpp +1 -1
  89. esphome/components/fingerprint_grow/fingerprint_grow.h +1 -1
  90. esphome/components/graphical_display_menu/__init__.py +11 -8
  91. esphome/components/haier/haier_base.h +2 -2
  92. esphome/components/homeassistant/__init__.py +8 -1
  93. esphome/components/homeassistant/number/__init__.py +33 -0
  94. esphome/components/homeassistant/number/homeassistant_number.cpp +100 -0
  95. esphome/components/homeassistant/number/homeassistant_number.h +31 -0
  96. esphome/components/homeassistant/switch/__init__.py +30 -0
  97. esphome/components/homeassistant/switch/homeassistant_switch.cpp +59 -0
  98. esphome/components/homeassistant/switch/homeassistant_switch.h +22 -0
  99. esphome/components/host/__init__.py +3 -7
  100. esphome/components/http_request/__init__.py +12 -1
  101. esphome/components/http_request/http_request_arduino.cpp +2 -2
  102. esphome/components/http_request/http_request_idf.cpp +11 -2
  103. esphome/components/http_request/http_request_idf.h +10 -0
  104. esphome/components/http_request/ota/ota_http_request.cpp +1 -1
  105. esphome/components/http_request/update/http_request_update.cpp +2 -2
  106. esphome/components/http_request/update/http_request_update.h +2 -1
  107. esphome/components/hx711/hx711.cpp +10 -1
  108. esphome/components/hydreon_rgxx/hydreon_rgxx.cpp +1 -1
  109. esphome/components/i2s_audio/speaker/i2s_audio_speaker.cpp +11 -2
  110. esphome/components/i2s_audio/speaker/i2s_audio_speaker.h +2 -0
  111. esphome/components/ili9xxx/ili9xxx_defines.h +3 -1
  112. esphome/components/ili9xxx/ili9xxx_display.cpp +9 -22
  113. esphome/components/ili9xxx/ili9xxx_display.h +5 -7
  114. esphome/components/ili9xxx/ili9xxx_init.h +4 -4
  115. esphome/components/improv_base/__init__.py +2 -3
  116. esphome/components/improv_serial/__init__.py +4 -10
  117. esphome/components/improv_serial/improv_serial_component.cpp +4 -0
  118. esphome/components/jsn_sr04t/jsn_sr04t.cpp +18 -1
  119. esphome/components/jsn_sr04t/jsn_sr04t.h +7 -1
  120. esphome/components/jsn_sr04t/sensor.py +13 -0
  121. esphome/components/kalman_combinator/sensor.py +1 -1
  122. esphome/components/light/__init__.py +16 -15
  123. esphome/components/light/addressable_light_effect.h +12 -8
  124. esphome/components/light/automation.h +16 -1
  125. esphome/components/light/automation.py +21 -0
  126. esphome/components/light/base_light_effects.h +5 -5
  127. esphome/components/light/esp_color_correction.h +8 -8
  128. esphome/components/light/types.py +7 -0
  129. esphome/components/lock/__init__.py +3 -3
  130. esphome/components/logger/__init__.py +15 -18
  131. esphome/components/lvgl/__init__.py +346 -0
  132. esphome/components/lvgl/automation.py +226 -0
  133. esphome/components/lvgl/binary_sensor/__init__.py +43 -0
  134. esphome/components/lvgl/defines.py +508 -0
  135. esphome/components/lvgl/encoders.py +77 -0
  136. esphome/components/lvgl/font.cpp +76 -0
  137. esphome/components/lvgl/helpers.py +49 -0
  138. esphome/components/lvgl/light/__init__.py +32 -0
  139. esphome/components/lvgl/light/lvgl_light.h +48 -0
  140. esphome/components/lvgl/lv_validation.py +303 -0
  141. esphome/components/lvgl/lvcode.py +349 -0
  142. esphome/components/lvgl/lvgl_esphome.cpp +407 -0
  143. esphome/components/lvgl/lvgl_esphome.h +274 -0
  144. esphome/components/lvgl/lvgl_hal.h +21 -0
  145. esphome/components/lvgl/number/__init__.py +66 -0
  146. esphome/components/lvgl/number/lvgl_number.h +34 -0
  147. esphome/components/lvgl/schemas.py +436 -0
  148. esphome/components/lvgl/select/__init__.py +55 -0
  149. esphome/components/lvgl/select/lvgl_select.h +62 -0
  150. esphome/components/lvgl/sensor/__init__.py +47 -0
  151. esphome/components/lvgl/styles.py +58 -0
  152. esphome/components/lvgl/switch/__init__.py +56 -0
  153. esphome/components/lvgl/switch/lvgl_switch.h +34 -0
  154. esphome/components/lvgl/text/__init__.py +50 -0
  155. esphome/components/lvgl/text/lvgl_text.h +34 -0
  156. esphome/components/lvgl/text_sensor/__init__.py +42 -0
  157. esphome/components/lvgl/touchscreens.py +45 -0
  158. esphome/components/lvgl/trigger.py +74 -0
  159. esphome/components/lvgl/types.py +191 -0
  160. esphome/components/lvgl/widgets/__init__.py +419 -0
  161. esphome/components/lvgl/widgets/animimg.py +117 -0
  162. esphome/components/lvgl/widgets/arc.py +78 -0
  163. esphome/components/lvgl/widgets/button.py +20 -0
  164. esphome/components/lvgl/widgets/buttonmatrix.py +275 -0
  165. esphome/components/lvgl/widgets/checkbox.py +27 -0
  166. esphome/components/lvgl/widgets/dropdown.py +76 -0
  167. esphome/components/lvgl/widgets/img.py +85 -0
  168. esphome/components/lvgl/widgets/keyboard.py +49 -0
  169. esphome/components/lvgl/widgets/label.py +42 -0
  170. esphome/components/lvgl/widgets/led.py +29 -0
  171. esphome/components/lvgl/widgets/line.py +50 -0
  172. esphome/components/lvgl/widgets/lv_bar.py +55 -0
  173. esphome/components/lvgl/widgets/meter.py +302 -0
  174. esphome/components/lvgl/widgets/msgbox.py +134 -0
  175. esphome/components/lvgl/widgets/obj.py +28 -0
  176. esphome/components/lvgl/widgets/page.py +113 -0
  177. esphome/components/lvgl/widgets/roller.py +77 -0
  178. esphome/components/lvgl/widgets/slider.py +63 -0
  179. esphome/components/lvgl/widgets/spinbox.py +178 -0
  180. esphome/components/lvgl/widgets/spinner.py +43 -0
  181. esphome/components/lvgl/widgets/switch.py +20 -0
  182. esphome/components/lvgl/widgets/tabview.py +114 -0
  183. esphome/components/lvgl/widgets/textarea.py +66 -0
  184. esphome/components/lvgl/widgets/tileview.py +128 -0
  185. esphome/components/m5stack_8angle/__init__.py +33 -0
  186. esphome/components/m5stack_8angle/binary_sensor/__init__.py +30 -0
  187. esphome/components/m5stack_8angle/binary_sensor/m5stack_8angle_binary_sensor.cpp +17 -0
  188. esphome/components/m5stack_8angle/binary_sensor/m5stack_8angle_binary_sensor.h +19 -0
  189. esphome/components/m5stack_8angle/light/__init__.py +31 -0
  190. esphome/components/m5stack_8angle/light/m5stack_8angle_light.cpp +45 -0
  191. esphome/components/m5stack_8angle/light/m5stack_8angle_light.h +37 -0
  192. esphome/components/m5stack_8angle/m5stack_8angle.cpp +74 -0
  193. esphome/components/m5stack_8angle/m5stack_8angle.h +34 -0
  194. esphome/components/m5stack_8angle/sensor/__init__.py +66 -0
  195. esphome/components/m5stack_8angle/sensor/m5stack_8angle_sensor.cpp +24 -0
  196. esphome/components/m5stack_8angle/sensor/m5stack_8angle_sensor.h +27 -0
  197. esphome/components/matrix_keypad/matrix_keypad.cpp +2 -0
  198. esphome/components/max31856/sensor.py +5 -5
  199. esphome/components/media_player/__init__.py +3 -5
  200. esphome/components/media_player/automation.h +31 -27
  201. esphome/components/micro_wake_word/__init__.py +20 -25
  202. esphome/components/micro_wake_word/streaming_model.cpp +6 -4
  203. esphome/components/microphone/microphone.h +4 -1
  204. esphome/components/mitsubishi/mitsubishi.cpp +7 -1
  205. esphome/components/modbus_controller/__init__.py +26 -2
  206. esphome/components/modbus_controller/automation.h +19 -0
  207. esphome/components/modbus_controller/const.py +1 -0
  208. esphome/components/modbus_controller/modbus_controller.cpp +8 -0
  209. esphome/components/modbus_controller/modbus_controller.h +3 -0
  210. esphome/components/mqtt/__init__.py +20 -9
  211. esphome/components/mqtt/mqtt_alarm_control_panel.cpp +128 -0
  212. esphome/components/mqtt/mqtt_alarm_control_panel.h +39 -0
  213. esphome/components/mqtt/mqtt_backend.h +3 -1
  214. esphome/components/mqtt/mqtt_backend_esp32.cpp +4 -1
  215. esphome/components/mqtt/mqtt_backend_esp32.h +3 -1
  216. esphome/components/mqtt/mqtt_backend_esp8266.h +3 -1
  217. esphome/components/mqtt/mqtt_backend_libretiny.h +3 -1
  218. esphome/components/mqtt/mqtt_client.cpp +16 -3
  219. esphome/components/mqtt/mqtt_client.h +5 -1
  220. esphome/components/mqtt/mqtt_component.cpp +32 -4
  221. esphome/components/mqtt/mqtt_const.h +2 -0
  222. esphome/components/network/__init__.py +15 -12
  223. esphome/components/network/ip_address.h +3 -0
  224. esphome/components/network/util.cpp +2 -1
  225. esphome/components/network/util.h +3 -1
  226. esphome/components/nextion/base_component.py +5 -8
  227. esphome/components/number/__init__.py +7 -8
  228. esphome/components/online_image/__init__.py +167 -0
  229. esphome/components/online_image/image_decoder.cpp +44 -0
  230. esphome/components/online_image/image_decoder.h +112 -0
  231. esphome/components/online_image/online_image.cpp +283 -0
  232. esphome/components/online_image/online_image.h +195 -0
  233. esphome/components/online_image/png_image.cpp +68 -0
  234. esphome/components/online_image/png_image.h +33 -0
  235. esphome/components/ota/__init__.py +8 -4
  236. esphome/components/pid/pid_climate.h +2 -0
  237. esphome/components/pmwcs3/pmwcs3.cpp +31 -30
  238. esphome/components/remote_base/pronto_protocol.cpp +0 -3
  239. esphome/components/remote_transmitter/remote_transmitter.h +1 -1
  240. esphome/components/rgbct/rgbct_light_output.h +3 -2
  241. esphome/components/rgbw/rgbw_light_output.h +3 -2
  242. esphome/components/rgbww/rgbww_light_output.h +3 -2
  243. esphome/components/rp2040_pio_led_strip/led_strip.cpp +31 -5
  244. esphome/components/rp2040_pio_led_strip/led_strip.h +5 -0
  245. esphome/components/rtttl/rtttl.cpp +108 -21
  246. esphome/components/rtttl/rtttl.h +15 -6
  247. esphome/components/select/__init__.py +7 -7
  248. esphome/components/sensor/__init__.py +29 -10
  249. esphome/components/sensor/filter.cpp +8 -0
  250. esphome/components/sensor/filter.h +9 -0
  251. esphome/components/sml/sml_parser.cpp +48 -22
  252. esphome/components/socket/socket.cpp +11 -14
  253. esphome/components/speaker/__init__.py +14 -5
  254. esphome/components/speaker/automation.h +10 -0
  255. esphome/components/speaker/speaker.h +9 -0
  256. esphome/components/spi/spi.cpp +0 -6
  257. esphome/components/spi/spi.h +2 -19
  258. esphome/components/spi_led_strip/spi_led_strip.h +5 -4
  259. esphome/components/sprinkler/sprinkler.cpp +2 -2
  260. esphome/components/sprinkler/sprinkler.h +1 -1
  261. esphome/components/switch/__init__.py +3 -3
  262. esphome/components/text/__init__.py +5 -5
  263. esphome/components/text_sensor/__init__.py +7 -7
  264. esphome/components/time/__init__.py +8 -8
  265. esphome/components/touchscreen/binary_sensor/__init__.py +24 -10
  266. esphome/components/touchscreen/binary_sensor/touchscreen_binary_sensor.cpp +3 -2
  267. esphome/components/touchscreen/binary_sensor/touchscreen_binary_sensor.h +4 -2
  268. esphome/components/uart/uart_component_host.cpp +6 -2
  269. esphome/components/update/__init__.py +33 -15
  270. esphome/components/update/automation.h +23 -0
  271. esphome/components/update/update_entity.h +3 -1
  272. esphome/components/valve/__init__.py +3 -3
  273. esphome/components/voice_assistant/__init__.py +7 -8
  274. esphome/components/wake_on_lan/wake_on_lan.cpp +2 -0
  275. esphome/components/wake_on_lan/wake_on_lan.h +3 -1
  276. esphome/components/watchdog/__init__.py +1 -0
  277. esphome/components/{http_request → watchdog}/watchdog.cpp +0 -2
  278. esphome/components/{http_request → watchdog}/watchdog.h +0 -2
  279. esphome/components/waveshare_epaper/waveshare_epaper.cpp +5 -5
  280. esphome/components/web_server/server_index_v3.h +3615 -3603
  281. esphome/components/web_server/web_server.cpp +0 -209
  282. esphome/components/web_server/web_server.h +1 -1
  283. esphome/components/web_server/web_server_v1.cpp +217 -0
  284. esphome/components/web_server_base/web_server_base.h +1 -0
  285. esphome/components/wifi/__init__.py +15 -14
  286. esphome/components/wifi/wifi_component.cpp +2 -0
  287. esphome/components/wifi/wifi_component.h +7 -1
  288. esphome/components/wifi/wifi_component_esp32_arduino.cpp +5 -2
  289. esphome/components/wifi/wifi_component_esp8266.cpp +2 -0
  290. esphome/components/wifi/wifi_component_esp_idf.cpp +43 -7
  291. esphome/components/wifi/wifi_component_libretiny.cpp +2 -0
  292. esphome/components/wifi/wifi_component_pico_w.cpp +2 -0
  293. esphome/components/wifi/wpa2_eap.py +6 -7
  294. esphome/components/wifi_info/text_sensor.py +3 -3
  295. esphome/components/wifi_info/wifi_info_text_sensor.cpp +2 -0
  296. esphome/components/wifi_info/wifi_info_text_sensor.h +2 -0
  297. esphome/components/wifi_signal/sensor.py +1 -1
  298. esphome/components/wifi_signal/wifi_signal_sensor.cpp +2 -0
  299. esphome/components/wifi_signal/wifi_signal_sensor.h +2 -1
  300. esphome/components/xiaomi_ble/xiaomi_ble.cpp +20 -3
  301. esphome/components/xiaomi_ble/xiaomi_ble.h +1 -0
  302. esphome/components/xiaomi_lywsd02mmc/__init__.py +0 -0
  303. esphome/components/xiaomi_lywsd02mmc/sensor.py +77 -0
  304. esphome/components/xiaomi_lywsd02mmc/xiaomi_lywsd02mmc.cpp +73 -0
  305. esphome/components/xiaomi_lywsd02mmc/xiaomi_lywsd02mmc.h +37 -0
  306. esphome/config.py +17 -19
  307. esphome/config_validation.py +55 -23
  308. esphome/const.py +25 -9
  309. esphome/core/__init__.py +17 -14
  310. esphome/core/application.h +42 -21
  311. esphome/core/automation.h +5 -3
  312. esphome/core/base_automation.h +3 -2
  313. esphome/core/bytebuffer.cpp +134 -0
  314. esphome/core/bytebuffer.h +96 -0
  315. esphome/core/color.h +24 -16
  316. esphome/core/config.py +3 -3
  317. esphome/core/defines.h +14 -1
  318. esphome/core/entity_base.h +2 -2
  319. esphome/core/entity_helpers.py +1 -2
  320. esphome/core/gpio.h +0 -18
  321. esphome/core/helpers.h +1 -1
  322. esphome/core/optional.h +15 -16
  323. esphome/coroutine.py +1 -1
  324. esphome/cpp_generator.py +1 -1
  325. esphome/cpp_helpers.py +3 -5
  326. esphome/dashboard/core.py +3 -3
  327. esphome/dashboard/dashboard.py +3 -3
  328. esphome/dashboard/entries.py +1 -1
  329. esphome/dashboard/util/file.py +1 -1
  330. esphome/dashboard/web_server.py +3 -3
  331. esphome/external_files.py +5 -3
  332. esphome/final_validate.py +2 -2
  333. esphome/git.py +4 -4
  334. esphome/helpers.py +5 -5
  335. esphome/loader.py +15 -10
  336. esphome/mqtt.py +4 -8
  337. esphome/pins.py +6 -6
  338. esphome/platformio_api.py +5 -5
  339. esphome/storage_json.py +2 -1
  340. esphome/types.py +1 -1
  341. esphome/util.py +2 -3
  342. esphome/voluptuous_schema.py +1 -0
  343. esphome/vscode.py +5 -4
  344. esphome/wizard.py +1 -1
  345. esphome/writer.py +7 -7
  346. esphome/yaml_util.py +3 -3
  347. esphome/zeroconf.py +1 -1
  348. {esphome-2024.7.2.dist-info → esphome-2024.8.0.dist-info}/METADATA +3 -3
  349. {esphome-2024.7.2.dist-info → esphome-2024.8.0.dist-info}/RECORD +353 -247
  350. {esphome-2024.7.2.dist-info → esphome-2024.8.0.dist-info}/LICENSE +0 -0
  351. {esphome-2024.7.2.dist-info → esphome-2024.8.0.dist-info}/WHEEL +0 -0
  352. {esphome-2024.7.2.dist-info → esphome-2024.8.0.dist-info}/entry_points.txt +0 -0
  353. {esphome-2024.7.2.dist-info → esphome-2024.8.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,130 @@
1
+ import esphome.codegen as cg
2
+ from esphome.components import sensor
3
+ import esphome.config_validation as cv
4
+ from esphome.const import (
5
+ CONF_GAS_RESISTANCE,
6
+ CONF_HUMIDITY,
7
+ CONF_IAQ_ACCURACY,
8
+ CONF_PRESSURE,
9
+ CONF_SAMPLE_RATE,
10
+ CONF_TEMPERATURE,
11
+ DEVICE_CLASS_ATMOSPHERIC_PRESSURE,
12
+ DEVICE_CLASS_HUMIDITY,
13
+ DEVICE_CLASS_TEMPERATURE,
14
+ ICON_GAS_CYLINDER,
15
+ ICON_GAUGE,
16
+ ICON_THERMOMETER,
17
+ ICON_WATER_PERCENT,
18
+ STATE_CLASS_MEASUREMENT,
19
+ UNIT_CELSIUS,
20
+ UNIT_HECTOPASCAL,
21
+ UNIT_OHM,
22
+ UNIT_PARTS_PER_MILLION,
23
+ UNIT_PERCENT,
24
+ )
25
+
26
+ from . import CONF_BME68X_BSEC2_ID, SAMPLE_RATE_OPTIONS, BME68xBSEC2Component
27
+
28
+ DEPENDENCIES = ["bme68x_bsec2"]
29
+
30
+ CONF_BREATH_VOC_EQUIVALENT = "breath_voc_equivalent"
31
+ CONF_CO2_EQUIVALENT = "co2_equivalent"
32
+ CONF_IAQ = "iaq"
33
+ CONF_IAQ_STATIC = "iaq_static"
34
+ ICON_ACCURACY = "mdi:checkbox-marked-circle-outline"
35
+ ICON_TEST_TUBE = "mdi:test-tube"
36
+ UNIT_IAQ = "IAQ"
37
+
38
+ TYPES = [
39
+ CONF_TEMPERATURE,
40
+ CONF_PRESSURE,
41
+ CONF_HUMIDITY,
42
+ CONF_GAS_RESISTANCE,
43
+ CONF_IAQ,
44
+ CONF_IAQ_STATIC,
45
+ CONF_IAQ_ACCURACY,
46
+ CONF_CO2_EQUIVALENT,
47
+ CONF_BREATH_VOC_EQUIVALENT,
48
+ ]
49
+
50
+ CONFIG_SCHEMA = cv.Schema(
51
+ {
52
+ cv.GenerateID(CONF_BME68X_BSEC2_ID): cv.use_id(BME68xBSEC2Component),
53
+ cv.Optional(CONF_TEMPERATURE): sensor.sensor_schema(
54
+ unit_of_measurement=UNIT_CELSIUS,
55
+ icon=ICON_THERMOMETER,
56
+ accuracy_decimals=1,
57
+ device_class=DEVICE_CLASS_TEMPERATURE,
58
+ state_class=STATE_CLASS_MEASUREMENT,
59
+ ).extend(
60
+ {cv.Optional(CONF_SAMPLE_RATE): cv.enum(SAMPLE_RATE_OPTIONS, upper=True)}
61
+ ),
62
+ cv.Optional(CONF_PRESSURE): sensor.sensor_schema(
63
+ unit_of_measurement=UNIT_HECTOPASCAL,
64
+ icon=ICON_GAUGE,
65
+ accuracy_decimals=1,
66
+ device_class=DEVICE_CLASS_ATMOSPHERIC_PRESSURE,
67
+ state_class=STATE_CLASS_MEASUREMENT,
68
+ ).extend(
69
+ {cv.Optional(CONF_SAMPLE_RATE): cv.enum(SAMPLE_RATE_OPTIONS, upper=True)}
70
+ ),
71
+ cv.Optional(CONF_HUMIDITY): sensor.sensor_schema(
72
+ unit_of_measurement=UNIT_PERCENT,
73
+ icon=ICON_WATER_PERCENT,
74
+ accuracy_decimals=1,
75
+ device_class=DEVICE_CLASS_HUMIDITY,
76
+ state_class=STATE_CLASS_MEASUREMENT,
77
+ ).extend(
78
+ {cv.Optional(CONF_SAMPLE_RATE): cv.enum(SAMPLE_RATE_OPTIONS, upper=True)}
79
+ ),
80
+ cv.Optional(CONF_GAS_RESISTANCE): sensor.sensor_schema(
81
+ unit_of_measurement=UNIT_OHM,
82
+ icon=ICON_GAS_CYLINDER,
83
+ accuracy_decimals=0,
84
+ state_class=STATE_CLASS_MEASUREMENT,
85
+ ),
86
+ cv.Optional(CONF_IAQ): sensor.sensor_schema(
87
+ unit_of_measurement=UNIT_IAQ,
88
+ icon=ICON_GAUGE,
89
+ accuracy_decimals=0,
90
+ state_class=STATE_CLASS_MEASUREMENT,
91
+ ),
92
+ cv.Optional(CONF_IAQ_STATIC): sensor.sensor_schema(
93
+ unit_of_measurement=UNIT_IAQ,
94
+ icon=ICON_GAUGE,
95
+ accuracy_decimals=0,
96
+ state_class=STATE_CLASS_MEASUREMENT,
97
+ ),
98
+ cv.Optional(CONF_IAQ_ACCURACY): sensor.sensor_schema(
99
+ icon=ICON_ACCURACY,
100
+ accuracy_decimals=0,
101
+ state_class=STATE_CLASS_MEASUREMENT,
102
+ ),
103
+ cv.Optional(CONF_CO2_EQUIVALENT): sensor.sensor_schema(
104
+ unit_of_measurement=UNIT_PARTS_PER_MILLION,
105
+ icon=ICON_TEST_TUBE,
106
+ accuracy_decimals=1,
107
+ state_class=STATE_CLASS_MEASUREMENT,
108
+ ),
109
+ cv.Optional(CONF_BREATH_VOC_EQUIVALENT): sensor.sensor_schema(
110
+ unit_of_measurement=UNIT_PARTS_PER_MILLION,
111
+ icon=ICON_TEST_TUBE,
112
+ accuracy_decimals=1,
113
+ state_class=STATE_CLASS_MEASUREMENT,
114
+ ),
115
+ }
116
+ )
117
+
118
+
119
+ async def setup_conf(config, key, hub):
120
+ if conf := config.get(key):
121
+ sens = await sensor.new_sensor(conf)
122
+ cg.add(getattr(hub, f"set_{key}_sensor")(sens))
123
+ if sample_rate := conf.get(CONF_SAMPLE_RATE):
124
+ cg.add(getattr(hub, f"set_{key}_sample_rate")(sample_rate))
125
+
126
+
127
+ async def to_code(config):
128
+ hub = await cg.get_variable(config[CONF_BME68X_BSEC2_ID])
129
+ for key in TYPES:
130
+ await setup_conf(config, key, hub)
@@ -0,0 +1,33 @@
1
+ import esphome.codegen as cg
2
+ from esphome.components import text_sensor
3
+ import esphome.config_validation as cv
4
+ from esphome.const import CONF_IAQ_ACCURACY
5
+
6
+ from . import CONF_BME68X_BSEC2_ID, BME68xBSEC2Component
7
+
8
+ DEPENDENCIES = ["bme68x_bsec2"]
9
+
10
+ ICON_ACCURACY = "mdi:checkbox-marked-circle-outline"
11
+
12
+ TYPES = [CONF_IAQ_ACCURACY]
13
+
14
+ CONFIG_SCHEMA = cv.Schema(
15
+ {
16
+ cv.GenerateID(CONF_BME68X_BSEC2_ID): cv.use_id(BME68xBSEC2Component),
17
+ cv.Optional(CONF_IAQ_ACCURACY): text_sensor.text_sensor_schema(
18
+ icon=ICON_ACCURACY
19
+ ),
20
+ }
21
+ )
22
+
23
+
24
+ async def setup_conf(config, key, hub):
25
+ if conf := config.get(key):
26
+ sens = await text_sensor.new_text_sensor(conf)
27
+ cg.add(getattr(hub, f"set_{key}_text_sensor")(sens))
28
+
29
+
30
+ async def to_code(config):
31
+ hub = await cg.get_variable(config[CONF_BME68X_BSEC2_ID])
32
+ for key in TYPES:
33
+ await setup_conf(config, key, hub)
@@ -0,0 +1,28 @@
1
+ import esphome.codegen as cg
2
+ from esphome.components import i2c
3
+ from esphome.components.bme68x_bsec2 import (
4
+ CONFIG_SCHEMA_BASE,
5
+ BME68xBSEC2Component,
6
+ to_code_base,
7
+ )
8
+ import esphome.config_validation as cv
9
+
10
+ CODEOWNERS = ["@neffs", "@kbx81"]
11
+
12
+ AUTO_LOAD = ["bme68x_bsec2"]
13
+ DEPENDENCIES = ["i2c"]
14
+
15
+ bme68x_bsec2_i2c_ns = cg.esphome_ns.namespace("bme68x_bsec2_i2c")
16
+ BME68xBSEC2I2CComponent = bme68x_bsec2_i2c_ns.class_(
17
+ "BME68xBSEC2I2CComponent", BME68xBSEC2Component, i2c.I2CDevice
18
+ )
19
+
20
+
21
+ CONFIG_SCHEMA = CONFIG_SCHEMA_BASE.extend(
22
+ cv.Schema({cv.GenerateID(): cv.declare_id(BME68xBSEC2I2CComponent)})
23
+ ).extend(i2c.i2c_device_schema(0x76))
24
+
25
+
26
+ async def to_code(config):
27
+ var = await to_code_base(config)
28
+ await i2c.register_i2c_device(var, config)
@@ -0,0 +1,53 @@
1
+ #include "esphome/core/defines.h"
2
+ #include "esphome/core/helpers.h"
3
+ #include "esphome/core/log.h"
4
+
5
+ #ifdef USE_BSEC2
6
+ #include "bme68x_bsec2_i2c.h"
7
+ #include "esphome/components/i2c/i2c.h"
8
+
9
+ #include <cinttypes>
10
+
11
+ namespace esphome {
12
+ namespace bme68x_bsec2_i2c {
13
+
14
+ static const char *const TAG = "bme68x_bsec2_i2c.sensor";
15
+
16
+ void BME68xBSEC2I2CComponent::setup() {
17
+ // must set up our bme68x_dev instance before calling setup()
18
+ this->bme68x_.intf_ptr = (void *) this;
19
+ this->bme68x_.intf = BME68X_I2C_INTF;
20
+ this->bme68x_.read = BME68xBSEC2I2CComponent::read_bytes_wrapper;
21
+ this->bme68x_.write = BME68xBSEC2I2CComponent::write_bytes_wrapper;
22
+ this->bme68x_.delay_us = BME68xBSEC2I2CComponent::delay_us;
23
+ this->bme68x_.amb_temp = 25;
24
+
25
+ BME68xBSEC2Component::setup();
26
+ }
27
+
28
+ void BME68xBSEC2I2CComponent::dump_config() {
29
+ LOG_I2C_DEVICE(this);
30
+ BME68xBSEC2Component::dump_config();
31
+ }
32
+
33
+ uint32_t BME68xBSEC2I2CComponent::get_hash() { return fnv1_hash("bme68x_bsec_state_" + to_string(this->address_)); }
34
+
35
+ int8_t BME68xBSEC2I2CComponent::read_bytes_wrapper(uint8_t a_register, uint8_t *data, uint32_t len, void *intfPtr) {
36
+ ESP_LOGVV(TAG, "read_bytes_wrapper: reg = %u", a_register);
37
+ return static_cast<BME68xBSEC2I2CComponent *>(intfPtr)->read_bytes(a_register, data, len) ? 0 : -1;
38
+ }
39
+
40
+ int8_t BME68xBSEC2I2CComponent::write_bytes_wrapper(uint8_t a_register, const uint8_t *data, uint32_t len,
41
+ void *intfPtr) {
42
+ ESP_LOGVV(TAG, "write_bytes_wrapper: reg = %u", a_register);
43
+ return static_cast<BME68xBSEC2I2CComponent *>(intfPtr)->write_bytes(a_register, data, len) ? 0 : -1;
44
+ }
45
+
46
+ void BME68xBSEC2I2CComponent::delay_us(uint32_t period, void *intfPtr) {
47
+ ESP_LOGVV(TAG, "Delaying for %" PRIu32 "us", period);
48
+ delayMicroseconds(period);
49
+ }
50
+
51
+ } // namespace bme68x_bsec2_i2c
52
+ } // namespace esphome
53
+ #endif
@@ -0,0 +1,28 @@
1
+ #pragma once
2
+
3
+ #include "esphome/core/component.h"
4
+ #include "esphome/core/defines.h"
5
+ #include "esphome/core/preferences.h"
6
+
7
+ #ifdef USE_BSEC2
8
+
9
+ #include "esphome/components/bme68x_bsec2/bme68x_bsec2.h"
10
+ #include "esphome/components/i2c/i2c.h"
11
+
12
+ namespace esphome {
13
+ namespace bme68x_bsec2_i2c {
14
+
15
+ class BME68xBSEC2I2CComponent : public bme68x_bsec2::BME68xBSEC2Component, public i2c::I2CDevice {
16
+ void setup() override;
17
+ void dump_config() override;
18
+
19
+ uint32_t get_hash() override;
20
+
21
+ static int8_t read_bytes_wrapper(uint8_t a_register, uint8_t *data, uint32_t len, void *intfPtr);
22
+ static int8_t write_bytes_wrapper(uint8_t a_register, const uint8_t *data, uint32_t len, void *intfPtr);
23
+ static void delay_us(uint32_t period, void *intfPtr);
24
+ };
25
+
26
+ } // namespace bme68x_bsec2_i2c
27
+ } // namespace esphome
28
+ #endif
@@ -2,6 +2,6 @@ import esphome.config_validation as cv
2
2
 
3
3
  CODEOWNERS = ["@latonita"]
4
4
 
5
- CONFIG_SCHEMA = CONFIG_SCHEMA = cv.invalid(
5
+ CONFIG_SCHEMA = cv.invalid(
6
6
  "The bmp3xx sensor component has been renamed to bmp3xx_i2c."
7
7
  )
@@ -1,16 +1,16 @@
1
- import esphome.codegen as cg
2
- import esphome.config_validation as cv
3
1
  from esphome import automation
4
2
  from esphome.automation import maybe_simple_id
3
+ import esphome.codegen as cg
5
4
  from esphome.components import mqtt, web_server
5
+ import esphome.config_validation as cv
6
6
  from esphome.const import (
7
7
  CONF_DEVICE_CLASS,
8
8
  CONF_ENTITY_CATEGORY,
9
9
  CONF_ICON,
10
10
  CONF_ID,
11
+ CONF_MQTT_ID,
11
12
  CONF_ON_PRESS,
12
13
  CONF_TRIGGER_ID,
13
- CONF_MQTT_ID,
14
14
  CONF_WEB_SERVER_ID,
15
15
  DEVICE_CLASS_EMPTY,
16
16
  DEVICE_CLASS_IDENTIFY,
@@ -18,8 +18,8 @@ from esphome.const import (
18
18
  DEVICE_CLASS_UPDATE,
19
19
  )
20
20
  from esphome.core import CORE, coroutine_with_priority
21
- from esphome.cpp_helpers import setup_entity
22
21
  from esphome.cpp_generator import MockObjClass
22
+ from esphome.cpp_helpers import setup_entity
23
23
 
24
24
  CODEOWNERS = ["@esphome/core"]
25
25
  IS_PLATFORM_COMPONENT = True
@@ -1,8 +1,7 @@
1
- import esphome.codegen as cg
2
- import esphome.config_validation as cv
3
- from esphome.cpp_helpers import setup_entity
4
1
  from esphome import automation
2
+ import esphome.codegen as cg
5
3
  from esphome.components import mqtt, web_server
4
+ import esphome.config_validation as cv
6
5
  from esphome.const import (
7
6
  CONF_ACTION_STATE_TOPIC,
8
7
  CONF_AWAY,
@@ -21,6 +20,7 @@ from esphome.const import (
21
20
  CONF_MODE,
22
21
  CONF_MODE_COMMAND_TOPIC,
23
22
  CONF_MODE_STATE_TOPIC,
23
+ CONF_MQTT_ID,
24
24
  CONF_ON_CONTROL,
25
25
  CONF_ON_STATE,
26
26
  CONF_PRESET,
@@ -33,20 +33,20 @@ from esphome.const import (
33
33
  CONF_TARGET_HUMIDITY_STATE_TOPIC,
34
34
  CONF_TARGET_TEMPERATURE,
35
35
  CONF_TARGET_TEMPERATURE_COMMAND_TOPIC,
36
- CONF_TARGET_TEMPERATURE_STATE_TOPIC,
37
36
  CONF_TARGET_TEMPERATURE_HIGH,
38
37
  CONF_TARGET_TEMPERATURE_HIGH_COMMAND_TOPIC,
39
38
  CONF_TARGET_TEMPERATURE_HIGH_STATE_TOPIC,
40
39
  CONF_TARGET_TEMPERATURE_LOW,
41
40
  CONF_TARGET_TEMPERATURE_LOW_COMMAND_TOPIC,
42
41
  CONF_TARGET_TEMPERATURE_LOW_STATE_TOPIC,
42
+ CONF_TARGET_TEMPERATURE_STATE_TOPIC,
43
43
  CONF_TEMPERATURE_STEP,
44
44
  CONF_TRIGGER_ID,
45
45
  CONF_VISUAL,
46
- CONF_MQTT_ID,
47
46
  CONF_WEB_SERVER_ID,
48
47
  )
49
48
  from esphome.core import CORE, coroutine_with_priority
49
+ from esphome.cpp_helpers import setup_entity
50
50
 
51
51
  IS_PLATFORM_COMPONENT = True
52
52
 
@@ -141,7 +141,7 @@ struct ClimateDeviceRestoreState {
141
141
  float target_temperature_low;
142
142
  float target_temperature_high;
143
143
  };
144
- };
144
+ } __attribute__((packed));
145
145
  float target_humidity;
146
146
 
147
147
  /// Convert this struct to a climate call that can be performed.
@@ -1,23 +1,23 @@
1
- import esphome.codegen as cg
2
- import esphome.config_validation as cv
3
1
  from esphome import automation
4
- from esphome.automation import maybe_simple_id, Condition
2
+ from esphome.automation import Condition, maybe_simple_id
3
+ import esphome.codegen as cg
5
4
  from esphome.components import mqtt, web_server
5
+ import esphome.config_validation as cv
6
6
  from esphome.const import (
7
- CONF_ID,
8
7
  CONF_DEVICE_CLASS,
9
- CONF_STATE,
8
+ CONF_ID,
9
+ CONF_MQTT_ID,
10
10
  CONF_ON_OPEN,
11
11
  CONF_POSITION,
12
12
  CONF_POSITION_COMMAND_TOPIC,
13
13
  CONF_POSITION_STATE_TOPIC,
14
+ CONF_STATE,
15
+ CONF_STOP,
14
16
  CONF_TILT,
15
17
  CONF_TILT_COMMAND_TOPIC,
16
18
  CONF_TILT_STATE_TOPIC,
17
- CONF_STOP,
18
- CONF_MQTT_ID,
19
- CONF_WEB_SERVER_ID,
20
19
  CONF_TRIGGER_ID,
20
+ CONF_WEB_SERVER_ID,
21
21
  DEVICE_CLASS_AWNING,
22
22
  DEVICE_CLASS_BLIND,
23
23
  DEVICE_CLASS_CURTAIN,
@@ -5,13 +5,17 @@ namespace cst226 {
5
5
 
6
6
  void CST226Touchscreen::setup() {
7
7
  esph_log_config(TAG, "Setting up CST226 Touchscreen...");
8
- this->reset_pin_->setup();
9
- this->reset_pin_->digital_write(true);
10
- delay(5);
11
- this->reset_pin_->digital_write(false);
12
- delay(5);
13
- this->reset_pin_->digital_write(true);
14
- this->set_timeout(30, [this] { this->continue_setup_(); });
8
+ if (this->reset_pin_ != nullptr) {
9
+ this->reset_pin_->setup();
10
+ this->reset_pin_->digital_write(true);
11
+ delay(5);
12
+ this->reset_pin_->digital_write(false);
13
+ delay(5);
14
+ this->reset_pin_->digital_write(true);
15
+ this->set_timeout(30, [this] { this->continue_setup_(); });
16
+ } else {
17
+ this->continue_setup_();
18
+ }
15
19
  }
16
20
 
17
21
  void CST226Touchscreen::update_touches() {
@@ -35,7 +35,7 @@ class CST226Touchscreen : public touchscreen::Touchscreen, public i2c::I2CDevice
35
35
  void continue_setup_();
36
36
 
37
37
  InternalGPIOPin *interrupt_pin_{};
38
- GPIOPin *reset_pin_{NULL_PIN};
38
+ GPIOPin *reset_pin_{};
39
39
  uint8_t chip_id_{};
40
40
  bool setup_complete_{};
41
41
  };
@@ -1,32 +1,30 @@
1
+ from esphome import automation
1
2
  import esphome.codegen as cg
2
-
3
+ from esphome.components import mqtt, time, web_server
3
4
  import esphome.config_validation as cv
4
- from esphome import automation
5
- from esphome.components import mqtt, web_server, time
6
5
  from esphome.const import (
6
+ CONF_DATE,
7
+ CONF_DATETIME,
8
+ CONF_DAY,
9
+ CONF_HOUR,
7
10
  CONF_ID,
11
+ CONF_MINUTE,
12
+ CONF_MONTH,
13
+ CONF_MQTT_ID,
8
14
  CONF_ON_TIME,
9
15
  CONF_ON_VALUE,
16
+ CONF_SECOND,
17
+ CONF_TIME,
10
18
  CONF_TIME_ID,
11
19
  CONF_TRIGGER_ID,
12
20
  CONF_TYPE,
13
- CONF_MQTT_ID,
14
21
  CONF_WEB_SERVER_ID,
15
- CONF_DATE,
16
- CONF_DATETIME,
17
- CONF_TIME,
18
22
  CONF_YEAR,
19
- CONF_MONTH,
20
- CONF_DAY,
21
- CONF_SECOND,
22
- CONF_HOUR,
23
- CONF_MINUTE,
24
23
  )
25
24
  from esphome.core import CORE, coroutine_with_priority
26
25
  from esphome.cpp_generator import MockObjClass
27
26
  from esphome.cpp_helpers import setup_entity
28
27
 
29
-
30
28
  CODEOWNERS = ["@rfdarter", "@jesserockz"]
31
29
  DEPENDENCIES = ["time"]
32
30
 
@@ -16,10 +16,11 @@ class DemoSensor : public sensor::Sensor, public PollingComponent {
16
16
  float base = std::isnan(this->state) ? 0.0f : this->state;
17
17
  this->publish_state(base + val * 10);
18
18
  } else {
19
- if (val < 0.1)
19
+ if (val < 0.1) {
20
20
  this->publish_state(NAN);
21
- else
21
+ } else {
22
22
  this->publish_state(val * 100);
23
+ }
23
24
  }
24
25
  }
25
26
  };
@@ -675,5 +675,36 @@ void DisplayPage::set_prev(DisplayPage *prev) { this->prev_ = prev; }
675
675
  void DisplayPage::set_next(DisplayPage *next) { this->next_ = next; }
676
676
  const display_writer_t &DisplayPage::get_writer() const { return this->writer_; }
677
677
 
678
+ const LogString *text_align_to_string(TextAlign textalign) {
679
+ switch (textalign) {
680
+ case TextAlign::TOP_LEFT:
681
+ return LOG_STR("TOP_LEFT");
682
+ case TextAlign::TOP_CENTER:
683
+ return LOG_STR("TOP_CENTER");
684
+ case TextAlign::TOP_RIGHT:
685
+ return LOG_STR("TOP_RIGHT");
686
+ case TextAlign::CENTER_LEFT:
687
+ return LOG_STR("CENTER_LEFT");
688
+ case TextAlign::CENTER:
689
+ return LOG_STR("CENTER");
690
+ case TextAlign::CENTER_RIGHT:
691
+ return LOG_STR("CENTER_RIGHT");
692
+ case TextAlign::BASELINE_LEFT:
693
+ return LOG_STR("BASELINE_LEFT");
694
+ case TextAlign::BASELINE_CENTER:
695
+ return LOG_STR("BASELINE_CENTER");
696
+ case TextAlign::BASELINE_RIGHT:
697
+ return LOG_STR("BASELINE_RIGHT");
698
+ case TextAlign::BOTTOM_LEFT:
699
+ return LOG_STR("BOTTOM_LEFT");
700
+ case TextAlign::BOTTOM_CENTER:
701
+ return LOG_STR("BOTTOM_CENTER");
702
+ case TextAlign::BOTTOM_RIGHT:
703
+ return LOG_STR("BOTTOM_RIGHT");
704
+ default:
705
+ return LOG_STR("UNKNOWN");
706
+ }
707
+ }
708
+
678
709
  } // namespace display
679
710
  } // namespace esphome
@@ -8,6 +8,7 @@
8
8
  #include "esphome/core/color.h"
9
9
  #include "esphome/core/automation.h"
10
10
  #include "esphome/core/time.h"
11
+ #include "esphome/core/log.h"
11
12
  #include "display_color_utils.h"
12
13
 
13
14
  #ifdef USE_GRAPH
@@ -737,5 +738,7 @@ class DisplayOnPageChangeTrigger : public Trigger<DisplayPage *, DisplayPage *>
737
738
  DisplayPage *to_{nullptr};
738
739
  };
739
740
 
741
+ const LogString *text_align_to_string(TextAlign textalign);
742
+
740
743
  } // namespace display
741
744
  } // namespace esphome
@@ -1,23 +1,26 @@
1
1
  import re
2
+
3
+ from esphome import automation, core
4
+ from esphome.automation import maybe_simple_id
2
5
  import esphome.codegen as cg
6
+ from esphome.components.number import Number
7
+ from esphome.components.select import Select
8
+ from esphome.components.switch import Switch
3
9
  import esphome.config_validation as cv
4
- from esphome import automation, core
5
10
  from esphome.const import (
6
- CONF_ID,
7
- CONF_TYPE,
8
- CONF_TRIGGER_ID,
9
- CONF_ON_VALUE,
11
+ CONF_ACTIVE,
10
12
  CONF_COMMAND,
11
13
  CONF_CUSTOM,
12
- CONF_NUMBER,
13
14
  CONF_FORMAT,
15
+ CONF_ID,
16
+ CONF_ITEMS,
14
17
  CONF_MODE,
15
- CONF_ACTIVE,
18
+ CONF_NUMBER,
19
+ CONF_ON_VALUE,
20
+ CONF_TEXT,
21
+ CONF_TRIGGER_ID,
22
+ CONF_TYPE,
16
23
  )
17
- from esphome.automation import maybe_simple_id
18
- from esphome.components.select import Select
19
- from esphome.components.number import Number
20
- from esphome.components.switch import Switch
21
24
 
22
25
  CODEOWNERS = ["@numo68"]
23
26
 
@@ -29,10 +32,8 @@ CONF_JOYSTICK = "joystick"
29
32
  CONF_LABEL = "label"
30
33
  CONF_MENU = "menu"
31
34
  CONF_BACK = "back"
32
- CONF_TEXT = "text"
33
35
  CONF_SELECT = "select"
34
36
  CONF_SWITCH = "switch"
35
- CONF_ITEMS = "items"
36
37
  CONF_ON_TEXT = "on_text"
37
38
  CONF_OFF_TEXT = "off_text"
38
39
  CONF_VALUE_LAMBDA = "value_lambda"
@@ -2,6 +2,6 @@ import esphome.config_validation as cv
2
2
 
3
3
  CODEOWNERS = ["@latonita"]
4
4
 
5
- CONFIG_SCHEMA = CONFIG_SCHEMA = cv.invalid(
5
+ CONFIG_SCHEMA = cv.invalid(
6
6
  "The ens160 sensor component has been renamed to ens160_i2c."
7
7
  )
@@ -1,11 +1,12 @@
1
1
  from dataclasses import dataclass
2
- from typing import Union, Optional
3
- from pathlib import Path
4
2
  import logging
5
3
  import os
6
- import esphome.final_validate as fv
4
+ from pathlib import Path
5
+ from typing import Optional, Union
7
6
 
8
- from esphome.helpers import copy_file_if_changed, write_file_if_changed, mkdir_p
7
+ from esphome import git
8
+ import esphome.codegen as cg
9
+ import esphome.config_validation as cv
9
10
  from esphome.const import (
10
11
  CONF_ADVANCED,
11
12
  CONF_BOARD,
@@ -15,6 +16,7 @@ from esphome.const import (
15
16
  CONF_IGNORE_EFUSE_MAC_CRC,
16
17
  CONF_NAME,
17
18
  CONF_PATH,
19
+ CONF_PLATFORM_VERSION,
18
20
  CONF_PLATFORMIO_OPTIONS,
19
21
  CONF_REF,
20
22
  CONF_REFRESH,
@@ -32,13 +34,12 @@ from esphome.const import (
32
34
  TYPE_GIT,
33
35
  TYPE_LOCAL,
34
36
  __version__,
35
- CONF_PLATFORM_VERSION,
36
37
  )
37
38
  from esphome.core import CORE, HexInt, TimePeriod
38
- import esphome.config_validation as cv
39
- import esphome.codegen as cg
40
- from esphome import git
39
+ import esphome.final_validate as fv
40
+ from esphome.helpers import copy_file_if_changed, mkdir_p, write_file_if_changed
41
41
 
42
+ from .boards import BOARDS
42
43
  from .const import ( # noqa
43
44
  KEY_BOARD,
44
45
  KEY_COMPONENTS,
@@ -54,12 +55,10 @@ from .const import ( # noqa
54
55
  VARIANT_FRIENDLY,
55
56
  VARIANTS,
56
57
  )
57
- from .boards import BOARDS
58
58
 
59
59
  # force import gpio to register pin schema
60
60
  from .gpio import esp32_pin_to_code # noqa
61
61
 
62
-
63
62
  _LOGGER = logging.getLogger(__name__)
64
63
  CODEOWNERS = ["@esphome/core"]
65
64
  AUTO_LOAD = ["preferences"]
@@ -173,6 +172,19 @@ def add_idf_component(
173
172
  KEY_COMPONENTS: components,
174
173
  KEY_SUBMODULES: submodules,
175
174
  }
175
+ else:
176
+ component_config = CORE.data[KEY_ESP32][KEY_COMPONENTS][name]
177
+ if components is not None:
178
+ component_config[KEY_COMPONENTS] = list(
179
+ set(component_config[KEY_COMPONENTS] + components)
180
+ )
181
+ if submodules is not None:
182
+ if component_config[KEY_SUBMODULES] is None:
183
+ component_config[KEY_SUBMODULES] = submodules
184
+ else:
185
+ component_config[KEY_SUBMODULES] = list(
186
+ set(component_config[KEY_SUBMODULES] + submodules)
187
+ )
176
188
 
177
189
 
178
190
  def add_extra_script(stage: str, filename: str, path: str):
@@ -1,4 +1,4 @@
1
- from .const import VARIANT_ESP32, VARIANT_ESP32S2, VARIANT_ESP32C3, VARIANT_ESP32S3
1
+ from .const import VARIANT_ESP32, VARIANT_ESP32C3, VARIANT_ESP32S2, VARIANT_ESP32S3
2
2
 
3
3
  ESP32_BASE_PINS = {
4
4
  "TX": 1,