esphome 2025.8.3__py3-none-any.whl → 2025.9.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 (370) hide show
  1. esphome/__main__.py +177 -105
  2. esphome/components/absolute_humidity/absolute_humidity.cpp +3 -5
  3. esphome/components/adc/__init__.py +1 -26
  4. esphome/components/adc/adc_sensor_esp32.cpp +29 -6
  5. esphome/components/adc/sensor.py +20 -0
  6. esphome/components/ade7880/ade7880.cpp +1 -1
  7. esphome/components/ags10/ags10.cpp +3 -18
  8. esphome/components/ags10/ags10.h +2 -12
  9. esphome/components/aht10/aht10.cpp +3 -3
  10. esphome/components/airthings_ble/__init__.py +2 -2
  11. esphome/components/alarm_control_panel/__init__.py +2 -2
  12. esphome/components/am2315c/am2315c.cpp +1 -17
  13. esphome/components/am2315c/am2315c.h +2 -3
  14. esphome/components/api/__init__.py +2 -2
  15. esphome/components/api/api_connection.cpp +38 -34
  16. esphome/components/api/api_connection.h +20 -40
  17. esphome/components/api/api_frame_helper.cpp +25 -25
  18. esphome/components/api/api_frame_helper.h +3 -3
  19. esphome/components/api/api_frame_helper_noise.cpp +75 -40
  20. esphome/components/api/api_frame_helper_noise.h +3 -7
  21. esphome/components/api/api_frame_helper_plaintext.cpp +17 -4
  22. esphome/components/api/api_frame_helper_plaintext.h +1 -4
  23. esphome/components/api/api_pb2.cpp +12 -2
  24. esphome/components/api/api_pb2.h +144 -143
  25. esphome/components/api/api_pb2_dump.cpp +6 -1
  26. esphome/components/api/api_pb2_service.cpp +0 -14
  27. esphome/components/api/api_pb2_service.h +1 -3
  28. esphome/components/api/client.py +5 -3
  29. esphome/components/api/proto.cpp +33 -37
  30. esphome/components/async_tcp/__init__.py +2 -2
  31. esphome/components/atm90e26/sensor.py +2 -0
  32. esphome/components/atm90e32/sensor.py +4 -2
  33. esphome/components/audio_adc/__init__.py +2 -2
  34. esphome/components/audio_dac/__init__.py +2 -2
  35. esphome/components/axs15231/touchscreen/axs15231_touchscreen.cpp +1 -1
  36. esphome/components/bedjet/bedjet_hub.cpp +1 -1
  37. esphome/components/binary_sensor/__init__.py +2 -2
  38. esphome/components/binary_sensor/binary_sensor.cpp +13 -0
  39. esphome/components/binary_sensor/binary_sensor.h +4 -7
  40. esphome/components/bl0940/__init__.py +6 -1
  41. esphome/components/bl0940/bl0940.cpp +178 -41
  42. esphome/components/bl0940/bl0940.h +121 -76
  43. esphome/components/bl0940/button/__init__.py +27 -0
  44. esphome/components/bl0940/button/calibration_reset_button.cpp +20 -0
  45. esphome/components/bl0940/button/calibration_reset_button.h +19 -0
  46. esphome/components/bl0940/number/__init__.py +94 -0
  47. esphome/components/bl0940/number/calibration_number.cpp +29 -0
  48. esphome/components/bl0940/number/calibration_number.h +26 -0
  49. esphome/components/bl0940/sensor.py +151 -2
  50. esphome/components/bl0942/bl0942.cpp +1 -1
  51. esphome/components/ble_client/output/__init__.py +4 -4
  52. esphome/components/bluetooth_proxy/__init__.py +1 -1
  53. esphome/components/bluetooth_proxy/bluetooth_connection.h +1 -1
  54. esphome/components/bluetooth_proxy/bluetooth_proxy.cpp +15 -7
  55. esphome/components/bluetooth_proxy/bluetooth_proxy.h +6 -3
  56. esphome/components/button/__init__.py +2 -2
  57. esphome/components/button/button.cpp +13 -0
  58. esphome/components/button/button.h +4 -7
  59. esphome/components/camera/buffer.h +18 -0
  60. esphome/components/camera/buffer_impl.cpp +20 -0
  61. esphome/components/camera/buffer_impl.h +26 -0
  62. esphome/components/camera/camera.h +43 -0
  63. esphome/components/camera/encoder.h +69 -0
  64. esphome/components/camera_encoder/__init__.py +62 -0
  65. esphome/components/camera_encoder/encoder_buffer_impl.cpp +23 -0
  66. esphome/components/camera_encoder/encoder_buffer_impl.h +25 -0
  67. esphome/components/camera_encoder/esp32_camera_jpeg_encoder.cpp +82 -0
  68. esphome/components/camera_encoder/esp32_camera_jpeg_encoder.h +39 -0
  69. esphome/components/captive_portal/__init__.py +2 -2
  70. esphome/components/captive_portal/captive_index.h +77 -97
  71. esphome/components/captive_portal/captive_portal.cpp +35 -12
  72. esphome/components/captive_portal/captive_portal.h +3 -3
  73. esphome/components/ccs811/ccs811.cpp +3 -3
  74. esphome/components/climate/__init__.py +2 -2
  75. esphome/components/climate/climate.cpp +1 -1
  76. esphome/components/cover/__init__.py +5 -5
  77. esphome/components/cover/cover.cpp +1 -1
  78. esphome/components/cover/cover.h +2 -2
  79. esphome/components/dallas_temp/dallas_temp.cpp +2 -2
  80. esphome/components/datetime/__init__.py +2 -2
  81. esphome/components/datetime/date_entity.h +2 -2
  82. esphome/components/datetime/datetime_entity.h +2 -2
  83. esphome/components/datetime/time_entity.h +2 -2
  84. esphome/components/debug/debug_esp32.cpp +1 -1
  85. esphome/components/display/__init__.py +4 -4
  86. esphome/components/duty_time/duty_time_sensor.cpp +1 -1
  87. esphome/components/esp32/__init__.py +0 -5
  88. esphome/components/esp32/gpio.cpp +27 -23
  89. esphome/components/esp32/gpio.h +26 -11
  90. esphome/components/esp32/preferences.cpp +8 -4
  91. esphome/components/esp32_ble/__init__.py +7 -2
  92. esphome/components/esp32_ble/ble_uuid.cpp +30 -9
  93. esphome/components/esp32_ble_beacon/esp32_ble_beacon.cpp +4 -3
  94. esphome/components/esp32_ble_client/ble_client_base.cpp +7 -3
  95. esphome/components/esp32_ble_client/ble_client_base.h +8 -5
  96. esphome/components/esp32_ble_tracker/__init__.py +2 -2
  97. esphome/components/esp32_ble_tracker/esp32_ble_tracker.cpp +11 -47
  98. esphome/components/esp32_ble_tracker/esp32_ble_tracker.h +2 -14
  99. esphome/components/esp8266/__init__.py +2 -2
  100. esphome/components/esp8266/core.cpp +2 -2
  101. esphome/components/esp8266/gpio.py +4 -4
  102. esphome/components/esp8266/preferences.cpp +30 -28
  103. esphome/components/esphome/ota/__init__.py +2 -2
  104. esphome/components/esphome/ota/ota_esphome.cpp +21 -19
  105. esphome/components/esphome/ota/ota_esphome.h +6 -5
  106. esphome/components/ethernet/__init__.py +18 -2
  107. esphome/components/ethernet/ethernet_component.cpp +53 -3
  108. esphome/components/ethernet/ethernet_component.h +4 -0
  109. esphome/components/event/__init__.py +2 -2
  110. esphome/components/event/event.h +4 -4
  111. esphome/components/factory_reset/button/factory_reset_button.cpp +18 -1
  112. esphome/components/factory_reset/button/factory_reset_button.h +6 -1
  113. esphome/components/factory_reset/switch/factory_reset_switch.cpp +18 -1
  114. esphome/components/factory_reset/switch/factory_reset_switch.h +5 -1
  115. esphome/components/fan/__init__.py +2 -2
  116. esphome/components/fan/fan.cpp +2 -1
  117. esphome/components/gdk101/gdk101.cpp +4 -4
  118. esphome/components/globals/__init__.py +2 -2
  119. esphome/components/gpio/binary_sensor/gpio_binary_sensor.cpp +19 -18
  120. esphome/components/gpio_expander/cached_gpio.h +36 -16
  121. esphome/components/grove_gas_mc_v2/grove_gas_mc_v2.cpp +5 -5
  122. esphome/components/gt911/touchscreen/gt911_touchscreen.cpp +1 -1
  123. esphome/components/haier/haier_base.cpp +1 -1
  124. esphome/components/haier/hon_climate.cpp +1 -1
  125. esphome/components/hlw8012/hlw8012.cpp +5 -5
  126. esphome/components/honeywellabp2_i2c/honeywellabp2.cpp +4 -4
  127. esphome/components/host/preferences.h +3 -2
  128. esphome/components/hte501/hte501.cpp +3 -21
  129. esphome/components/hte501/hte501.h +2 -3
  130. esphome/components/http_request/ota/__init__.py +2 -2
  131. esphome/components/i2c/__init__.py +2 -2
  132. esphome/components/i2c/i2c.cpp +13 -9
  133. esphome/components/i2c/i2c_bus.h +36 -6
  134. esphome/components/i2s_audio/__init__.py +8 -2
  135. esphome/components/i2s_audio/media_player/__init__.py +1 -1
  136. esphome/components/i2s_audio/microphone/__init__.py +1 -1
  137. esphome/components/i2s_audio/speaker/__init__.py +1 -1
  138. esphome/components/ina2xx_base/__init__.py +4 -2
  139. esphome/components/inkplate/__init__.py +1 -0
  140. esphome/components/inkplate/const.py +105 -0
  141. esphome/components/inkplate/display.py +238 -0
  142. esphome/components/{inkplate6 → inkplate}/inkplate.cpp +156 -74
  143. esphome/components/{inkplate6 → inkplate}/inkplate.h +28 -68
  144. esphome/components/inkplate6/__init__.py +0 -1
  145. esphome/components/inkplate6/display.py +2 -211
  146. esphome/components/integration/integration_sensor.cpp +1 -1
  147. esphome/components/json/__init__.py +2 -2
  148. esphome/components/kmeteriso/kmeteriso.cpp +1 -1
  149. esphome/components/lc709203f/lc709203f.cpp +4 -17
  150. esphome/components/lc709203f/lc709203f.h +2 -3
  151. esphome/components/ld2420/text_sensor/{text_sensor.cpp → ld2420_text_sensor.cpp} +1 -1
  152. esphome/components/ld2450/ld2450.cpp +1 -1
  153. esphome/components/libretiny/preferences.cpp +13 -5
  154. esphome/components/light/__init__.py +2 -2
  155. esphome/components/light/addressable_light_effect.h +7 -0
  156. esphome/components/light/base_light_effects.h +8 -0
  157. esphome/components/light/light_call.cpp +22 -20
  158. esphome/components/light/light_effect.cpp +36 -0
  159. esphome/components/light/light_effect.h +14 -0
  160. esphome/components/light/light_json_schema.cpp +9 -1
  161. esphome/components/light/light_state.cpp +2 -2
  162. esphome/components/light/light_state.h +39 -0
  163. esphome/components/lock/__init__.py +2 -2
  164. esphome/components/lock/lock.h +2 -2
  165. esphome/components/logger/__init__.py +2 -2
  166. esphome/components/logger/logger.cpp +25 -4
  167. esphome/components/logger/logger.h +1 -1
  168. esphome/components/logger/logger_esp32.cpp +16 -8
  169. esphome/components/logger/logger_esp8266.cpp +11 -3
  170. esphome/components/logger/logger_libretiny.cpp +13 -3
  171. esphome/components/logger/logger_rp2040.cpp +14 -3
  172. esphome/components/logger/logger_zephyr.cpp +15 -4
  173. esphome/components/lvgl/defines.py +1 -0
  174. esphome/components/lvgl/hello_world.py +96 -33
  175. esphome/components/lvgl/number/lvgl_number.h +1 -1
  176. esphome/components/lvgl/select/lvgl_select.h +1 -1
  177. esphome/components/lvgl/widgets/__init__.py +0 -1
  178. esphome/components/lvgl/widgets/spinbox.py +20 -11
  179. esphome/components/m5stack_8angle/binary_sensor/m5stack_8angle_binary_sensor.cpp +1 -1
  180. esphome/components/m5stack_8angle/sensor/m5stack_8angle_sensor.cpp +1 -1
  181. esphome/components/mapping/__init__.py +13 -5
  182. esphome/components/mapping/mapping.h +69 -0
  183. esphome/components/max17043/max17043.cpp +2 -2
  184. esphome/components/mcp23016/__init__.py +1 -0
  185. esphome/components/mcp23016/mcp23016.cpp +20 -5
  186. esphome/components/mcp23016/mcp23016.h +10 -4
  187. esphome/components/mcp23x08_base/mcp23x08_base.cpp +1 -1
  188. esphome/components/mcp23x17_base/mcp23x17_base.cpp +2 -2
  189. esphome/components/md5/md5.cpp +3 -2
  190. esphome/components/mdns/__init__.py +2 -2
  191. esphome/components/mdns/mdns_component.cpp +145 -54
  192. esphome/components/media_player/__init__.py +2 -2
  193. esphome/components/micro_wake_word/__init__.py +2 -2
  194. esphome/components/microphone/__init__.py +2 -2
  195. esphome/components/mipi/__init__.py +77 -33
  196. esphome/components/mipi_rgb/__init__.py +2 -0
  197. esphome/components/mipi_rgb/display.py +321 -0
  198. esphome/components/mipi_rgb/mipi_rgb.cpp +388 -0
  199. esphome/components/mipi_rgb/mipi_rgb.h +127 -0
  200. esphome/components/mipi_rgb/models/guition.py +24 -0
  201. esphome/components/mipi_rgb/models/lilygo.py +228 -0
  202. esphome/components/mipi_rgb/models/rpi.py +9 -0
  203. esphome/components/mipi_rgb/models/st7701s.py +214 -0
  204. esphome/components/mipi_rgb/models/waveshare.py +64 -0
  205. esphome/components/mipi_spi/models/jc.py +229 -0
  206. esphome/components/mlx90614/mlx90614.cpp +1 -16
  207. esphome/components/mlx90614/mlx90614.h +0 -1
  208. esphome/components/mqtt/__init__.py +2 -2
  209. esphome/components/mqtt/mqtt_client.cpp +1 -1
  210. esphome/components/mqtt/mqtt_sensor.cpp +7 -2
  211. esphome/components/ms5611/ms5611.cpp +7 -6
  212. esphome/components/network/__init__.py +2 -2
  213. esphome/components/nextion/nextion_upload.cpp +4 -1
  214. esphome/components/nrf52/__init__.py +49 -6
  215. esphome/components/nrf52/const.py +1 -0
  216. esphome/components/nrf52/dfu.cpp +51 -0
  217. esphome/components/nrf52/dfu.h +24 -0
  218. esphome/components/ntc/ntc.cpp +1 -1
  219. esphome/components/number/__init__.py +2 -2
  220. esphome/components/number/automation.cpp +1 -1
  221. esphome/components/number/number.cpp +21 -0
  222. esphome/components/number/number.h +4 -13
  223. esphome/components/opentherm/hub.h +6 -6
  224. esphome/components/opentherm/number/{number.cpp → opentherm_number.cpp} +2 -2
  225. esphome/components/opentherm/output/{output.cpp → opentherm_output.cpp} +1 -1
  226. esphome/components/opentherm/switch/{switch.cpp → opentherm_switch.cpp} +1 -1
  227. esphome/components/openthread/openthread.cpp +41 -7
  228. esphome/components/openthread/openthread.h +11 -0
  229. esphome/components/ota/__init__.py +2 -2
  230. esphome/components/pca6416a/__init__.py +1 -0
  231. esphome/components/pca6416a/pca6416a.cpp +20 -5
  232. esphome/components/pca6416a/pca6416a.h +12 -5
  233. esphome/components/pca9554/__init__.py +2 -1
  234. esphome/components/pca9554/pca9554.cpp +12 -18
  235. esphome/components/pca9554/pca9554.h +10 -9
  236. esphome/components/pcf8574/__init__.py +1 -0
  237. esphome/components/pcf8574/pcf8574.cpp +14 -5
  238. esphome/components/pcf8574/pcf8574.h +13 -6
  239. esphome/components/pi4ioe5v6408/pi4ioe5v6408.cpp +7 -7
  240. esphome/components/pipsolar/__init__.py +3 -3
  241. esphome/components/pipsolar/output/__init__.py +4 -4
  242. esphome/components/pulse_width/pulse_width.cpp +2 -2
  243. esphome/components/qmp6988/qmp6988.cpp +81 -126
  244. esphome/components/qmp6988/qmp6988.h +31 -37
  245. esphome/components/radon_eye_ble/__init__.py +2 -2
  246. esphome/components/remote_base/__init__.py +6 -8
  247. esphome/components/rotary_encoder/rotary_encoder.cpp +1 -1
  248. esphome/components/rp2040/__init__.py +2 -2
  249. esphome/components/runtime_stats/runtime_stats.cpp +10 -23
  250. esphome/components/runtime_stats/runtime_stats.h +4 -10
  251. esphome/components/safe_mode/__init__.py +2 -2
  252. esphome/components/safe_mode/safe_mode.cpp +33 -31
  253. esphome/components/script/script.cpp +6 -0
  254. esphome/components/script/script.h +19 -5
  255. esphome/components/sdm_meter/sensor.py +3 -1
  256. esphome/components/select/__init__.py +2 -2
  257. esphome/components/select/select.cpp +3 -3
  258. esphome/components/select/select.h +2 -2
  259. esphome/components/select/select_call.cpp +1 -1
  260. esphome/components/sen5x/sen5x.cpp +58 -55
  261. esphome/components/sen5x/sen5x.h +21 -15
  262. esphome/components/sen5x/sensor.py +67 -44
  263. esphome/components/sensirion_common/i2c_sensirion.cpp +18 -47
  264. esphome/components/sensirion_common/i2c_sensirion.h +39 -55
  265. esphome/components/sensor/__init__.py +2 -2
  266. esphome/components/sensor/automation.h +1 -1
  267. esphome/components/sensor/sensor.cpp +34 -6
  268. esphome/components/sensor/sensor.h +4 -21
  269. esphome/components/sgp30/sgp30.cpp +34 -35
  270. esphome/components/sgp30/sgp30.h +11 -10
  271. esphome/components/sgp4x/sgp4x.cpp +2 -2
  272. esphome/components/shelly_dimmer/light.py +7 -7
  273. esphome/components/sht4x/sht4x.cpp +1 -1
  274. esphome/components/sntp/sntp_component.cpp +36 -9
  275. esphome/components/sntp/sntp_component.h +7 -0
  276. esphome/components/sound_level/sound_level.cpp +1 -1
  277. esphome/components/speaker/__init__.py +2 -2
  278. esphome/components/speaker/media_player/__init__.py +2 -2
  279. esphome/components/speaker/media_player/speaker_media_player.cpp +1 -1
  280. esphome/components/spi/__init__.py +2 -2
  281. esphome/components/sprinkler/sprinkler.cpp +1 -1
  282. esphome/components/sps30/sps30.cpp +18 -23
  283. esphome/components/sps30/sps30.h +3 -3
  284. esphome/components/status_led/__init__.py +2 -2
  285. esphome/components/stepper/__init__.py +2 -2
  286. esphome/components/switch/__init__.py +2 -2
  287. esphome/components/switch/switch.cpp +5 -5
  288. esphome/components/sx1509/__init__.py +1 -1
  289. esphome/components/sx1509/sx1509.cpp +12 -7
  290. esphome/components/sx1509/sx1509.h +11 -4
  291. esphome/components/tca9555/tca9555.cpp +5 -5
  292. esphome/components/tee501/tee501.cpp +2 -21
  293. esphome/components/tee501/tee501.h +2 -4
  294. esphome/components/template/alarm_control_panel/template_alarm_control_panel.cpp +1 -1
  295. esphome/components/template/datetime/template_date.cpp +1 -1
  296. esphome/components/template/datetime/template_datetime.cpp +2 -2
  297. esphome/components/template/datetime/template_time.cpp +1 -1
  298. esphome/components/template/number/template_number.cpp +1 -1
  299. esphome/components/template/select/template_select.cpp +1 -1
  300. esphome/components/template/text/template_text.cpp +1 -1
  301. esphome/components/text/__init__.py +2 -2
  302. esphome/components/text/text.h +2 -2
  303. esphome/components/text_sensor/__init__.py +2 -2
  304. esphome/components/text_sensor/text_sensor.h +4 -4
  305. esphome/components/thermostat/climate.py +11 -7
  306. esphome/components/thermostat/thermostat_climate.cpp +237 -206
  307. esphome/components/thermostat/thermostat_climate.h +52 -41
  308. esphome/components/time/__init__.py +2 -2
  309. esphome/components/tmp1075/tmp1075.cpp +1 -1
  310. esphome/components/total_daily_energy/total_daily_energy.cpp +1 -1
  311. esphome/components/touchscreen/__init__.py +2 -2
  312. esphome/components/tuya/number/tuya_number.cpp +1 -1
  313. esphome/components/udp/udp_component.cpp +3 -3
  314. esphome/components/ufire_ec/ufire_ec.cpp +4 -4
  315. esphome/components/ufire_ise/ufire_ise.cpp +4 -4
  316. esphome/components/update/__init__.py +2 -2
  317. esphome/components/usb_uart/usb_uart.cpp +1 -1
  318. esphome/components/valve/__init__.py +5 -5
  319. esphome/components/valve/valve.cpp +1 -1
  320. esphome/components/valve/valve.h +2 -2
  321. esphome/components/wake_on_lan/wake_on_lan.cpp +2 -2
  322. esphome/components/waveshare_epaper/waveshare_213v3.cpp +1 -1
  323. esphome/components/web_server/__init__.py +2 -2
  324. esphome/components/web_server/ota/__init__.py +2 -2
  325. esphome/components/web_server/ota/ota_web_server.cpp +11 -0
  326. esphome/components/web_server/server_index_v2.h +149 -149
  327. esphome/components/web_server/web_server.cpp +58 -12
  328. esphome/components/web_server_base/__init__.py +2 -2
  329. esphome/components/wifi/__init__.py +5 -5
  330. esphome/components/wifi/wifi_component.cpp +4 -4
  331. esphome/components/wifi/wifi_component_esp_idf.cpp +2 -0
  332. esphome/components/wifi_info/wifi_info_text_sensor.h +3 -2
  333. esphome/config_validation.py +2 -2
  334. esphome/const.py +3 -1
  335. esphome/core/__init__.py +1 -0
  336. esphome/core/application.cpp +89 -51
  337. esphome/core/application.h +1 -0
  338. esphome/core/component.cpp +41 -19
  339. esphome/core/component.h +17 -13
  340. esphome/core/config.py +7 -7
  341. esphome/core/defines.h +5 -0
  342. esphome/core/entity_base.cpp +22 -8
  343. esphome/core/entity_base.h +43 -0
  344. esphome/core/helpers.cpp +34 -20
  345. esphome/core/helpers.h +33 -3
  346. esphome/core/ring_buffer.cpp +6 -2
  347. esphome/core/ring_buffer.h +2 -1
  348. esphome/core/scheduler.cpp +178 -97
  349. esphome/core/scheduler.h +67 -36
  350. esphome/core/time.cpp +6 -20
  351. esphome/coroutine.py +80 -3
  352. esphome/cpp_generator.py +13 -0
  353. esphome/cpp_helpers.py +2 -2
  354. esphome/dashboard/web_server.py +69 -15
  355. esphome/espota2.py +13 -6
  356. esphome/helpers.py +68 -83
  357. esphome/resolver.py +67 -0
  358. esphome/util.py +9 -6
  359. esphome/wizard.py +81 -34
  360. esphome/writer.py +13 -0
  361. {esphome-2025.8.3.dist-info → esphome-2025.9.0.dist-info}/METADATA +9 -9
  362. {esphome-2025.8.3.dist-info → esphome-2025.9.0.dist-info}/RECORD +370 -339
  363. /esphome/components/ld2420/text_sensor/{text_sensor.h → ld2420_text_sensor.h} +0 -0
  364. /esphome/components/opentherm/number/{number.h → opentherm_number.h} +0 -0
  365. /esphome/components/opentherm/output/{output.h → opentherm_output.h} +0 -0
  366. /esphome/components/opentherm/switch/{switch.h → opentherm_switch.h} +0 -0
  367. {esphome-2025.8.3.dist-info → esphome-2025.9.0.dist-info}/WHEEL +0 -0
  368. {esphome-2025.8.3.dist-info → esphome-2025.9.0.dist-info}/entry_points.txt +0 -0
  369. {esphome-2025.8.3.dist-info → esphome-2025.9.0.dist-info}/licenses/LICENSE +0 -0
  370. {esphome-2025.8.3.dist-info → esphome-2025.9.0.dist-info}/top_level.txt +0 -0
@@ -255,4 +255,233 @@ DriverChip(
255
255
  ),
256
256
  )
257
257
 
258
+ DriverChip(
259
+ "JC3636W518V2",
260
+ height=360,
261
+ width=360,
262
+ offset_height=1,
263
+ draw_rounding=1,
264
+ cs_pin=10,
265
+ reset_pin=47,
266
+ invert_colors=True,
267
+ color_order=MODE_RGB,
268
+ bus_mode=TYPE_QUAD,
269
+ data_rate="40MHz",
270
+ initsequence=(
271
+ (0xF0, 0x28),
272
+ (0xF2, 0x28),
273
+ (0x73, 0xF0),
274
+ (0x7C, 0xD1),
275
+ (0x83, 0xE0),
276
+ (0x84, 0x61),
277
+ (0xF2, 0x82),
278
+ (0xF0, 0x00),
279
+ (0xF0, 0x01),
280
+ (0xF1, 0x01),
281
+ (0xB0, 0x56),
282
+ (0xB1, 0x4D),
283
+ (0xB2, 0x24),
284
+ (0xB4, 0x87),
285
+ (0xB5, 0x44),
286
+ (0xB6, 0x8B),
287
+ (0xB7, 0x40),
288
+ (0xB8, 0x86),
289
+ (0xBA, 0x00),
290
+ (0xBB, 0x08),
291
+ (0xBC, 0x08),
292
+ (0xBD, 0x00),
293
+ (0xC0, 0x80),
294
+ (0xC1, 0x10),
295
+ (0xC2, 0x37),
296
+ (0xC3, 0x80),
297
+ (0xC4, 0x10),
298
+ (0xC5, 0x37),
299
+ (0xC6, 0xA9),
300
+ (0xC7, 0x41),
301
+ (0xC8, 0x01),
302
+ (0xC9, 0xA9),
303
+ (0xCA, 0x41),
304
+ (0xCB, 0x01),
305
+ (0xD0, 0x91),
306
+ (0xD1, 0x68),
307
+ (0xD2, 0x68),
308
+ (0xF5, 0x00, 0xA5),
309
+ (0xDD, 0x4F),
310
+ (0xDE, 0x4F),
311
+ (0xF1, 0x10),
312
+ (0xF0, 0x00),
313
+ (0xF0, 0x02),
314
+ (
315
+ 0xE0,
316
+ 0xF0,
317
+ 0x0A,
318
+ 0x10,
319
+ 0x09,
320
+ 0x09,
321
+ 0x36,
322
+ 0x35,
323
+ 0x33,
324
+ 0x4A,
325
+ 0x29,
326
+ 0x15,
327
+ 0x15,
328
+ 0x2E,
329
+ 0x34,
330
+ ),
331
+ (
332
+ 0xE1,
333
+ 0xF0,
334
+ 0x0A,
335
+ 0x0F,
336
+ 0x08,
337
+ 0x08,
338
+ 0x05,
339
+ 0x34,
340
+ 0x33,
341
+ 0x4A,
342
+ 0x39,
343
+ 0x15,
344
+ 0x15,
345
+ 0x2D,
346
+ 0x33,
347
+ ),
348
+ (0xF0, 0x10),
349
+ (0xF3, 0x10),
350
+ (0xE0, 0x07),
351
+ (0xE1, 0x00),
352
+ (0xE2, 0x00),
353
+ (0xE3, 0x00),
354
+ (0xE4, 0xE0),
355
+ (0xE5, 0x06),
356
+ (0xE6, 0x21),
357
+ (0xE7, 0x01),
358
+ (0xE8, 0x05),
359
+ (0xE9, 0x02),
360
+ (0xEA, 0xDA),
361
+ (0xEB, 0x00),
362
+ (0xEC, 0x00),
363
+ (0xED, 0x0F),
364
+ (0xEE, 0x00),
365
+ (0xEF, 0x00),
366
+ (0xF8, 0x00),
367
+ (0xF9, 0x00),
368
+ (0xFA, 0x00),
369
+ (0xFB, 0x00),
370
+ (0xFC, 0x00),
371
+ (0xFD, 0x00),
372
+ (0xFE, 0x00),
373
+ (0xFF, 0x00),
374
+ (0x60, 0x40),
375
+ (0x61, 0x04),
376
+ (0x62, 0x00),
377
+ (0x63, 0x42),
378
+ (0x64, 0xD9),
379
+ (0x65, 0x00),
380
+ (0x66, 0x00),
381
+ (0x67, 0x00),
382
+ (0x68, 0x00),
383
+ (0x69, 0x00),
384
+ (0x6A, 0x00),
385
+ (0x6B, 0x00),
386
+ (0x70, 0x40),
387
+ (0x71, 0x03),
388
+ (0x72, 0x00),
389
+ (0x73, 0x42),
390
+ (0x74, 0xD8),
391
+ (0x75, 0x00),
392
+ (0x76, 0x00),
393
+ (0x77, 0x00),
394
+ (0x78, 0x00),
395
+ (0x79, 0x00),
396
+ (0x7A, 0x00),
397
+ (0x7B, 0x00),
398
+ (0x80, 0x48),
399
+ (0x81, 0x00),
400
+ (0x82, 0x06),
401
+ (0x83, 0x02),
402
+ (0x84, 0xD6),
403
+ (0x85, 0x04),
404
+ (0x86, 0x00),
405
+ (0x87, 0x00),
406
+ (0x88, 0x48),
407
+ (0x89, 0x00),
408
+ (0x8A, 0x08),
409
+ (0x8B, 0x02),
410
+ (0x8C, 0xD8),
411
+ (0x8D, 0x04),
412
+ (0x8E, 0x00),
413
+ (0x8F, 0x00),
414
+ (0x90, 0x48),
415
+ (0x91, 0x00),
416
+ (0x92, 0x0A),
417
+ (0x93, 0x02),
418
+ (0x94, 0xDA),
419
+ (0x95, 0x04),
420
+ (0x96, 0x00),
421
+ (0x97, 0x00),
422
+ (0x98, 0x48),
423
+ (0x99, 0x00),
424
+ (0x9A, 0x0C),
425
+ (0x9B, 0x02),
426
+ (0x9C, 0xDC),
427
+ (0x9D, 0x04),
428
+ (0x9E, 0x00),
429
+ (0x9F, 0x00),
430
+ (0xA0, 0x48),
431
+ (0xA1, 0x00),
432
+ (0xA2, 0x05),
433
+ (0xA3, 0x02),
434
+ (0xA4, 0xD5),
435
+ (0xA5, 0x04),
436
+ (0xA6, 0x00),
437
+ (0xA7, 0x00),
438
+ (0xA8, 0x48),
439
+ (0xA9, 0x00),
440
+ (0xAA, 0x07),
441
+ (0xAB, 0x02),
442
+ (0xAC, 0xD7),
443
+ (0xAD, 0x04),
444
+ (0xAE, 0x00),
445
+ (0xAF, 0x00),
446
+ (0xB0, 0x48),
447
+ (0xB1, 0x00),
448
+ (0xB2, 0x09),
449
+ (0xB3, 0x02),
450
+ (0xB4, 0xD9),
451
+ (0xB5, 0x04),
452
+ (0xB6, 0x00),
453
+ (0xB7, 0x00),
454
+ (0xB8, 0x48),
455
+ (0xB9, 0x00),
456
+ (0xBA, 0x0B),
457
+ (0xBB, 0x02),
458
+ (0xBC, 0xDB),
459
+ (0xBD, 0x04),
460
+ (0xBE, 0x00),
461
+ (0xBF, 0x00),
462
+ (0xC0, 0x10),
463
+ (0xC1, 0x47),
464
+ (0xC2, 0x56),
465
+ (0xC3, 0x65),
466
+ (0xC4, 0x74),
467
+ (0xC5, 0x88),
468
+ (0xC6, 0x99),
469
+ (0xC7, 0x01),
470
+ (0xC8, 0xBB),
471
+ (0xC9, 0xAA),
472
+ (0xD0, 0x10),
473
+ (0xD1, 0x47),
474
+ (0xD2, 0x56),
475
+ (0xD3, 0x65),
476
+ (0xD4, 0x74),
477
+ (0xD5, 0x88),
478
+ (0xD6, 0x99),
479
+ (0xD7, 0x01),
480
+ (0xD8, 0xBB),
481
+ (0xD9, 0xAA),
482
+ (0xF3, 0x01),
483
+ (0xF0, 0x00),
484
+ ),
485
+ )
486
+
258
487
  models = {}
@@ -50,28 +50,13 @@ bool MLX90614Component::write_emissivity_() {
50
50
  return true;
51
51
  }
52
52
 
53
- uint8_t MLX90614Component::crc8_pec_(const uint8_t *data, uint8_t len) {
54
- uint8_t crc = 0;
55
- for (uint8_t i = 0; i < len; i++) {
56
- uint8_t in = data[i];
57
- for (uint8_t j = 0; j < 8; j++) {
58
- bool carry = (crc ^ in) & 0x80;
59
- crc <<= 1;
60
- if (carry)
61
- crc ^= 0x07;
62
- in <<= 1;
63
- }
64
- }
65
- return crc;
66
- }
67
-
68
53
  bool MLX90614Component::write_bytes_(uint8_t reg, uint16_t data) {
69
54
  uint8_t buf[5];
70
55
  buf[0] = this->address_ << 1;
71
56
  buf[1] = reg;
72
57
  buf[2] = data & 0xFF;
73
58
  buf[3] = data >> 8;
74
- buf[4] = this->crc8_pec_(buf, 4);
59
+ buf[4] = crc8(buf, 4, 0x00, 0x07, true);
75
60
  return this->write_bytes(reg, buf + 2, 3);
76
61
  }
77
62
 
@@ -22,7 +22,6 @@ class MLX90614Component : public PollingComponent, public i2c::I2CDevice {
22
22
  protected:
23
23
  bool write_emissivity_();
24
24
 
25
- uint8_t crc8_pec_(const uint8_t *data, uint8_t len);
26
25
  bool write_bytes_(uint8_t reg, uint16_t data);
27
26
 
28
27
  sensor::Sensor *ambient_sensor_{nullptr};
@@ -57,7 +57,7 @@ from esphome.const import (
57
57
  PLATFORM_ESP8266,
58
58
  PlatformFramework,
59
59
  )
60
- from esphome.core import CORE, coroutine_with_priority
60
+ from esphome.core import CORE, CoroPriority, coroutine_with_priority
61
61
 
62
62
  DEPENDENCIES = ["network"]
63
63
 
@@ -321,7 +321,7 @@ def exp_mqtt_message(config):
321
321
  )
322
322
 
323
323
 
324
- @coroutine_with_priority(40.0)
324
+ @coroutine_with_priority(CoroPriority.WEB)
325
325
  async def to_code(config):
326
326
  var = cg.new_Pvariable(config[CONF_ID])
327
327
  await cg.register_component(var, config)
@@ -491,7 +491,7 @@ bool MQTTClientComponent::publish(const std::string &topic, const std::string &p
491
491
 
492
492
  bool MQTTClientComponent::publish(const std::string &topic, const char *payload, size_t payload_length, uint8_t qos,
493
493
  bool retain) {
494
- return publish({.topic = topic, .payload = payload, .qos = qos, .retain = retain});
494
+ return publish({.topic = topic, .payload = std::string(payload, payload_length), .qos = qos, .retain = retain});
495
495
  }
496
496
 
497
497
  bool MQTTClientComponent::publish(const MQTTMessage &message) {
@@ -58,8 +58,13 @@ void MQTTSensorComponent::send_discovery(JsonObject root, mqtt::SendDiscoveryCon
58
58
  if (this->sensor_->get_force_update())
59
59
  root[MQTT_FORCE_UPDATE] = true;
60
60
 
61
- if (this->sensor_->get_state_class() != STATE_CLASS_NONE)
62
- root[MQTT_STATE_CLASS] = state_class_to_string(this->sensor_->get_state_class());
61
+ if (this->sensor_->get_state_class() != STATE_CLASS_NONE) {
62
+ #ifdef USE_STORE_LOG_STR_IN_FLASH
63
+ root[MQTT_STATE_CLASS] = (const __FlashStringHelper *) state_class_to_string(this->sensor_->get_state_class());
64
+ #else
65
+ root[MQTT_STATE_CLASS] = LOG_STR_ARG(state_class_to_string(this->sensor_->get_state_class()));
66
+ #endif
67
+ }
63
68
 
64
69
  config.command_topic = false;
65
70
  }
@@ -19,13 +19,14 @@ void MS5611Component::setup() {
19
19
  this->mark_failed();
20
20
  return;
21
21
  }
22
- delay(100); // NOLINT
23
- for (uint8_t offset = 0; offset < 6; offset++) {
24
- if (!this->read_byte_16(MS5611_CMD_READ_PROM + (offset * 2), &this->prom_[offset])) {
25
- this->mark_failed();
26
- return;
22
+ this->set_timeout(100, [this]() {
23
+ for (uint8_t offset = 0; offset < 6; offset++) {
24
+ if (!this->read_byte_16(MS5611_CMD_READ_PROM + (offset * 2), &this->prom_[offset])) {
25
+ this->mark_failed();
26
+ return;
27
+ }
27
28
  }
28
- }
29
+ });
29
30
  }
30
31
  void MS5611Component::dump_config() {
31
32
  ESP_LOGCONFIG(TAG, "MS5611:");
@@ -2,7 +2,7 @@ import esphome.codegen as cg
2
2
  from esphome.components.esp32 import add_idf_sdkconfig_option
3
3
  import esphome.config_validation as cv
4
4
  from esphome.const import CONF_ENABLE_IPV6, CONF_MIN_IPV6_ADDR_COUNT
5
- from esphome.core import CORE, coroutine_with_priority
5
+ from esphome.core import CORE, CoroPriority, coroutine_with_priority
6
6
 
7
7
  CODEOWNERS = ["@esphome/core"]
8
8
  AUTO_LOAD = ["mdns"]
@@ -36,7 +36,7 @@ CONFIG_SCHEMA = cv.Schema(
36
36
  )
37
37
 
38
38
 
39
- @coroutine_with_priority(201.0)
39
+ @coroutine_with_priority(CoroPriority.NETWORK)
40
40
  async def to_code(config):
41
41
  cg.add_define("USE_NETWORK")
42
42
  if CORE.using_arduino and CORE.is_esp32:
@@ -11,7 +11,10 @@ static const char *const TAG = "nextion.upload";
11
11
  bool Nextion::upload_end_(bool successful) {
12
12
  if (successful) {
13
13
  ESP_LOGD(TAG, "Upload successful");
14
- delay(1500); // NOLINT
14
+ for (uint8_t i = 0; i <= 5; i++) {
15
+ delay(1000); // NOLINT
16
+ App.feed_wdt(); // Feed the watchdog timer.
17
+ }
15
18
  App.safe_reboot();
16
19
  } else {
17
20
  ESP_LOGE(TAG, "Upload failed");
@@ -2,10 +2,13 @@ from __future__ import annotations
2
2
 
3
3
  from pathlib import Path
4
4
 
5
+ from esphome import pins
5
6
  import esphome.codegen as cg
6
7
  from esphome.components.zephyr import (
7
8
  copy_files as zephyr_copy_files,
8
9
  zephyr_add_pm_static,
10
+ zephyr_add_prj_conf,
11
+ zephyr_data,
9
12
  zephyr_set_core_data,
10
13
  zephyr_to_code,
11
14
  )
@@ -18,6 +21,8 @@ import esphome.config_validation as cv
18
21
  from esphome.const import (
19
22
  CONF_BOARD,
20
23
  CONF_FRAMEWORK,
24
+ CONF_ID,
25
+ CONF_RESET_PIN,
21
26
  KEY_CORE,
22
27
  KEY_FRAMEWORK_VERSION,
23
28
  KEY_TARGET_FRAMEWORK,
@@ -25,7 +30,7 @@ from esphome.const import (
25
30
  PLATFORM_NRF52,
26
31
  ThreadModel,
27
32
  )
28
- from esphome.core import CORE, EsphomeError, coroutine_with_priority
33
+ from esphome.core import CORE, CoroPriority, EsphomeError, coroutine_with_priority
29
34
  from esphome.storage_json import StorageJSON
30
35
  from esphome.types import ConfigType
31
36
 
@@ -90,19 +95,44 @@ def _detect_bootloader(config: ConfigType) -> ConfigType:
90
95
  return config
91
96
 
92
97
 
98
+ nrf52_ns = cg.esphome_ns.namespace("nrf52")
99
+ DeviceFirmwareUpdate = nrf52_ns.class_("DeviceFirmwareUpdate", cg.Component)
100
+
101
+ CONF_DFU = "dfu"
102
+
93
103
  CONFIG_SCHEMA = cv.All(
104
+ _detect_bootloader,
105
+ set_core_data,
94
106
  cv.Schema(
95
107
  {
96
108
  cv.Required(CONF_BOARD): cv.string_strict,
97
109
  cv.Optional(KEY_BOOTLOADER): cv.one_of(*BOOTLOADERS, lower=True),
110
+ cv.Optional(CONF_DFU): cv.Schema(
111
+ {
112
+ cv.GenerateID(): cv.declare_id(DeviceFirmwareUpdate),
113
+ cv.Required(CONF_RESET_PIN): pins.gpio_output_pin_schema,
114
+ }
115
+ ),
98
116
  }
99
117
  ),
100
- _detect_bootloader,
101
- set_core_data,
102
118
  )
103
119
 
104
120
 
105
- @coroutine_with_priority(1000)
121
+ def _validate_mcumgr(config):
122
+ bootloader = zephyr_data()[KEY_BOOTLOADER]
123
+ if bootloader == BOOTLOADER_MCUBOOT:
124
+ raise cv.Invalid(f"'{bootloader}' bootloader does not support DFU")
125
+
126
+
127
+ def _final_validate(config):
128
+ if CONF_DFU in config:
129
+ _validate_mcumgr(config)
130
+
131
+
132
+ FINAL_VALIDATE_SCHEMA = _final_validate
133
+
134
+
135
+ @coroutine_with_priority(CoroPriority.PLATFORM)
106
136
  async def to_code(config: ConfigType) -> None:
107
137
  """Convert the configuration to code."""
108
138
  cg.add_platformio_option("board", config[CONF_BOARD])
@@ -119,8 +149,8 @@ async def to_code(config: ConfigType) -> None:
119
149
  cg.add_platformio_option(
120
150
  "platform_packages",
121
151
  [
122
- "platformio/framework-zephyr@https://github.com/tomaszduda23/framework-sdk-nrf/archive/refs/tags/v2.6.1-4.zip",
123
- "platformio/toolchain-gccarmnoneeabi@https://github.com/tomaszduda23/toolchain-sdk-ng/archive/refs/tags/v0.16.1-1.zip",
152
+ "platformio/framework-zephyr@https://github.com/tomaszduda23/framework-sdk-nrf/archive/refs/tags/v2.6.1-7.zip",
153
+ "platformio/toolchain-gccarmnoneeabi@https://github.com/tomaszduda23/toolchain-sdk-ng/archive/refs/tags/v0.17.4-0.zip",
124
154
  ],
125
155
  )
126
156
 
@@ -136,6 +166,19 @@ async def to_code(config: ConfigType) -> None:
136
166
 
137
167
  zephyr_to_code(config)
138
168
 
169
+ if dfu_config := config.get(CONF_DFU):
170
+ CORE.add_job(_dfu_to_code, dfu_config)
171
+
172
+
173
+ @coroutine_with_priority(CoroPriority.DIAGNOSTICS)
174
+ async def _dfu_to_code(dfu_config):
175
+ cg.add_define("USE_NRF52_DFU")
176
+ var = cg.new_Pvariable(dfu_config[CONF_ID])
177
+ pin = await cg.gpio_pin_expression(dfu_config[CONF_RESET_PIN])
178
+ cg.add(var.set_reset_pin(pin))
179
+ zephyr_add_prj_conf("CDC_ACM_DTE_RATE_CALLBACK_SUPPORT", True)
180
+ await cg.register_component(var, dfu_config)
181
+
139
182
 
140
183
  def copy_files() -> None:
141
184
  """Copy files to the build directory."""
@@ -2,6 +2,7 @@ BOOTLOADER_ADAFRUIT = "adafruit"
2
2
  BOOTLOADER_ADAFRUIT_NRF52_SD132 = "adafruit_nrf52_sd132"
3
3
  BOOTLOADER_ADAFRUIT_NRF52_SD140_V6 = "adafruit_nrf52_sd140_v6"
4
4
  BOOTLOADER_ADAFRUIT_NRF52_SD140_V7 = "adafruit_nrf52_sd140_v7"
5
+
5
6
  EXTRA_ADC = [
6
7
  "VDD",
7
8
  "VDDHDIV5",
@@ -0,0 +1,51 @@
1
+ #include "dfu.h"
2
+
3
+ #ifdef USE_NRF52_DFU
4
+
5
+ #include <zephyr/device.h>
6
+ #include <zephyr/drivers/uart.h>
7
+ #include <zephyr/drivers/uart/cdc_acm.h>
8
+ #include "esphome/core/log.h"
9
+
10
+ namespace esphome {
11
+ namespace nrf52 {
12
+
13
+ static const char *const TAG = "dfu";
14
+
15
+ volatile bool goto_dfu = false; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)
16
+
17
+ static const uint32_t DFU_DBL_RESET_MAGIC = 0x5A1AD5; // SALADS
18
+
19
+ #define DEVICE_AND_COMMA(node_id) DEVICE_DT_GET(node_id),
20
+
21
+ static void cdc_dte_rate_callback(const struct device * /*unused*/, uint32_t rate) {
22
+ if (rate == 1200) {
23
+ goto_dfu = true;
24
+ }
25
+ }
26
+ void DeviceFirmwareUpdate::setup() {
27
+ this->reset_pin_->setup();
28
+ const struct device *cdc_dev[] = {DT_FOREACH_STATUS_OKAY(zephyr_cdc_acm_uart, DEVICE_AND_COMMA)};
29
+ for (auto &idx : cdc_dev) {
30
+ cdc_acm_dte_rate_callback_set(idx, cdc_dte_rate_callback);
31
+ }
32
+ }
33
+
34
+ void DeviceFirmwareUpdate::loop() {
35
+ if (goto_dfu) {
36
+ goto_dfu = false;
37
+ volatile uint32_t *dbl_reset_mem = (volatile uint32_t *) 0x20007F7C;
38
+ (*dbl_reset_mem) = DFU_DBL_RESET_MAGIC;
39
+ this->reset_pin_->digital_write(true);
40
+ }
41
+ }
42
+
43
+ void DeviceFirmwareUpdate::dump_config() {
44
+ ESP_LOGCONFIG(TAG, "DFU:");
45
+ LOG_PIN(" RESET Pin: ", this->reset_pin_);
46
+ }
47
+
48
+ } // namespace nrf52
49
+ } // namespace esphome
50
+
51
+ #endif
@@ -0,0 +1,24 @@
1
+ #pragma once
2
+
3
+ #include "esphome/core/defines.h"
4
+ #ifdef USE_NRF52_DFU
5
+ #include "esphome/core/component.h"
6
+ #include "esphome/core/gpio.h"
7
+
8
+ namespace esphome {
9
+ namespace nrf52 {
10
+ class DeviceFirmwareUpdate : public Component {
11
+ public:
12
+ void setup() override;
13
+ void loop() override;
14
+ void set_reset_pin(GPIOPin *reset) { this->reset_pin_ = reset; }
15
+ void dump_config() override;
16
+
17
+ protected:
18
+ GPIOPin *reset_pin_;
19
+ };
20
+
21
+ } // namespace nrf52
22
+ } // namespace esphome
23
+
24
+ #endif
@@ -11,7 +11,7 @@ void NTC::setup() {
11
11
  if (this->sensor_->has_state())
12
12
  this->process_(this->sensor_->state);
13
13
  }
14
- void NTC::dump_config() { LOG_SENSOR("", "NTC Sensor", this) }
14
+ void NTC::dump_config() { LOG_SENSOR("", "NTC Sensor", this); }
15
15
  float NTC::get_setup_priority() const { return setup_priority::DATA; }
16
16
  void NTC::process_(float value) {
17
17
  if (std::isnan(value)) {
@@ -76,7 +76,7 @@ from esphome.const import (
76
76
  DEVICE_CLASS_WIND_DIRECTION,
77
77
  DEVICE_CLASS_WIND_SPEED,
78
78
  )
79
- from esphome.core import CORE, coroutine_with_priority
79
+ from esphome.core import CORE, CoroPriority, coroutine_with_priority
80
80
  from esphome.core.entity_helpers import entity_duplicate_validator, setup_entity
81
81
  from esphome.cpp_generator import MockObjClass
82
82
 
@@ -321,7 +321,7 @@ async def number_in_range_to_code(config, condition_id, template_arg, args):
321
321
  return var
322
322
 
323
323
 
324
- @coroutine_with_priority(100.0)
324
+ @coroutine_with_priority(CoroPriority.CORE)
325
325
  async def to_code(config):
326
326
  cg.add_global(number_ns.using)
327
327
 
@@ -15,7 +15,7 @@ void ValueRangeTrigger::setup() {
15
15
  float local_min = this->min_.value(0.0);
16
16
  float local_max = this->max_.value(0.0);
17
17
  convert hash = {.from = (local_max - local_min)};
18
- uint32_t myhash = hash.to ^ this->parent_->get_object_id_hash();
18
+ uint32_t myhash = hash.to ^ this->parent_->get_preference_hash();
19
19
  this->rtc_ = global_preferences->make_preference<bool>(myhash);
20
20
  bool initial_state;
21
21
  if (this->rtc_.load(&initial_state)) {
@@ -6,6 +6,27 @@ namespace number {
6
6
 
7
7
  static const char *const TAG = "number";
8
8
 
9
+ // Function implementation of LOG_NUMBER macro to reduce code size
10
+ void log_number(const char *tag, const char *prefix, const char *type, Number *obj) {
11
+ if (obj == nullptr) {
12
+ return;
13
+ }
14
+
15
+ ESP_LOGCONFIG(tag, "%s%s '%s'", prefix, type, obj->get_name().c_str());
16
+
17
+ if (!obj->get_icon_ref().empty()) {
18
+ ESP_LOGCONFIG(tag, "%s Icon: '%s'", prefix, obj->get_icon_ref().c_str());
19
+ }
20
+
21
+ if (!obj->traits.get_unit_of_measurement_ref().empty()) {
22
+ ESP_LOGCONFIG(tag, "%s Unit of Measurement: '%s'", prefix, obj->traits.get_unit_of_measurement_ref().c_str());
23
+ }
24
+
25
+ if (!obj->traits.get_device_class_ref().empty()) {
26
+ ESP_LOGCONFIG(tag, "%s Device Class: '%s'", prefix, obj->traits.get_device_class_ref().c_str());
27
+ }
28
+ }
29
+
9
30
  void Number::publish_state(float state) {
10
31
  this->set_has_state(true);
11
32
  this->state = state;
@@ -9,19 +9,10 @@
9
9
  namespace esphome {
10
10
  namespace number {
11
11
 
12
- #define LOG_NUMBER(prefix, type, obj) \
13
- if ((obj) != nullptr) { \
14
- ESP_LOGCONFIG(TAG, "%s%s '%s'", prefix, LOG_STR_LITERAL(type), (obj)->get_name().c_str()); \
15
- if (!(obj)->get_icon().empty()) { \
16
- ESP_LOGCONFIG(TAG, "%s Icon: '%s'", prefix, (obj)->get_icon().c_str()); \
17
- } \
18
- if (!(obj)->traits.get_unit_of_measurement().empty()) { \
19
- ESP_LOGCONFIG(TAG, "%s Unit of Measurement: '%s'", prefix, (obj)->traits.get_unit_of_measurement().c_str()); \
20
- } \
21
- if (!(obj)->traits.get_device_class().empty()) { \
22
- ESP_LOGCONFIG(TAG, "%s Device Class: '%s'", prefix, (obj)->traits.get_device_class().c_str()); \
23
- } \
24
- }
12
+ class Number;
13
+ void log_number(const char *tag, const char *prefix, const char *type, Number *obj);
14
+
15
+ #define LOG_NUMBER(prefix, type, obj) log_number(TAG, prefix, LOG_STR_LITERAL(type), obj)
25
16
 
26
17
  #define SUB_NUMBER(name) \
27
18
  protected: \