esphome 2025.7.4__py3-none-any.whl → 2025.8.0b1__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.

Potentially problematic release.


This version of esphome might be problematic. Click here for more details.

Files changed (754) hide show
  1. esphome/__main__.py +189 -82
  2. esphome/automation.py +2 -4
  3. esphome/build_gen/__init__.py +0 -0
  4. esphome/build_gen/platformio.py +102 -0
  5. esphome/components/a4988/a4988.cpp +0 -1
  6. esphome/components/absolute_humidity/absolute_humidity.cpp +0 -2
  7. esphome/components/absolute_humidity/sensor.py +2 -2
  8. esphome/components/adc/__init__.py +123 -85
  9. esphome/components/adc/adc_sensor.h +98 -35
  10. esphome/components/adc/adc_sensor_common.cpp +10 -4
  11. esphome/components/adc/adc_sensor_esp32.cpp +291 -123
  12. esphome/components/adc/adc_sensor_esp8266.cpp +1 -4
  13. esphome/components/adc/adc_sensor_libretiny.cpp +1 -2
  14. esphome/components/adc/adc_sensor_rp2040.cpp +1 -2
  15. esphome/components/adc/adc_sensor_zephyr.cpp +207 -0
  16. esphome/components/adc/sensor.py +61 -27
  17. esphome/components/adc128s102/adc128s102.cpp +1 -4
  18. esphome/components/ade7880/sensor.py +75 -49
  19. esphome/components/ads1115/ads1115.cpp +0 -1
  20. esphome/components/ads1118/ads1118.cpp +0 -1
  21. esphome/components/ags10/ags10.cpp +0 -4
  22. esphome/components/aht10/aht10.cpp +0 -4
  23. esphome/components/aic3204/aic3204.cpp +0 -2
  24. esphome/components/airthings_wave_plus/__init__.py +1 -1
  25. esphome/components/airthings_wave_plus/airthings_wave_plus.cpp +22 -4
  26. esphome/components/airthings_wave_plus/airthings_wave_plus.h +10 -1
  27. esphome/components/airthings_wave_plus/sensor.py +55 -28
  28. esphome/components/alarm_control_panel/__init__.py +4 -9
  29. esphome/components/am2315c/am2315c.cpp +0 -2
  30. esphome/components/am2320/am2320.cpp +0 -1
  31. esphome/components/animation/__init__.py +14 -11
  32. esphome/components/apds9306/apds9306.cpp +0 -4
  33. esphome/components/apds9960/apds9960.cpp +0 -1
  34. esphome/components/api/__init__.py +29 -4
  35. esphome/components/api/api_connection.cpp +378 -401
  36. esphome/components/api/api_connection.h +112 -56
  37. esphome/components/api/api_frame_helper.cpp +69 -896
  38. esphome/components/api/api_frame_helper.h +31 -126
  39. esphome/components/api/api_frame_helper_noise.cpp +583 -0
  40. esphome/components/api/api_frame_helper_noise.h +68 -0
  41. esphome/components/api/api_frame_helper_plaintext.cpp +290 -0
  42. esphome/components/api/api_frame_helper_plaintext.h +53 -0
  43. esphome/components/api/api_noise_context.h +2 -4
  44. esphome/components/api/api_pb2.cpp +1601 -1808
  45. esphome/components/api/api_pb2.h +367 -323
  46. esphome/components/api/api_pb2_dump.cpp +1137 -3466
  47. esphome/components/api/api_pb2_includes.h +34 -0
  48. esphome/components/api/api_pb2_service.cpp +94 -105
  49. esphome/components/api/api_pb2_service.h +27 -16
  50. esphome/components/api/api_server.cpp +18 -17
  51. esphome/components/api/api_server.h +8 -5
  52. esphome/components/api/client.py +16 -8
  53. esphome/components/api/custom_api_device.h +68 -14
  54. esphome/components/api/homeassistant_service.h +24 -19
  55. esphome/components/api/list_entities.cpp +3 -5
  56. esphome/components/api/list_entities.h +2 -4
  57. esphome/components/api/proto.cpp +3 -5
  58. esphome/components/api/proto.h +239 -274
  59. esphome/components/api/subscribe_state.cpp +2 -4
  60. esphome/components/api/subscribe_state.h +2 -4
  61. esphome/components/api/user_services.cpp +2 -4
  62. esphome/components/api/user_services.h +8 -8
  63. esphome/components/as3935/as3935.cpp +0 -2
  64. esphome/components/as3935_spi/as3935_spi.cpp +0 -2
  65. esphome/components/as5600/__init__.py +1 -1
  66. esphome/components/as5600/as5600.cpp +0 -2
  67. esphome/components/as5600/sensor/__init__.py +0 -1
  68. esphome/components/as7341/as7341.cpp +0 -1
  69. esphome/components/async_tcp/__init__.py +1 -1
  70. esphome/components/at581x/at581x.cpp +1 -1
  71. esphome/components/atm90e26/atm90e26.cpp +0 -1
  72. esphome/components/atm90e32/atm90e32.cpp +488 -118
  73. esphome/components/atm90e32/atm90e32.h +44 -5
  74. esphome/components/audio/audio.h +2 -2
  75. esphome/components/axs15231/touchscreen/axs15231_touchscreen.cpp +0 -2
  76. esphome/components/beken_spi_led_strip/led_strip.cpp +0 -2
  77. esphome/components/bh1750/bh1750.cpp +0 -1
  78. esphome/components/binary_sensor/__init__.py +14 -12
  79. esphome/components/ble_client/__init__.py +4 -7
  80. esphome/components/bluetooth_proxy/__init__.py +40 -3
  81. esphome/components/bluetooth_proxy/bluetooth_connection.cpp +387 -82
  82. esphome/components/bluetooth_proxy/bluetooth_connection.h +16 -5
  83. esphome/components/bluetooth_proxy/bluetooth_proxy.cpp +102 -311
  84. esphome/components/bluetooth_proxy/bluetooth_proxy.h +30 -14
  85. esphome/components/bme280_base/bme280_base.cpp +15 -16
  86. esphome/components/bme680/bme680.cpp +2 -3
  87. esphome/components/bme680_bsec/bme680_bsec.cpp +0 -2
  88. esphome/components/bme68x_bsec2/bme68x_bsec2.cpp +0 -2
  89. esphome/components/bmi160/bmi160.cpp +0 -1
  90. esphome/components/bmp085/bmp085.cpp +0 -1
  91. esphome/components/bmp280_base/bmp280_base.cpp +13 -14
  92. esphome/components/bmp3xx_base/bmp3xx_base.cpp +0 -1
  93. esphome/components/bmp581/bmp581.cpp +0 -2
  94. esphome/components/bp1658cj/bp1658cj.cpp +0 -1
  95. esphome/components/bp5758d/bp5758d.cpp +0 -1
  96. esphome/components/button/__init__.py +0 -1
  97. esphome/components/canbus/__init__.py +2 -3
  98. esphome/components/canbus/canbus.cpp +0 -1
  99. esphome/components/cap1188/cap1188.cpp +0 -2
  100. esphome/components/captive_portal/__init__.py +1 -1
  101. esphome/components/cd74hc4067/cd74hc4067.cpp +0 -2
  102. esphome/components/ch422g/ch422g.cpp +0 -1
  103. esphome/components/chsc6x/chsc6x_touchscreen.cpp +0 -3
  104. esphome/components/climate/__init__.py +0 -1
  105. esphome/components/climate/climate_traits.h +24 -0
  106. esphome/components/cm1106/cm1106.cpp +0 -1
  107. esphome/components/const/__init__.py +6 -0
  108. esphome/components/cover/__init__.py +0 -1
  109. esphome/components/cover/cover.cpp +9 -13
  110. esphome/components/cs5460a/cs5460a.cpp +0 -2
  111. esphome/components/cse7761/cse7761.cpp +0 -1
  112. esphome/components/cst226/touchscreen/cst226_touchscreen.cpp +0 -2
  113. esphome/components/cst816/touchscreen/cst816_touchscreen.cpp +0 -2
  114. esphome/components/dac7678/dac7678_output.cpp +0 -2
  115. esphome/components/dallas_temp/dallas_temp.cpp +0 -1
  116. esphome/components/datetime/__init__.py +0 -2
  117. esphome/components/debug/__init__.py +15 -1
  118. esphome/components/debug/debug_zephyr.cpp +281 -0
  119. esphome/components/debug/sensor.py +2 -1
  120. esphome/components/deep_sleep/deep_sleep_component.cpp +0 -1
  121. esphome/components/deep_sleep/deep_sleep_esp32.cpp +20 -1
  122. esphome/components/dfrobot_sen0395/__init__.py +1 -2
  123. esphome/components/dht/dht.cpp +0 -1
  124. esphome/components/dht12/dht12.cpp +0 -1
  125. esphome/components/display/__init__.py +16 -3
  126. esphome/components/display_menu_base/__init__.py +1 -1
  127. esphome/components/dps310/dps310.cpp +0 -2
  128. esphome/components/ds1307/ds1307.cpp +0 -1
  129. esphome/components/ds2484/ds2484.cpp +0 -1
  130. esphome/components/duty_cycle/duty_cycle_sensor.cpp +0 -1
  131. esphome/components/ee895/ee895.cpp +0 -1
  132. esphome/components/ektf2232/touchscreen/ektf2232.cpp +0 -1
  133. esphome/components/emc2101/emc2101.cpp +0 -2
  134. esphome/components/ens160_base/ens160_base.cpp +0 -2
  135. esphome/components/ens210/ens210.cpp +0 -1
  136. esphome/components/es7210/es7210.cpp +0 -2
  137. esphome/components/es7243e/es7243e.cpp +0 -2
  138. esphome/components/es8156/es8156.cpp +0 -2
  139. esphome/components/es8311/es8311.cpp +0 -2
  140. esphome/components/es8388/es8388.cpp +0 -2
  141. esphome/components/esp32/__init__.py +199 -58
  142. esphome/components/esp32/boards.py +17 -0
  143. esphome/components/esp32/gpio.cpp +0 -1
  144. esphome/components/esp32/gpio.py +1 -2
  145. esphome/components/esp32/gpio_esp32_h2.py +2 -7
  146. esphome/components/esp32/gpio_esp32_p4.py +2 -7
  147. esphome/components/esp32/post_build.py.script +112 -61
  148. esphome/components/esp32_ble/__init__.py +40 -2
  149. esphome/components/esp32_ble/ble.cpp +12 -8
  150. esphome/components/esp32_ble/ble.h +18 -18
  151. esphome/components/esp32_ble/ble_advertising.cpp +5 -5
  152. esphome/components/esp32_ble/ble_advertising.h +7 -5
  153. esphome/components/esp32_ble/ble_event.h +2 -4
  154. esphome/components/esp32_ble/ble_scan_result.h +2 -4
  155. esphome/components/esp32_ble/ble_uuid.cpp +5 -5
  156. esphome/components/esp32_ble/ble_uuid.h +6 -5
  157. esphome/components/esp32_ble_beacon/__init__.py +4 -0
  158. esphome/components/esp32_ble_client/__init__.py +1 -1
  159. esphome/components/esp32_ble_client/ble_characteristic.cpp +4 -4
  160. esphome/components/esp32_ble_client/ble_characteristic.h +6 -4
  161. esphome/components/esp32_ble_client/ble_client_base.cpp +155 -104
  162. esphome/components/esp32_ble_client/ble_client_base.h +17 -6
  163. esphome/components/esp32_ble_client/ble_descriptor.h +6 -4
  164. esphome/components/esp32_ble_client/ble_service.cpp +4 -4
  165. esphome/components/esp32_ble_client/ble_service.h +6 -4
  166. esphome/components/esp32_ble_server/__init__.py +15 -12
  167. esphome/components/esp32_ble_tracker/__init__.py +79 -11
  168. esphome/components/esp32_ble_tracker/automation.h +4 -4
  169. esphome/components/esp32_ble_tracker/esp32_ble_tracker.cpp +264 -261
  170. esphome/components/esp32_ble_tracker/esp32_ble_tracker.h +103 -37
  171. esphome/components/esp32_camera/__init__.py +13 -1
  172. esphome/components/esp32_camera/esp32_camera.cpp +7 -2
  173. esphome/components/esp32_camera/esp32_camera.h +1 -0
  174. esphome/components/esp32_dac/esp32_dac.cpp +3 -19
  175. esphome/components/esp32_dac/esp32_dac.h +4 -8
  176. esphome/components/esp32_rmt_led_strip/led_strip.cpp +1 -6
  177. esphome/components/esp32_rmt_led_strip/light.py +1 -1
  178. esphome/components/esp32_touch/__init__.py +2 -3
  179. esphome/components/esp32_touch/esp32_touch.h +9 -6
  180. esphome/components/esp32_touch/esp32_touch_common.cpp +2 -0
  181. esphome/components/esp32_touch/esp32_touch_v1.cpp +7 -9
  182. esphome/components/esp32_touch/esp32_touch_v2.cpp +10 -6
  183. esphome/components/esp8266/__init__.py +3 -1
  184. esphome/components/esp8266_pwm/esp8266_pwm.cpp +0 -1
  185. esphome/components/esphome/ota/__init__.py +1 -2
  186. esphome/components/esphome/ota/ota_esphome.cpp +150 -77
  187. esphome/components/esphome/ota/ota_esphome.h +8 -1
  188. esphome/components/espnow/__init__.py +309 -0
  189. esphome/components/espnow/automation.h +175 -0
  190. esphome/components/espnow/espnow_component.cpp +468 -0
  191. esphome/components/espnow/espnow_component.h +183 -0
  192. esphome/components/espnow/espnow_err.h +19 -0
  193. esphome/components/espnow/espnow_packet.h +166 -0
  194. esphome/components/ethernet/__init__.py +7 -1
  195. esphome/components/ethernet/esp_eth_phy_jl1101.c +5 -0
  196. esphome/components/ethernet/ethernet_component.cpp +0 -1
  197. esphome/components/ethernet/ethernet_component.h +4 -0
  198. esphome/components/ethernet_info/ethernet_info_text_sensor.h +0 -3
  199. esphome/components/event/__init__.py +0 -1
  200. esphome/components/factory_reset/__init__.py +92 -0
  201. esphome/components/factory_reset/factory_reset.cpp +76 -0
  202. esphome/components/factory_reset/factory_reset.h +43 -0
  203. esphome/components/fan/__init__.py +0 -1
  204. esphome/components/fan/fan_traits.h +16 -0
  205. esphome/components/fastled_base/fastled_light.cpp +0 -1
  206. esphome/components/fastled_spi/light.py +1 -3
  207. esphome/components/fingerprint_grow/fingerprint_grow.cpp +0 -2
  208. esphome/components/font/__init__.py +9 -1
  209. esphome/components/fs3000/fs3000.cpp +0 -2
  210. esphome/components/ft5x06/touchscreen/ft5x06_touchscreen.cpp +0 -2
  211. esphome/components/ft63x6/ft63x6.cpp +0 -1
  212. esphome/components/gdk101/gdk101.cpp +0 -1
  213. esphome/components/gl_r01_i2c/gl_r01_i2c.cpp +0 -1
  214. esphome/components/gl_r01_i2c/sensor.py +1 -1
  215. esphome/components/gpio/one_wire/gpio_one_wire.cpp +0 -1
  216. esphome/components/gpio/switch/gpio_switch.cpp +0 -2
  217. esphome/components/gpio_expander/cached_gpio.h +24 -15
  218. esphome/components/gps/__init__.py +6 -2
  219. esphome/components/gps/gps.cpp +50 -49
  220. esphome/components/gps/gps.h +4 -8
  221. esphome/components/gps/time/gps_time.cpp +3 -9
  222. esphome/components/gps/time/gps_time.h +4 -7
  223. esphome/components/graph/__init__.py +1 -1
  224. esphome/components/grove_gas_mc_v2/grove_gas_mc_v2.cpp +0 -1
  225. esphome/components/grove_tb6612fng/grove_tb6612fng.cpp +0 -1
  226. esphome/components/gt911/touchscreen/gt911_touchscreen.cpp +21 -12
  227. esphome/components/gt911/touchscreen/gt911_touchscreen.h +26 -2
  228. esphome/components/haier/climate.py +5 -10
  229. esphome/components/haier/haier_base.cpp +0 -1
  230. esphome/components/hbridge/switch/hbridge_switch.cpp +0 -2
  231. esphome/components/hdc1080/hdc1080.cpp +0 -2
  232. esphome/components/heatpumpir/climate.py +2 -2
  233. esphome/components/hlw8012/hlw8012.cpp +0 -1
  234. esphome/components/hm3301/hm3301.cpp +0 -1
  235. esphome/components/hmc5883l/hmc5883l.cpp +0 -1
  236. esphome/components/homeassistant/__init__.py +1 -0
  237. esphome/components/homeassistant/number/__init__.py +1 -0
  238. esphome/components/homeassistant/number/homeassistant_number.cpp +11 -7
  239. esphome/components/homeassistant/switch/__init__.py +1 -0
  240. esphome/components/homeassistant/switch/homeassistant_switch.cpp +9 -5
  241. esphome/components/honeywellabp/honeywellabp.cpp +1 -4
  242. esphome/components/host/__init__.py +2 -0
  243. esphome/components/hte501/hte501.cpp +0 -1
  244. esphome/components/http_request/__init__.py +2 -3
  245. esphome/components/http_request/http_request_idf.cpp +2 -2
  246. esphome/components/htu21d/htu21d.cpp +0 -2
  247. esphome/components/htu31d/htu31d.cpp +0 -2
  248. esphome/components/hx711/hx711.cpp +0 -1
  249. esphome/components/hydreon_rgxx/hydreon_rgxx.cpp +0 -1
  250. esphome/components/hydreon_rgxx/sensor.py +4 -5
  251. esphome/components/i2c/i2c_bus.h +1 -1
  252. esphome/components/i2c/i2c_bus_arduino.cpp +1 -2
  253. esphome/components/i2c/i2c_bus_esp_idf.cpp +192 -17
  254. esphome/components/i2c/i2c_bus_esp_idf.h +11 -1
  255. esphome/components/i2s_audio/__init__.py +6 -5
  256. esphome/components/i2s_audio/i2s_audio.cpp +0 -2
  257. esphome/components/i2s_audio/media_player/i2s_audio_media_player.cpp +1 -4
  258. esphome/components/i2s_audio/microphone/__init__.py +4 -6
  259. esphome/components/i2s_audio/microphone/i2s_audio_microphone.cpp +46 -19
  260. esphome/components/i2s_audio/microphone/i2s_audio_microphone.h +4 -3
  261. esphome/components/i2s_audio/speaker/i2s_audio_speaker.cpp +273 -269
  262. esphome/components/i2s_audio/speaker/i2s_audio_speaker.h +19 -34
  263. esphome/components/ili9xxx/display.py +4 -3
  264. esphome/components/ili9xxx/ili9xxx_display.cpp +0 -2
  265. esphome/components/image/__init__.py +123 -92
  266. esphome/components/improv_serial/__init__.py +7 -8
  267. esphome/components/ina219/ina219.cpp +0 -1
  268. esphome/components/ina226/ina226.cpp +0 -2
  269. esphome/components/ina260/ina260.cpp +0 -2
  270. esphome/components/ina2xx_base/__init__.py +2 -5
  271. esphome/components/ina2xx_base/ina2xx_base.cpp +0 -2
  272. esphome/components/ina3221/ina3221.cpp +0 -1
  273. esphome/components/internal_temperature/internal_temperature.cpp +0 -2
  274. esphome/components/interval/interval.h +5 -9
  275. esphome/components/json/__init__.py +1 -1
  276. esphome/components/kmeteriso/kmeteriso.cpp +0 -2
  277. esphome/components/lc709203f/lc709203f.cpp +0 -2
  278. esphome/components/lcd_gpio/display.py +1 -3
  279. esphome/components/lcd_gpio/gpio_lcd_display.cpp +0 -1
  280. esphome/components/lcd_pcf8574/pcf8574_display.cpp +0 -1
  281. esphome/components/ld2410/__init__.py +4 -6
  282. esphome/components/ld2410/binary_sensor.py +4 -0
  283. esphome/components/ld2410/ld2410.cpp +56 -100
  284. esphome/components/ld2410/ld2410.h +17 -15
  285. esphome/components/ld2410/sensor.py +24 -10
  286. esphome/components/ld2412/__init__.py +46 -0
  287. esphome/components/ld2412/binary_sensor.py +70 -0
  288. esphome/components/ld2412/button/__init__.py +74 -0
  289. esphome/components/ld2412/button/factory_reset_button.cpp +9 -0
  290. esphome/components/ld2412/button/factory_reset_button.h +18 -0
  291. esphome/components/ld2412/button/query_button.cpp +9 -0
  292. esphome/components/ld2412/button/query_button.h +18 -0
  293. esphome/components/ld2412/button/restart_button.cpp +9 -0
  294. esphome/components/ld2412/button/restart_button.h +18 -0
  295. esphome/components/ld2412/button/start_dynamic_background_correction_button.cpp +11 -0
  296. esphome/components/ld2412/button/start_dynamic_background_correction_button.h +18 -0
  297. esphome/components/ld2412/ld2412.cpp +861 -0
  298. esphome/components/ld2412/ld2412.h +141 -0
  299. esphome/components/ld2412/number/__init__.py +126 -0
  300. esphome/components/ld2412/number/gate_threshold_number.cpp +14 -0
  301. esphome/components/ld2412/number/gate_threshold_number.h +19 -0
  302. esphome/components/ld2412/number/light_threshold_number.cpp +12 -0
  303. esphome/components/ld2412/number/light_threshold_number.h +18 -0
  304. esphome/components/ld2412/number/max_distance_timeout_number.cpp +12 -0
  305. esphome/components/ld2412/number/max_distance_timeout_number.h +18 -0
  306. esphome/components/ld2412/select/__init__.py +82 -0
  307. esphome/components/ld2412/select/baud_rate_select.cpp +12 -0
  308. esphome/components/ld2412/select/baud_rate_select.h +18 -0
  309. esphome/components/ld2412/select/distance_resolution_select.cpp +12 -0
  310. esphome/components/ld2412/select/distance_resolution_select.h +18 -0
  311. esphome/components/ld2412/select/light_out_control_select.cpp +12 -0
  312. esphome/components/ld2412/select/light_out_control_select.h +18 -0
  313. esphome/components/ld2412/sensor.py +124 -0
  314. esphome/components/ld2412/switch/__init__.py +45 -0
  315. esphome/components/ld2412/switch/bluetooth_switch.cpp +12 -0
  316. esphome/components/ld2412/switch/bluetooth_switch.h +18 -0
  317. esphome/components/ld2412/switch/engineering_mode_switch.cpp +12 -0
  318. esphome/components/ld2412/switch/engineering_mode_switch.h +18 -0
  319. esphome/components/ld2412/text_sensor.py +34 -0
  320. esphome/components/ld2420/ld2420.cpp +0 -1
  321. esphome/components/ld2450/__init__.py +3 -4
  322. esphome/components/ld2450/binary_sensor.py +3 -0
  323. esphome/components/ld2450/ld2450.cpp +77 -165
  324. esphome/components/ld2450/ld2450.h +26 -54
  325. esphome/components/ld2450/sensor.py +120 -6
  326. esphome/components/ld2450/text_sensor.py +5 -4
  327. esphome/components/ld24xx/__init__.py +1 -0
  328. esphome/components/ld24xx/ld24xx.h +65 -0
  329. esphome/components/ledc/ledc_output.cpp +0 -1
  330. esphome/components/libretiny/__init__.py +2 -0
  331. esphome/components/light/__init__.py +0 -1
  332. esphome/components/light/effects.py +70 -45
  333. esphome/components/light/light_call.cpp +101 -66
  334. esphome/components/light/light_color_values.h +16 -11
  335. esphome/components/light/light_json_schema.cpp +46 -44
  336. esphome/components/light/light_state.cpp +8 -11
  337. esphome/components/light/light_traits.h +17 -0
  338. esphome/components/lightwaverf/lightwaverf.cpp +0 -2
  339. esphome/components/lilygo_t5_47/touchscreen/lilygo_t5_47_touchscreen.cpp +0 -1
  340. esphome/components/lock/__init__.py +0 -1
  341. esphome/components/logger/__init__.py +31 -9
  342. esphome/components/logger/logger.cpp +12 -7
  343. esphome/components/logger/logger.h +25 -14
  344. esphome/components/logger/logger_esp32.cpp +2 -7
  345. esphome/components/logger/logger_esp8266.cpp +2 -4
  346. esphome/components/logger/logger_host.cpp +2 -4
  347. esphome/components/logger/logger_libretiny.cpp +2 -4
  348. esphome/components/logger/logger_rp2040.cpp +2 -4
  349. esphome/components/logger/logger_zephyr.cpp +86 -0
  350. esphome/components/logger/select/logger_level_select.cpp +2 -4
  351. esphome/components/logger/select/logger_level_select.h +2 -4
  352. esphome/components/logger/task_log_buffer.cpp +2 -4
  353. esphome/components/logger/task_log_buffer.h +2 -4
  354. esphome/components/lps22/sensor.py +5 -5
  355. esphome/components/ltr390/ltr390.cpp +0 -2
  356. esphome/components/ltr501/ltr501.cpp +0 -1
  357. esphome/components/ltr_als_ps/ltr_als_ps.cpp +0 -1
  358. esphome/components/lvgl/__init__.py +14 -13
  359. esphome/components/lvgl/automation.py +2 -4
  360. esphome/components/lvgl/defines.py +0 -2
  361. esphome/components/lvgl/helpers.py +1 -1
  362. esphome/components/lvgl/lv_validation.py +7 -4
  363. esphome/components/lvgl/lvgl_esphome.cpp +2 -3
  364. esphome/components/lvgl/styles.py +2 -2
  365. esphome/components/lvgl/types.py +1 -1
  366. esphome/components/lvgl/widgets/__init__.py +2 -2
  367. esphome/components/lvgl/widgets/arc.py +14 -11
  368. esphome/components/lvgl/widgets/buttonmatrix.py +1 -1
  369. esphome/components/lvgl/widgets/qrcode.py +7 -7
  370. esphome/components/lvgl/widgets/spinner.py +6 -6
  371. esphome/components/lvgl/widgets/switch.py +2 -2
  372. esphome/components/lvgl/widgets/tabview.py +3 -3
  373. esphome/components/lvgl/widgets/tileview.py +15 -7
  374. esphome/components/m5stack_8angle/m5stack_8angle.cpp +0 -1
  375. esphome/components/matrix_keypad/__init__.py +4 -3
  376. esphome/components/max17043/max17043.cpp +0 -2
  377. esphome/components/max31855/max31855.cpp +1 -4
  378. esphome/components/max31856/max31856.cpp +0 -4
  379. esphome/components/max31865/max31865.cpp +0 -1
  380. esphome/components/max44009/max44009.cpp +0 -1
  381. esphome/components/max6675/max6675.cpp +1 -4
  382. esphome/components/max6956/max6956.cpp +0 -1
  383. esphome/components/max7219/max7219.cpp +0 -1
  384. esphome/components/max7219digit/display.py +1 -1
  385. esphome/components/max7219digit/max7219digit.cpp +0 -1
  386. esphome/components/max9611/max9611.cpp +0 -1
  387. esphome/components/mcp23008/__init__.py +1 -1
  388. esphome/components/mcp23008/mcp23008.cpp +0 -1
  389. esphome/components/mcp23016/mcp23016.cpp +0 -1
  390. esphome/components/mcp23017/__init__.py +1 -1
  391. esphome/components/mcp23017/mcp23017.cpp +0 -1
  392. esphome/components/mcp23s08/__init__.py +1 -1
  393. esphome/components/mcp23s08/mcp23s08.cpp +0 -1
  394. esphome/components/mcp23s17/__init__.py +1 -1
  395. esphome/components/mcp23s17/mcp23s17.cpp +0 -1
  396. esphome/components/mcp23x08_base/__init__.py +2 -0
  397. esphome/components/mcp23x08_base/mcp23x08_base.cpp +9 -7
  398. esphome/components/mcp23x08_base/mcp23x08_base.h +9 -4
  399. esphome/components/mcp23x17_base/__init__.py +2 -0
  400. esphome/components/mcp23x17_base/mcp23x17_base.cpp +20 -7
  401. esphome/components/mcp23x17_base/mcp23x17_base.h +9 -4
  402. esphome/components/mcp23xxx_base/__init__.py +11 -5
  403. esphome/components/mcp23xxx_base/mcp23xxx_base.cpp +15 -12
  404. esphome/components/mcp23xxx_base/mcp23xxx_base.h +8 -7
  405. esphome/components/mcp3008/mcp3008.cpp +1 -4
  406. esphome/components/mcp3204/mcp3204.cpp +1 -4
  407. esphome/components/mcp4461/mcp4461.cpp +0 -1
  408. esphome/components/mcp4725/mcp4725.cpp +0 -1
  409. esphome/components/mcp4728/mcp4728.cpp +0 -1
  410. esphome/components/mcp9600/mcp9600.cpp +0 -2
  411. esphome/components/mcp9808/mcp9808.cpp +0 -2
  412. esphome/components/mdns/__init__.py +3 -0
  413. esphome/components/mdns/mdns_component.cpp +2 -0
  414. esphome/components/mdns/mdns_component.h +4 -0
  415. esphome/components/media_player/__init__.py +40 -0
  416. esphome/components/media_player/automation.h +16 -0
  417. esphome/components/media_player/media_player.cpp +13 -0
  418. esphome/components/media_player/media_player.h +50 -3
  419. esphome/components/micro_wake_word/micro_wake_word.cpp +0 -3
  420. esphome/components/mics_4514/mics_4514.cpp +1 -6
  421. esphome/components/midea/ir_transmitter.h +4 -4
  422. esphome/components/mipi/__init__.py +416 -0
  423. esphome/components/mipi_dsi/__init__.py +5 -0
  424. esphome/components/mipi_dsi/display.py +233 -0
  425. esphome/components/mipi_dsi/mipi_dsi.cpp +379 -0
  426. esphome/components/mipi_dsi/mipi_dsi.h +123 -0
  427. esphome/components/mipi_dsi/models/__init__.py +0 -0
  428. esphome/components/mipi_dsi/models/guition.py +38 -0
  429. esphome/components/mipi_dsi/models/m5stack.py +57 -0
  430. esphome/components/mipi_dsi/models/waveshare.py +105 -0
  431. esphome/components/mipi_rgb/models/lilygo.py +0 -0
  432. esphome/components/mipi_spi/__init__.py +0 -9
  433. esphome/components/mipi_spi/display.py +220 -256
  434. esphome/components/mipi_spi/mipi_spi.cpp +1 -485
  435. esphome/components/mipi_spi/mipi_spi.h +556 -108
  436. esphome/components/mipi_spi/models/__init__.py +0 -65
  437. esphome/components/mipi_spi/models/adafruit.py +30 -0
  438. esphome/components/mipi_spi/models/amoled.py +41 -5
  439. esphome/components/mipi_spi/models/ili.py +5 -5
  440. esphome/components/mipi_spi/models/jc.py +1 -3
  441. esphome/components/mipi_spi/models/lilygo.py +1 -1
  442. esphome/components/mipi_spi/models/waveshare.py +16 -1
  443. esphome/components/mixer/speaker/__init__.py +4 -5
  444. esphome/components/mlx90393/sensor.py +7 -5
  445. esphome/components/mlx90393/sensor_mlx90393.cpp +0 -1
  446. esphome/components/mlx90614/mlx90614.cpp +0 -1
  447. esphome/components/mmc5603/mmc5603.cpp +0 -1
  448. esphome/components/mmc5983/mmc5983.cpp +0 -2
  449. esphome/components/mpl3115a2/mpl3115a2.cpp +0 -2
  450. esphome/components/mpr121/__init__.py +7 -6
  451. esphome/components/mpr121/mpr121.cpp +0 -1
  452. esphome/components/mpu6050/mpu6050.cpp +0 -1
  453. esphome/components/mpu6886/mpu6886.cpp +0 -1
  454. esphome/components/mqtt/__init__.py +1 -2
  455. esphome/components/mqtt/mqtt_button.cpp +1 -1
  456. esphome/components/mqtt/mqtt_client.cpp +0 -1
  457. esphome/components/mqtt/mqtt_component.cpp +8 -14
  458. esphome/components/mqtt/mqtt_component.h +0 -7
  459. esphome/components/mqtt/mqtt_sensor.cpp +0 -1
  460. esphome/components/mqtt/mqtt_sensor.h +0 -1
  461. esphome/components/mqtt/mqtt_text_sensor.cpp +0 -1
  462. esphome/components/mqtt/mqtt_text_sensor.h +0 -1
  463. esphome/components/ms5611/ms5611.cpp +0 -1
  464. esphome/components/ms8607/ms8607.cpp +0 -1
  465. esphome/components/msa3xx/msa3xx.cpp +0 -2
  466. esphome/components/my9231/my9231.cpp +0 -2
  467. esphome/components/nau7802/nau7802.cpp +0 -1
  468. esphome/components/neopixelbus/light.py +3 -0
  469. esphome/components/network/util.cpp +29 -0
  470. esphome/components/nextion/nextion.cpp +0 -1
  471. esphome/components/nfc/binary_sensor/{binary_sensor.cpp → nfc_binary_sensor.cpp} +1 -1
  472. esphome/components/npi19/npi19.cpp +0 -2
  473. esphome/components/nrf52/__init__.py +223 -0
  474. esphome/components/nrf52/boards.py +34 -0
  475. esphome/components/nrf52/const.py +18 -0
  476. esphome/components/nrf52/gpio.py +79 -0
  477. esphome/components/number/__init__.py +2 -1
  478. esphome/components/one_wire/__init__.py +1 -2
  479. esphome/components/one_wire/one_wire.cpp +0 -2
  480. esphome/components/one_wire/one_wire.h +0 -2
  481. esphome/components/opentherm/hub.cpp +0 -1
  482. esphome/components/opentherm/number/__init__.py +2 -2
  483. esphome/components/openthread/__init__.py +2 -3
  484. esphome/components/openthread/openthread.cpp +30 -13
  485. esphome/components/openthread/openthread.h +3 -0
  486. esphome/components/openthread/openthread_esp.cpp +3 -1
  487. esphome/components/opt3001/sensor.py +2 -6
  488. esphome/components/output/__init__.py +38 -0
  489. esphome/components/output/automation.h +24 -0
  490. esphome/components/output/switch/output_switch.cpp +0 -2
  491. esphome/components/packages/__init__.py +1 -2
  492. esphome/components/packet_transport/__init__.py +4 -3
  493. esphome/components/pca6416a/pca6416a.cpp +0 -1
  494. esphome/components/pca9554/pca9554.cpp +0 -1
  495. esphome/components/pca9685/pca9685_output.cpp +0 -2
  496. esphome/components/pcf85063/pcf85063.cpp +0 -1
  497. esphome/components/pcf8563/pcf8563.cpp +0 -1
  498. esphome/components/pcf8574/pcf8574.cpp +0 -1
  499. esphome/components/pi4ioe5v6408/pi4ioe5v6408.cpp +0 -1
  500. esphome/components/pipsolar/sensor/__init__.py +1 -1
  501. esphome/components/pm2005/pm2005.cpp +0 -1
  502. esphome/components/pmsa003i/pmsa003i.cpp +0 -2
  503. esphome/components/pmwcs3/sensor.py +1 -2
  504. esphome/components/pn532/pn532.cpp +0 -2
  505. esphome/components/pn532_spi/pn532_spi.cpp +0 -2
  506. esphome/components/power_supply/power_supply.cpp +7 -10
  507. esphome/components/power_supply/power_supply.h +1 -1
  508. esphome/components/psram/__init__.py +2 -1
  509. esphome/components/pulse_counter/pulse_counter_sensor.cpp +0 -1
  510. esphome/components/pulse_counter/sensor.py +9 -6
  511. esphome/components/pylontech/pylontech.cpp +0 -1
  512. esphome/components/qmc5883l/qmc5883l.cpp +0 -1
  513. esphome/components/qmp6988/qmp6988.cpp +0 -2
  514. esphome/components/qspi_dbi/display.py +2 -3
  515. esphome/components/qspi_dbi/qspi_dbi.cpp +0 -2
  516. esphome/components/qwiic_pir/binary_sensor.py +2 -3
  517. esphome/components/qwiic_pir/qwiic_pir.cpp +0 -2
  518. esphome/components/rc522/rc522.cpp +9 -31
  519. esphome/components/rc522_spi/rc522_spi.cpp +0 -1
  520. esphome/components/remote_base/__init__.py +5 -6
  521. esphome/components/remote_receiver/remote_receiver_esp32.cpp +0 -1
  522. esphome/components/remote_receiver/remote_receiver_esp8266.cpp +0 -1
  523. esphome/components/remote_receiver/remote_receiver_libretiny.cpp +0 -1
  524. esphome/components/remote_transmitter/__init__.py +26 -0
  525. esphome/components/remote_transmitter/automation.h +18 -0
  526. esphome/components/remote_transmitter/remote_transmitter.h +2 -1
  527. esphome/components/remote_transmitter/remote_transmitter_esp32.cpp +0 -1
  528. esphome/components/remote_transmitter/remote_transmitter_esp8266.cpp +2 -0
  529. esphome/components/remote_transmitter/remote_transmitter_libretiny.cpp +2 -0
  530. esphome/components/resampler/speaker/__init__.py +4 -5
  531. esphome/components/rf_bridge/__init__.py +4 -8
  532. esphome/components/rotary_encoder/rotary_encoder.cpp +0 -2
  533. esphome/components/rp2040/__init__.py +3 -1
  534. esphome/components/rp2040_pio_led_strip/led_strip.cpp +0 -2
  535. esphome/components/rp2040_pio_led_strip/light.py +1 -2
  536. esphome/components/rp2040_pwm/rp2040_pwm.cpp +1 -5
  537. esphome/components/rpi_dpi_rgb/display.py +13 -15
  538. esphome/components/rpi_dpi_rgb/rpi_dpi_rgb.cpp +0 -3
  539. esphome/components/runtime_stats/__init__.py +34 -0
  540. esphome/components/runtime_stats/runtime_stats.cpp +102 -0
  541. esphome/components/runtime_stats/runtime_stats.h +132 -0
  542. esphome/components/scd30/scd30.cpp +0 -2
  543. esphome/components/scd30/sensor.py +1 -2
  544. esphome/components/scd4x/scd4x.cpp +0 -1
  545. esphome/components/scd4x/sensor.py +1 -3
  546. esphome/components/sdl/display.py +3 -1
  547. esphome/components/sdl/sdl_esphome.cpp +0 -2
  548. esphome/components/sdp3x/sdp3x.cpp +0 -2
  549. esphome/components/seeed_mr24hpc1/seeed_mr24hpc1.cpp +0 -2
  550. esphome/components/seeed_mr60fda2/seeed_mr60fda2.cpp +0 -3
  551. esphome/components/select/__init__.py +2 -3
  552. esphome/components/select/select_traits.cpp +1 -1
  553. esphome/components/select/select_traits.h +1 -1
  554. esphome/components/sen0321/sen0321.cpp +0 -1
  555. esphome/components/sen5x/sen5x.cpp +0 -2
  556. esphome/components/sensor/__init__.py +36 -4
  557. esphome/components/sensor/filter.cpp +49 -10
  558. esphome/components/sensor/filter.h +22 -7
  559. esphome/components/sensor/sensor.cpp +0 -1
  560. esphome/components/sensor/sensor.h +0 -9
  561. esphome/components/sfa30/sfa30.cpp +0 -4
  562. esphome/components/sgp30/sgp30.cpp +0 -2
  563. esphome/components/sgp4x/sensor.py +1 -1
  564. esphome/components/sgp4x/sgp4x.cpp +0 -2
  565. esphome/components/shelly_dimmer/shelly_dimmer.cpp +0 -2
  566. esphome/components/sht3xd/sht3xd.cpp +0 -2
  567. esphome/components/sht4x/sht4x.cpp +0 -2
  568. esphome/components/shtcx/shtcx.cpp +0 -1
  569. esphome/components/sim800l/__init__.py +2 -4
  570. esphome/components/sm16716/sm16716.cpp +0 -1
  571. esphome/components/sm2135/sm2135.cpp +0 -1
  572. esphome/components/sm2235/sm2235.cpp +0 -1
  573. esphome/components/sm2335/sm2335.cpp +0 -1
  574. esphome/components/sn74hc165/sn74hc165.cpp +0 -1
  575. esphome/components/sn74hc595/sn74hc595.cpp +0 -1
  576. esphome/components/sntp/sntp_component.cpp +0 -1
  577. esphome/components/sound_level/sensor.py +1 -1
  578. esphome/components/speaker/media_player/__init__.py +21 -33
  579. esphome/components/speaker/media_player/audio_pipeline.cpp +4 -7
  580. esphome/components/spi/__init__.py +29 -13
  581. esphome/components/spi/spi.cpp +0 -2
  582. esphome/components/spi_device/spi_device.cpp +1 -4
  583. esphome/components/sprinkler/__init__.py +4 -4
  584. esphome/components/sps30/sps30.cpp +0 -1
  585. esphome/components/ssd1306_base/__init__.py +11 -11
  586. esphome/components/ssd1306_base/ssd1306_base.cpp +1 -1
  587. esphome/components/ssd1306_i2c/ssd1306_i2c.cpp +0 -1
  588. esphome/components/ssd1306_spi/ssd1306_spi.cpp +0 -1
  589. esphome/components/ssd1322_spi/ssd1322_spi.cpp +0 -1
  590. esphome/components/ssd1325_spi/ssd1325_spi.cpp +0 -1
  591. esphome/components/ssd1327_i2c/ssd1327_i2c.cpp +0 -1
  592. esphome/components/ssd1327_spi/ssd1327_spi.cpp +0 -1
  593. esphome/components/ssd1331_spi/ssd1331_spi.cpp +0 -1
  594. esphome/components/ssd1351_spi/ssd1351_spi.cpp +0 -1
  595. esphome/components/st7567_i2c/st7567_i2c.cpp +0 -1
  596. esphome/components/st7567_spi/st7567_spi.cpp +0 -1
  597. esphome/components/st7701s/display.py +10 -14
  598. esphome/components/st7701s/st7701s.cpp +0 -3
  599. esphome/components/st7735/st7735.cpp +0 -1
  600. esphome/components/st7789v/st7789v.cpp +0 -1
  601. esphome/components/st7920/st7920.cpp +0 -1
  602. esphome/components/status_led/light/status_led_light.cpp +0 -2
  603. esphome/components/status_led/status_led.cpp +0 -1
  604. esphome/components/stepper/__init__.py +2 -4
  605. esphome/components/sts3x/sts3x.cpp +0 -1
  606. esphome/components/substitutions/__init__.py +10 -16
  607. esphome/components/substitutions/jinja.py +24 -1
  608. esphome/components/sun/__init__.py +2 -3
  609. esphome/components/switch/__init__.py +31 -1
  610. esphome/components/switch/automation.h +24 -0
  611. esphome/components/switch/switch.cpp +8 -0
  612. esphome/components/switch/switch.h +8 -0
  613. esphome/components/sx126x/sx126x.cpp +0 -2
  614. esphome/components/sx127x/sx127x.cpp +0 -2
  615. esphome/components/sx1509/__init__.py +7 -5
  616. esphome/components/sx1509/output/sx1509_float_output.cpp +1 -1
  617. esphome/components/sx1509/sx1509.cpp +0 -2
  618. esphome/components/syslog/esphome_syslog.cpp +1 -1
  619. esphome/components/tc74/tc74.cpp +0 -1
  620. esphome/components/tca9548a/tca9548a.cpp +0 -1
  621. esphome/components/tca9555/tca9555.cpp +0 -1
  622. esphome/components/tcs34725/tcs34725.cpp +0 -1
  623. esphome/components/tee501/tee501.cpp +0 -1
  624. esphome/components/tem3200/tem3200.cpp +0 -2
  625. esphome/components/template/alarm_control_panel/template_alarm_control_panel.cpp +0 -1
  626. esphome/components/template/cover/template_cover.cpp +0 -1
  627. esphome/components/template/select/template_select.cpp +0 -1
  628. esphome/components/template/text/template_text.cpp +0 -2
  629. esphome/components/template/valve/template_valve.cpp +0 -1
  630. esphome/components/text/__init__.py +0 -1
  631. esphome/components/text/text_traits.h +2 -0
  632. esphome/components/text_sensor/__init__.py +2 -1
  633. esphome/components/text_sensor/text_sensor.cpp +0 -2
  634. esphome/components/text_sensor/text_sensor.h +0 -8
  635. esphome/components/thermostat/climate.py +4 -4
  636. esphome/components/time/__init__.py +7 -4
  637. esphome/components/time/real_time_clock.cpp +16 -3
  638. esphome/components/tlc59208f/tlc59208f_output.cpp +0 -2
  639. esphome/components/tlc5947/tlc5947.cpp +0 -2
  640. esphome/components/tlc5971/tlc5971.cpp +0 -2
  641. esphome/components/tm1621/tm1621.cpp +0 -2
  642. esphome/components/tm1637/tm1637.cpp +0 -2
  643. esphome/components/tm1638/tm1638.cpp +0 -2
  644. esphome/components/tm1651/__init__.py +45 -48
  645. esphome/components/tm1651/tm1651.cpp +213 -47
  646. esphome/components/tm1651/tm1651.h +37 -32
  647. esphome/components/tmp117/tmp117.cpp +0 -2
  648. esphome/components/tsl2561/tsl2561.cpp +0 -1
  649. esphome/components/tsl2591/tsl2591.cpp +0 -1
  650. esphome/components/tt21100/touchscreen/tt21100.cpp +0 -2
  651. esphome/components/ttp229_bsf/ttp229_bsf.cpp +0 -1
  652. esphome/components/ttp229_lsf/ttp229_lsf.cpp +0 -1
  653. esphome/components/tuya/climate/__init__.py +9 -10
  654. esphome/components/tuya/number/__init__.py +8 -6
  655. esphome/components/tx20/tx20.cpp +0 -1
  656. esphome/components/uart/uart_component_esp32_arduino.cpp +0 -1
  657. esphome/components/uart/uart_component_esp8266.cpp +0 -1
  658. esphome/components/uart/uart_component_esp_idf.cpp +0 -2
  659. esphome/components/uart/uart_component_libretiny.cpp +0 -2
  660. esphome/components/uart/uart_component_rp2040.cpp +0 -2
  661. esphome/components/udp/__init__.py +1 -1
  662. esphome/components/ufire_ec/sensor.py +1 -2
  663. esphome/components/ufire_ec/ufire_ec.cpp +0 -2
  664. esphome/components/ufire_ise/sensor.py +1 -2
  665. esphome/components/ufire_ise/ufire_ise.cpp +0 -2
  666. esphome/components/ultrasonic/ultrasonic_sensor.cpp +0 -1
  667. esphome/components/update/__init__.py +0 -1
  668. esphome/components/uptime/sensor/uptime_seconds_sensor.cpp +0 -1
  669. esphome/components/uptime/sensor/uptime_seconds_sensor.h +0 -2
  670. esphome/components/usb_host/usb_host_client.cpp +0 -1
  671. esphome/components/usb_host/usb_host_component.cpp +0 -1
  672. esphome/components/valve/__init__.py +0 -1
  673. esphome/components/veml3235/veml3235.cpp +0 -3
  674. esphome/components/veml7700/veml7700.cpp +0 -2
  675. esphome/components/version/version_text_sensor.cpp +0 -1
  676. esphome/components/version/version_text_sensor.h +0 -1
  677. esphome/components/vl53l0x/vl53l0x_sensor.cpp +0 -4
  678. esphome/components/voice_assistant/voice_assistant.cpp +9 -8
  679. esphome/components/web_server/__init__.py +13 -0
  680. esphome/components/web_server/web_server.cpp +187 -352
  681. esphome/components/web_server/web_server.h +61 -1
  682. esphome/components/web_server_base/__init__.py +1 -1
  683. esphome/components/web_server_base/web_server_base.cpp +2 -0
  684. esphome/components/web_server_base/web_server_base.h +6 -0
  685. esphome/components/web_server_idf/web_server_idf.cpp +10 -8
  686. esphome/components/web_server_idf/web_server_idf.h +2 -0
  687. esphome/components/weikai_i2c/weikai_i2c.cpp +1 -2
  688. esphome/components/weikai_spi/weikai_spi.cpp +1 -1
  689. esphome/components/wifi/__init__.py +8 -43
  690. esphome/components/wifi/wifi_component.cpp +100 -36
  691. esphome/components/wifi/wifi_component.h +5 -1
  692. esphome/components/wifi/wifi_component_esp32_arduino.cpp +30 -0
  693. esphome/components/wifi/wifi_component_esp_idf.cpp +30 -0
  694. esphome/components/wifi_info/wifi_info_text_sensor.h +0 -6
  695. esphome/components/wifi_signal/wifi_signal_sensor.h +0 -1
  696. esphome/components/wireguard/wireguard.cpp +0 -2
  697. esphome/components/x9c/x9c.cpp +0 -2
  698. esphome/components/xgzp68xx/xgzp68xx.cpp +0 -1
  699. esphome/components/xl9535/xl9535.cpp +0 -2
  700. esphome/components/zephyr/__init__.py +252 -0
  701. esphome/components/zephyr/const.py +16 -0
  702. esphome/components/zephyr/core.cpp +90 -0
  703. esphome/components/zephyr/gpio.cpp +120 -0
  704. esphome/components/zephyr/gpio.h +38 -0
  705. esphome/components/zephyr/pre_build.py.script +4 -0
  706. esphome/components/zephyr/preferences.cpp +156 -0
  707. esphome/components/zephyr/preferences.h +13 -0
  708. esphome/config.py +38 -16
  709. esphome/config_helpers.py +1 -2
  710. esphome/config_validation.py +8 -15
  711. esphome/const.py +26 -1
  712. esphome/core/__init__.py +88 -51
  713. esphome/core/application.cpp +75 -21
  714. esphome/core/application.h +106 -171
  715. esphome/core/color.h +10 -0
  716. esphome/core/component.cpp +41 -25
  717. esphome/core/component.h +9 -6
  718. esphome/core/component_iterator.cpp +61 -261
  719. esphome/core/component_iterator.h +15 -0
  720. esphome/core/config.py +26 -11
  721. esphome/core/defines.h +40 -2
  722. esphome/core/entity_base.h +18 -0
  723. esphome/core/entity_helpers.py +41 -6
  724. esphome/core/helpers.cpp +8 -15
  725. esphome/core/helpers.h +60 -6
  726. esphome/core/lock_free_queue.h +1 -1
  727. esphome/core/scheduler.cpp +277 -74
  728. esphome/core/scheduler.h +89 -27
  729. esphome/cpp_generator.py +2 -6
  730. esphome/cpp_helpers.py +1 -1
  731. esphome/dashboard/dashboard.py +2 -3
  732. esphome/dashboard/dns.py +2 -8
  733. esphome/dashboard/web_server.py +34 -19
  734. esphome/espota2.py +1 -4
  735. esphome/git.py +3 -1
  736. esphome/helpers.py +23 -4
  737. esphome/log.py +3 -1
  738. esphome/mqtt.py +3 -5
  739. esphome/platformio_api.py +7 -4
  740. esphome/types.py +12 -0
  741. esphome/util.py +20 -8
  742. esphome/voluptuous_schema.py +4 -3
  743. esphome/vscode.py +1 -2
  744. esphome/wizard.py +1 -4
  745. esphome/writer.py +5 -107
  746. esphome/yaml_util.py +7 -5
  747. {esphome-2025.7.4.dist-info → esphome-2025.8.0b1.dist-info}/METADATA +12 -13
  748. {esphome-2025.7.4.dist-info → esphome-2025.8.0b1.dist-info}/RECORD +753 -673
  749. esphome/components/mipi_spi/models/commands.py +0 -82
  750. /esphome/components/nfc/binary_sensor/{binary_sensor.h → nfc_binary_sensor.h} +0 -0
  751. {esphome-2025.7.4.dist-info → esphome-2025.8.0b1.dist-info}/WHEEL +0 -0
  752. {esphome-2025.7.4.dist-info → esphome-2025.8.0b1.dist-info}/entry_points.txt +0 -0
  753. {esphome-2025.7.4.dist-info → esphome-2025.8.0b1.dist-info}/licenses/LICENSE +0 -0
  754. {esphome-2025.7.4.dist-info → esphome-2025.8.0b1.dist-info}/top_level.txt +0 -0
@@ -3,11 +3,12 @@
3
3
  #pragma once
4
4
 
5
5
  #include "esphome/core/defines.h"
6
+ #include "esphome/core/string_ref.h"
6
7
 
7
8
  #include "proto.h"
9
+ #include "api_pb2_includes.h"
8
10
 
9
- namespace esphome {
10
- namespace api {
11
+ namespace esphome::api {
11
12
 
12
13
  namespace enums {
13
14
 
@@ -17,27 +18,13 @@ enum EntityCategory : uint32_t {
17
18
  ENTITY_CATEGORY_DIAGNOSTIC = 2,
18
19
  };
19
20
  #ifdef USE_COVER
20
- enum LegacyCoverState : uint32_t {
21
- LEGACY_COVER_STATE_OPEN = 0,
22
- LEGACY_COVER_STATE_CLOSED = 1,
23
- };
24
21
  enum CoverOperation : uint32_t {
25
22
  COVER_OPERATION_IDLE = 0,
26
23
  COVER_OPERATION_IS_OPENING = 1,
27
24
  COVER_OPERATION_IS_CLOSING = 2,
28
25
  };
29
- enum LegacyCoverCommand : uint32_t {
30
- LEGACY_COVER_COMMAND_OPEN = 0,
31
- LEGACY_COVER_COMMAND_CLOSE = 1,
32
- LEGACY_COVER_COMMAND_STOP = 2,
33
- };
34
26
  #endif
35
27
  #ifdef USE_FAN
36
- enum FanSpeed : uint32_t {
37
- FAN_SPEED_LOW = 0,
38
- FAN_SPEED_MEDIUM = 1,
39
- FAN_SPEED_HIGH = 2,
40
- };
41
28
  enum FanDirection : uint32_t {
42
29
  FAN_DIRECTION_FORWARD = 0,
43
30
  FAN_DIRECTION_REVERSE = 1,
@@ -65,11 +52,6 @@ enum SensorStateClass : uint32_t {
65
52
  STATE_CLASS_TOTAL_INCREASING = 2,
66
53
  STATE_CLASS_TOTAL = 3,
67
54
  };
68
- enum SensorLastResetType : uint32_t {
69
- LAST_RESET_NONE = 0,
70
- LAST_RESET_NEVER = 1,
71
- LAST_RESET_AUTO = 2,
72
- };
73
55
  #endif
74
56
  enum LogLevel : uint32_t {
75
57
  LOG_LEVEL_NONE = 0,
@@ -168,6 +150,9 @@ enum MediaPlayerState : uint32_t {
168
150
  MEDIA_PLAYER_STATE_IDLE = 1,
169
151
  MEDIA_PLAYER_STATE_PLAYING = 2,
170
152
  MEDIA_PLAYER_STATE_PAUSED = 3,
153
+ MEDIA_PLAYER_STATE_ANNOUNCING = 4,
154
+ MEDIA_PLAYER_STATE_OFF = 5,
155
+ MEDIA_PLAYER_STATE_ON = 6,
171
156
  };
172
157
  enum MediaPlayerCommand : uint32_t {
173
158
  MEDIA_PLAYER_COMMAND_PLAY = 0,
@@ -175,6 +160,15 @@ enum MediaPlayerCommand : uint32_t {
175
160
  MEDIA_PLAYER_COMMAND_STOP = 2,
176
161
  MEDIA_PLAYER_COMMAND_MUTE = 3,
177
162
  MEDIA_PLAYER_COMMAND_UNMUTE = 4,
163
+ MEDIA_PLAYER_COMMAND_TOGGLE = 5,
164
+ MEDIA_PLAYER_COMMAND_VOLUME_UP = 6,
165
+ MEDIA_PLAYER_COMMAND_VOLUME_DOWN = 7,
166
+ MEDIA_PLAYER_COMMAND_ENQUEUE = 8,
167
+ MEDIA_PLAYER_COMMAND_REPEAT_ONE = 9,
168
+ MEDIA_PLAYER_COMMAND_REPEAT_OFF = 10,
169
+ MEDIA_PLAYER_COMMAND_CLEAR_PLAYLIST = 11,
170
+ MEDIA_PLAYER_COMMAND_TURN_ON = 12,
171
+ MEDIA_PLAYER_COMMAND_TURN_OFF = 13,
178
172
  };
179
173
  enum MediaPlayerFormatPurpose : uint32_t {
180
174
  MEDIA_PLAYER_FORMAT_PURPOSE_DEFAULT = 0,
@@ -288,14 +282,20 @@ enum UpdateCommand : uint32_t {
288
282
  class InfoResponseProtoMessage : public ProtoMessage {
289
283
  public:
290
284
  ~InfoResponseProtoMessage() override = default;
291
- std::string object_id{};
285
+ StringRef object_id_ref_{};
286
+ void set_object_id(const StringRef &ref) { this->object_id_ref_ = ref; }
292
287
  uint32_t key{0};
293
- std::string name{};
294
- std::string unique_id{};
288
+ StringRef name_ref_{};
289
+ void set_name(const StringRef &ref) { this->name_ref_ = ref; }
295
290
  bool disabled_by_default{false};
296
- std::string icon{};
291
+ #ifdef USE_ENTITY_ICON
292
+ StringRef icon_ref_{};
293
+ void set_icon(const StringRef &ref) { this->icon_ref_ = ref; }
294
+ #endif
297
295
  enums::EntityCategory entity_category{};
296
+ #ifdef USE_DEVICES
298
297
  uint32_t device_id{0};
298
+ #endif
299
299
 
300
300
  protected:
301
301
  };
@@ -304,20 +304,24 @@ class StateResponseProtoMessage : public ProtoMessage {
304
304
  public:
305
305
  ~StateResponseProtoMessage() override = default;
306
306
  uint32_t key{0};
307
+ #ifdef USE_DEVICES
307
308
  uint32_t device_id{0};
309
+ #endif
308
310
 
309
311
  protected:
310
312
  };
311
313
 
312
- class CommandProtoMessage : public ProtoMessage {
314
+ class CommandProtoMessage : public ProtoDecodableMessage {
313
315
  public:
314
316
  ~CommandProtoMessage() override = default;
315
317
  uint32_t key{0};
318
+ #ifdef USE_DEVICES
316
319
  uint32_t device_id{0};
320
+ #endif
317
321
 
318
322
  protected:
319
323
  };
320
- class HelloRequest : public ProtoMessage {
324
+ class HelloRequest : public ProtoDecodableMessage {
321
325
  public:
322
326
  static constexpr uint8_t MESSAGE_TYPE = 1;
323
327
  static constexpr uint8_t ESTIMATED_SIZE = 17;
@@ -344,17 +348,19 @@ class HelloResponse : public ProtoMessage {
344
348
  #endif
345
349
  uint32_t api_version_major{0};
346
350
  uint32_t api_version_minor{0};
347
- std::string server_info{};
348
- std::string name{};
351
+ StringRef server_info_ref_{};
352
+ void set_server_info(const StringRef &ref) { this->server_info_ref_ = ref; }
353
+ StringRef name_ref_{};
354
+ void set_name(const StringRef &ref) { this->name_ref_ = ref; }
349
355
  void encode(ProtoWriteBuffer buffer) const override;
350
- void calculate_size(uint32_t &total_size) const override;
356
+ void calculate_size(ProtoSize &size) const override;
351
357
  #ifdef HAS_PROTO_MESSAGE_DUMP
352
358
  void dump_to(std::string &out) const override;
353
359
  #endif
354
360
 
355
361
  protected:
356
362
  };
357
- class ConnectRequest : public ProtoMessage {
363
+ class ConnectRequest : public ProtoDecodableMessage {
358
364
  public:
359
365
  static constexpr uint8_t MESSAGE_TYPE = 3;
360
366
  static constexpr uint8_t ESTIMATED_SIZE = 9;
@@ -378,7 +384,7 @@ class ConnectResponse : public ProtoMessage {
378
384
  #endif
379
385
  bool invalid_password{false};
380
386
  void encode(ProtoWriteBuffer buffer) const override;
381
- void calculate_size(uint32_t &total_size) const override;
387
+ void calculate_size(ProtoSize &size) const override;
382
388
  #ifdef HAS_PROTO_MESSAGE_DUMP
383
389
  void dump_to(std::string &out) const override;
384
390
  #endif
@@ -450,66 +456,103 @@ class DeviceInfoRequest : public ProtoMessage {
450
456
 
451
457
  protected:
452
458
  };
459
+ #ifdef USE_AREAS
453
460
  class AreaInfo : public ProtoMessage {
454
461
  public:
455
462
  uint32_t area_id{0};
456
- std::string name{};
463
+ StringRef name_ref_{};
464
+ void set_name(const StringRef &ref) { this->name_ref_ = ref; }
457
465
  void encode(ProtoWriteBuffer buffer) const override;
458
- void calculate_size(uint32_t &total_size) const override;
466
+ void calculate_size(ProtoSize &size) const override;
459
467
  #ifdef HAS_PROTO_MESSAGE_DUMP
460
468
  void dump_to(std::string &out) const override;
461
469
  #endif
462
470
 
463
471
  protected:
464
- bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override;
465
- bool decode_varint(uint32_t field_id, ProtoVarInt value) override;
466
472
  };
473
+ #endif
474
+ #ifdef USE_DEVICES
467
475
  class DeviceInfo : public ProtoMessage {
468
476
  public:
469
477
  uint32_t device_id{0};
470
- std::string name{};
478
+ StringRef name_ref_{};
479
+ void set_name(const StringRef &ref) { this->name_ref_ = ref; }
471
480
  uint32_t area_id{0};
472
481
  void encode(ProtoWriteBuffer buffer) const override;
473
- void calculate_size(uint32_t &total_size) const override;
482
+ void calculate_size(ProtoSize &size) const override;
474
483
  #ifdef HAS_PROTO_MESSAGE_DUMP
475
484
  void dump_to(std::string &out) const override;
476
485
  #endif
477
486
 
478
487
  protected:
479
- bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override;
480
- bool decode_varint(uint32_t field_id, ProtoVarInt value) override;
481
488
  };
489
+ #endif
482
490
  class DeviceInfoResponse : public ProtoMessage {
483
491
  public:
484
492
  static constexpr uint8_t MESSAGE_TYPE = 10;
485
- static constexpr uint8_t ESTIMATED_SIZE = 219;
493
+ static constexpr uint8_t ESTIMATED_SIZE = 247;
486
494
  #ifdef HAS_PROTO_MESSAGE_DUMP
487
495
  const char *message_name() const override { return "device_info_response"; }
488
496
  #endif
497
+ #ifdef USE_API_PASSWORD
489
498
  bool uses_password{false};
490
- std::string name{};
491
- std::string mac_address{};
492
- std::string esphome_version{};
493
- std::string compilation_time{};
494
- std::string model{};
499
+ #endif
500
+ StringRef name_ref_{};
501
+ void set_name(const StringRef &ref) { this->name_ref_ = ref; }
502
+ StringRef mac_address_ref_{};
503
+ void set_mac_address(const StringRef &ref) { this->mac_address_ref_ = ref; }
504
+ StringRef esphome_version_ref_{};
505
+ void set_esphome_version(const StringRef &ref) { this->esphome_version_ref_ = ref; }
506
+ StringRef compilation_time_ref_{};
507
+ void set_compilation_time(const StringRef &ref) { this->compilation_time_ref_ = ref; }
508
+ StringRef model_ref_{};
509
+ void set_model(const StringRef &ref) { this->model_ref_ = ref; }
510
+ #ifdef USE_DEEP_SLEEP
495
511
  bool has_deep_sleep{false};
496
- std::string project_name{};
497
- std::string project_version{};
512
+ #endif
513
+ #ifdef ESPHOME_PROJECT_NAME
514
+ StringRef project_name_ref_{};
515
+ void set_project_name(const StringRef &ref) { this->project_name_ref_ = ref; }
516
+ #endif
517
+ #ifdef ESPHOME_PROJECT_NAME
518
+ StringRef project_version_ref_{};
519
+ void set_project_version(const StringRef &ref) { this->project_version_ref_ = ref; }
520
+ #endif
521
+ #ifdef USE_WEBSERVER
498
522
  uint32_t webserver_port{0};
499
- uint32_t legacy_bluetooth_proxy_version{0};
523
+ #endif
524
+ #ifdef USE_BLUETOOTH_PROXY
500
525
  uint32_t bluetooth_proxy_feature_flags{0};
501
- std::string manufacturer{};
502
- std::string friendly_name{};
503
- uint32_t legacy_voice_assistant_version{0};
526
+ #endif
527
+ StringRef manufacturer_ref_{};
528
+ void set_manufacturer(const StringRef &ref) { this->manufacturer_ref_ = ref; }
529
+ StringRef friendly_name_ref_{};
530
+ void set_friendly_name(const StringRef &ref) { this->friendly_name_ref_ = ref; }
531
+ #ifdef USE_VOICE_ASSISTANT
504
532
  uint32_t voice_assistant_feature_flags{0};
505
- std::string suggested_area{};
506
- std::string bluetooth_mac_address{};
533
+ #endif
534
+ #ifdef USE_AREAS
535
+ StringRef suggested_area_ref_{};
536
+ void set_suggested_area(const StringRef &ref) { this->suggested_area_ref_ = ref; }
537
+ #endif
538
+ #ifdef USE_BLUETOOTH_PROXY
539
+ StringRef bluetooth_mac_address_ref_{};
540
+ void set_bluetooth_mac_address(const StringRef &ref) { this->bluetooth_mac_address_ref_ = ref; }
541
+ #endif
542
+ #ifdef USE_API_NOISE
507
543
  bool api_encryption_supported{false};
508
- std::vector<DeviceInfo> devices{};
509
- std::vector<AreaInfo> areas{};
544
+ #endif
545
+ #ifdef USE_DEVICES
546
+ std::array<DeviceInfo, ESPHOME_DEVICE_COUNT> devices{};
547
+ #endif
548
+ #ifdef USE_AREAS
549
+ std::array<AreaInfo, ESPHOME_AREA_COUNT> areas{};
550
+ #endif
551
+ #ifdef USE_AREAS
510
552
  AreaInfo area{};
553
+ #endif
511
554
  void encode(ProtoWriteBuffer buffer) const override;
512
- void calculate_size(uint32_t &total_size) const override;
555
+ void calculate_size(ProtoSize &size) const override;
513
556
  #ifdef HAS_PROTO_MESSAGE_DUMP
514
557
  void dump_to(std::string &out) const override;
515
558
  #endif
@@ -559,14 +602,15 @@ class SubscribeStatesRequest : public ProtoMessage {
559
602
  class ListEntitiesBinarySensorResponse : public InfoResponseProtoMessage {
560
603
  public:
561
604
  static constexpr uint8_t MESSAGE_TYPE = 12;
562
- static constexpr uint8_t ESTIMATED_SIZE = 60;
605
+ static constexpr uint8_t ESTIMATED_SIZE = 51;
563
606
  #ifdef HAS_PROTO_MESSAGE_DUMP
564
607
  const char *message_name() const override { return "list_entities_binary_sensor_response"; }
565
608
  #endif
566
- std::string device_class{};
609
+ StringRef device_class_ref_{};
610
+ void set_device_class(const StringRef &ref) { this->device_class_ref_ = ref; }
567
611
  bool is_status_binary_sensor{false};
568
612
  void encode(ProtoWriteBuffer buffer) const override;
569
- void calculate_size(uint32_t &total_size) const override;
613
+ void calculate_size(ProtoSize &size) const override;
570
614
  #ifdef HAS_PROTO_MESSAGE_DUMP
571
615
  void dump_to(std::string &out) const override;
572
616
  #endif
@@ -583,7 +627,7 @@ class BinarySensorStateResponse : public StateResponseProtoMessage {
583
627
  bool state{false};
584
628
  bool missing_state{false};
585
629
  void encode(ProtoWriteBuffer buffer) const override;
586
- void calculate_size(uint32_t &total_size) const override;
630
+ void calculate_size(ProtoSize &size) const override;
587
631
  #ifdef HAS_PROTO_MESSAGE_DUMP
588
632
  void dump_to(std::string &out) const override;
589
633
  #endif
@@ -595,17 +639,18 @@ class BinarySensorStateResponse : public StateResponseProtoMessage {
595
639
  class ListEntitiesCoverResponse : public InfoResponseProtoMessage {
596
640
  public:
597
641
  static constexpr uint8_t MESSAGE_TYPE = 13;
598
- static constexpr uint8_t ESTIMATED_SIZE = 66;
642
+ static constexpr uint8_t ESTIMATED_SIZE = 57;
599
643
  #ifdef HAS_PROTO_MESSAGE_DUMP
600
644
  const char *message_name() const override { return "list_entities_cover_response"; }
601
645
  #endif
602
646
  bool assumed_state{false};
603
647
  bool supports_position{false};
604
648
  bool supports_tilt{false};
605
- std::string device_class{};
649
+ StringRef device_class_ref_{};
650
+ void set_device_class(const StringRef &ref) { this->device_class_ref_ = ref; }
606
651
  bool supports_stop{false};
607
652
  void encode(ProtoWriteBuffer buffer) const override;
608
- void calculate_size(uint32_t &total_size) const override;
653
+ void calculate_size(ProtoSize &size) const override;
609
654
  #ifdef HAS_PROTO_MESSAGE_DUMP
610
655
  void dump_to(std::string &out) const override;
611
656
  #endif
@@ -615,16 +660,15 @@ class ListEntitiesCoverResponse : public InfoResponseProtoMessage {
615
660
  class CoverStateResponse : public StateResponseProtoMessage {
616
661
  public:
617
662
  static constexpr uint8_t MESSAGE_TYPE = 22;
618
- static constexpr uint8_t ESTIMATED_SIZE = 23;
663
+ static constexpr uint8_t ESTIMATED_SIZE = 21;
619
664
  #ifdef HAS_PROTO_MESSAGE_DUMP
620
665
  const char *message_name() const override { return "cover_state_response"; }
621
666
  #endif
622
- enums::LegacyCoverState legacy_state{};
623
667
  float position{0.0f};
624
668
  float tilt{0.0f};
625
669
  enums::CoverOperation current_operation{};
626
670
  void encode(ProtoWriteBuffer buffer) const override;
627
- void calculate_size(uint32_t &total_size) const override;
671
+ void calculate_size(ProtoSize &size) const override;
628
672
  #ifdef HAS_PROTO_MESSAGE_DUMP
629
673
  void dump_to(std::string &out) const override;
630
674
  #endif
@@ -634,12 +678,10 @@ class CoverStateResponse : public StateResponseProtoMessage {
634
678
  class CoverCommandRequest : public CommandProtoMessage {
635
679
  public:
636
680
  static constexpr uint8_t MESSAGE_TYPE = 30;
637
- static constexpr uint8_t ESTIMATED_SIZE = 29;
681
+ static constexpr uint8_t ESTIMATED_SIZE = 25;
638
682
  #ifdef HAS_PROTO_MESSAGE_DUMP
639
683
  const char *message_name() const override { return "cover_command_request"; }
640
684
  #endif
641
- bool has_legacy_command{false};
642
- enums::LegacyCoverCommand legacy_command{};
643
685
  bool has_position{false};
644
686
  float position{0.0f};
645
687
  bool has_tilt{false};
@@ -658,7 +700,7 @@ class CoverCommandRequest : public CommandProtoMessage {
658
700
  class ListEntitiesFanResponse : public InfoResponseProtoMessage {
659
701
  public:
660
702
  static constexpr uint8_t MESSAGE_TYPE = 14;
661
- static constexpr uint8_t ESTIMATED_SIZE = 77;
703
+ static constexpr uint8_t ESTIMATED_SIZE = 68;
662
704
  #ifdef HAS_PROTO_MESSAGE_DUMP
663
705
  const char *message_name() const override { return "list_entities_fan_response"; }
664
706
  #endif
@@ -666,9 +708,9 @@ class ListEntitiesFanResponse : public InfoResponseProtoMessage {
666
708
  bool supports_speed{false};
667
709
  bool supports_direction{false};
668
710
  int32_t supported_speed_count{0};
669
- std::vector<std::string> supported_preset_modes{};
711
+ const std::set<std::string> *supported_preset_modes{};
670
712
  void encode(ProtoWriteBuffer buffer) const override;
671
- void calculate_size(uint32_t &total_size) const override;
713
+ void calculate_size(ProtoSize &size) const override;
672
714
  #ifdef HAS_PROTO_MESSAGE_DUMP
673
715
  void dump_to(std::string &out) const override;
674
716
  #endif
@@ -678,18 +720,18 @@ class ListEntitiesFanResponse : public InfoResponseProtoMessage {
678
720
  class FanStateResponse : public StateResponseProtoMessage {
679
721
  public:
680
722
  static constexpr uint8_t MESSAGE_TYPE = 23;
681
- static constexpr uint8_t ESTIMATED_SIZE = 30;
723
+ static constexpr uint8_t ESTIMATED_SIZE = 28;
682
724
  #ifdef HAS_PROTO_MESSAGE_DUMP
683
725
  const char *message_name() const override { return "fan_state_response"; }
684
726
  #endif
685
727
  bool state{false};
686
728
  bool oscillating{false};
687
- enums::FanSpeed speed{};
688
729
  enums::FanDirection direction{};
689
730
  int32_t speed_level{0};
690
- std::string preset_mode{};
731
+ StringRef preset_mode_ref_{};
732
+ void set_preset_mode(const StringRef &ref) { this->preset_mode_ref_ = ref; }
691
733
  void encode(ProtoWriteBuffer buffer) const override;
692
- void calculate_size(uint32_t &total_size) const override;
734
+ void calculate_size(ProtoSize &size) const override;
693
735
  #ifdef HAS_PROTO_MESSAGE_DUMP
694
736
  void dump_to(std::string &out) const override;
695
737
  #endif
@@ -699,14 +741,12 @@ class FanStateResponse : public StateResponseProtoMessage {
699
741
  class FanCommandRequest : public CommandProtoMessage {
700
742
  public:
701
743
  static constexpr uint8_t MESSAGE_TYPE = 31;
702
- static constexpr uint8_t ESTIMATED_SIZE = 42;
744
+ static constexpr uint8_t ESTIMATED_SIZE = 38;
703
745
  #ifdef HAS_PROTO_MESSAGE_DUMP
704
746
  const char *message_name() const override { return "fan_command_request"; }
705
747
  #endif
706
748
  bool has_state{false};
707
749
  bool state{false};
708
- bool has_speed{false};
709
- enums::FanSpeed speed{};
710
750
  bool has_oscillating{false};
711
751
  bool oscillating{false};
712
752
  bool has_direction{false};
@@ -729,20 +769,16 @@ class FanCommandRequest : public CommandProtoMessage {
729
769
  class ListEntitiesLightResponse : public InfoResponseProtoMessage {
730
770
  public:
731
771
  static constexpr uint8_t MESSAGE_TYPE = 15;
732
- static constexpr uint8_t ESTIMATED_SIZE = 90;
772
+ static constexpr uint8_t ESTIMATED_SIZE = 73;
733
773
  #ifdef HAS_PROTO_MESSAGE_DUMP
734
774
  const char *message_name() const override { return "list_entities_light_response"; }
735
775
  #endif
736
- std::vector<enums::ColorMode> supported_color_modes{};
737
- bool legacy_supports_brightness{false};
738
- bool legacy_supports_rgb{false};
739
- bool legacy_supports_white_value{false};
740
- bool legacy_supports_color_temperature{false};
776
+ const std::set<light::ColorMode> *supported_color_modes{};
741
777
  float min_mireds{0.0f};
742
778
  float max_mireds{0.0f};
743
779
  std::vector<std::string> effects{};
744
780
  void encode(ProtoWriteBuffer buffer) const override;
745
- void calculate_size(uint32_t &total_size) const override;
781
+ void calculate_size(ProtoSize &size) const override;
746
782
  #ifdef HAS_PROTO_MESSAGE_DUMP
747
783
  void dump_to(std::string &out) const override;
748
784
  #endif
@@ -767,9 +803,10 @@ class LightStateResponse : public StateResponseProtoMessage {
767
803
  float color_temperature{0.0f};
768
804
  float cold_white{0.0f};
769
805
  float warm_white{0.0f};
770
- std::string effect{};
806
+ StringRef effect_ref_{};
807
+ void set_effect(const StringRef &ref) { this->effect_ref_ = ref; }
771
808
  void encode(ProtoWriteBuffer buffer) const override;
772
- void calculate_size(uint32_t &total_size) const override;
809
+ void calculate_size(ProtoSize &size) const override;
773
810
  #ifdef HAS_PROTO_MESSAGE_DUMP
774
811
  void dump_to(std::string &out) const override;
775
812
  #endif
@@ -823,18 +860,19 @@ class LightCommandRequest : public CommandProtoMessage {
823
860
  class ListEntitiesSensorResponse : public InfoResponseProtoMessage {
824
861
  public:
825
862
  static constexpr uint8_t MESSAGE_TYPE = 16;
826
- static constexpr uint8_t ESTIMATED_SIZE = 77;
863
+ static constexpr uint8_t ESTIMATED_SIZE = 66;
827
864
  #ifdef HAS_PROTO_MESSAGE_DUMP
828
865
  const char *message_name() const override { return "list_entities_sensor_response"; }
829
866
  #endif
830
- std::string unit_of_measurement{};
867
+ StringRef unit_of_measurement_ref_{};
868
+ void set_unit_of_measurement(const StringRef &ref) { this->unit_of_measurement_ref_ = ref; }
831
869
  int32_t accuracy_decimals{0};
832
870
  bool force_update{false};
833
- std::string device_class{};
871
+ StringRef device_class_ref_{};
872
+ void set_device_class(const StringRef &ref) { this->device_class_ref_ = ref; }
834
873
  enums::SensorStateClass state_class{};
835
- enums::SensorLastResetType legacy_last_reset_type{};
836
874
  void encode(ProtoWriteBuffer buffer) const override;
837
- void calculate_size(uint32_t &total_size) const override;
875
+ void calculate_size(ProtoSize &size) const override;
838
876
  #ifdef HAS_PROTO_MESSAGE_DUMP
839
877
  void dump_to(std::string &out) const override;
840
878
  #endif
@@ -851,7 +889,7 @@ class SensorStateResponse : public StateResponseProtoMessage {
851
889
  float state{0.0f};
852
890
  bool missing_state{false};
853
891
  void encode(ProtoWriteBuffer buffer) const override;
854
- void calculate_size(uint32_t &total_size) const override;
892
+ void calculate_size(ProtoSize &size) const override;
855
893
  #ifdef HAS_PROTO_MESSAGE_DUMP
856
894
  void dump_to(std::string &out) const override;
857
895
  #endif
@@ -863,14 +901,15 @@ class SensorStateResponse : public StateResponseProtoMessage {
863
901
  class ListEntitiesSwitchResponse : public InfoResponseProtoMessage {
864
902
  public:
865
903
  static constexpr uint8_t MESSAGE_TYPE = 17;
866
- static constexpr uint8_t ESTIMATED_SIZE = 60;
904
+ static constexpr uint8_t ESTIMATED_SIZE = 51;
867
905
  #ifdef HAS_PROTO_MESSAGE_DUMP
868
906
  const char *message_name() const override { return "list_entities_switch_response"; }
869
907
  #endif
870
908
  bool assumed_state{false};
871
- std::string device_class{};
909
+ StringRef device_class_ref_{};
910
+ void set_device_class(const StringRef &ref) { this->device_class_ref_ = ref; }
872
911
  void encode(ProtoWriteBuffer buffer) const override;
873
- void calculate_size(uint32_t &total_size) const override;
912
+ void calculate_size(ProtoSize &size) const override;
874
913
  #ifdef HAS_PROTO_MESSAGE_DUMP
875
914
  void dump_to(std::string &out) const override;
876
915
  #endif
@@ -886,7 +925,7 @@ class SwitchStateResponse : public StateResponseProtoMessage {
886
925
  #endif
887
926
  bool state{false};
888
927
  void encode(ProtoWriteBuffer buffer) const override;
889
- void calculate_size(uint32_t &total_size) const override;
928
+ void calculate_size(ProtoSize &size) const override;
890
929
  #ifdef HAS_PROTO_MESSAGE_DUMP
891
930
  void dump_to(std::string &out) const override;
892
931
  #endif
@@ -914,13 +953,14 @@ class SwitchCommandRequest : public CommandProtoMessage {
914
953
  class ListEntitiesTextSensorResponse : public InfoResponseProtoMessage {
915
954
  public:
916
955
  static constexpr uint8_t MESSAGE_TYPE = 18;
917
- static constexpr uint8_t ESTIMATED_SIZE = 58;
956
+ static constexpr uint8_t ESTIMATED_SIZE = 49;
918
957
  #ifdef HAS_PROTO_MESSAGE_DUMP
919
958
  const char *message_name() const override { return "list_entities_text_sensor_response"; }
920
959
  #endif
921
- std::string device_class{};
960
+ StringRef device_class_ref_{};
961
+ void set_device_class(const StringRef &ref) { this->device_class_ref_ = ref; }
922
962
  void encode(ProtoWriteBuffer buffer) const override;
923
- void calculate_size(uint32_t &total_size) const override;
963
+ void calculate_size(ProtoSize &size) const override;
924
964
  #ifdef HAS_PROTO_MESSAGE_DUMP
925
965
  void dump_to(std::string &out) const override;
926
966
  #endif
@@ -934,10 +974,11 @@ class TextSensorStateResponse : public StateResponseProtoMessage {
934
974
  #ifdef HAS_PROTO_MESSAGE_DUMP
935
975
  const char *message_name() const override { return "text_sensor_state_response"; }
936
976
  #endif
937
- std::string state{};
977
+ StringRef state_ref_{};
978
+ void set_state(const StringRef &ref) { this->state_ref_ = ref; }
938
979
  bool missing_state{false};
939
980
  void encode(ProtoWriteBuffer buffer) const override;
940
- void calculate_size(uint32_t &total_size) const override;
981
+ void calculate_size(ProtoSize &size) const override;
941
982
  #ifdef HAS_PROTO_MESSAGE_DUMP
942
983
  void dump_to(std::string &out) const override;
943
984
  #endif
@@ -945,7 +986,7 @@ class TextSensorStateResponse : public StateResponseProtoMessage {
945
986
  protected:
946
987
  };
947
988
  #endif
948
- class SubscribeLogsRequest : public ProtoMessage {
989
+ class SubscribeLogsRequest : public ProtoDecodableMessage {
949
990
  public:
950
991
  static constexpr uint8_t MESSAGE_TYPE = 28;
951
992
  static constexpr uint8_t ESTIMATED_SIZE = 4;
@@ -964,15 +1005,19 @@ class SubscribeLogsRequest : public ProtoMessage {
964
1005
  class SubscribeLogsResponse : public ProtoMessage {
965
1006
  public:
966
1007
  static constexpr uint8_t MESSAGE_TYPE = 29;
967
- static constexpr uint8_t ESTIMATED_SIZE = 13;
1008
+ static constexpr uint8_t ESTIMATED_SIZE = 11;
968
1009
  #ifdef HAS_PROTO_MESSAGE_DUMP
969
1010
  const char *message_name() const override { return "subscribe_logs_response"; }
970
1011
  #endif
971
1012
  enums::LogLevel level{};
972
- std::string message{};
973
- bool send_failed{false};
1013
+ const uint8_t *message_ptr_{nullptr};
1014
+ size_t message_len_{0};
1015
+ void set_message(const uint8_t *data, size_t len) {
1016
+ this->message_ptr_ = data;
1017
+ this->message_len_ = len;
1018
+ }
974
1019
  void encode(ProtoWriteBuffer buffer) const override;
975
- void calculate_size(uint32_t &total_size) const override;
1020
+ void calculate_size(ProtoSize &size) const override;
976
1021
  #ifdef HAS_PROTO_MESSAGE_DUMP
977
1022
  void dump_to(std::string &out) const override;
978
1023
  #endif
@@ -980,7 +1025,7 @@ class SubscribeLogsResponse : public ProtoMessage {
980
1025
  protected:
981
1026
  };
982
1027
  #ifdef USE_API_NOISE
983
- class NoiseEncryptionSetKeyRequest : public ProtoMessage {
1028
+ class NoiseEncryptionSetKeyRequest : public ProtoDecodableMessage {
984
1029
  public:
985
1030
  static constexpr uint8_t MESSAGE_TYPE = 124;
986
1031
  static constexpr uint8_t ESTIMATED_SIZE = 9;
@@ -1004,7 +1049,7 @@ class NoiseEncryptionSetKeyResponse : public ProtoMessage {
1004
1049
  #endif
1005
1050
  bool success{false};
1006
1051
  void encode(ProtoWriteBuffer buffer) const override;
1007
- void calculate_size(uint32_t &total_size) const override;
1052
+ void calculate_size(ProtoSize &size) const override;
1008
1053
  #ifdef HAS_PROTO_MESSAGE_DUMP
1009
1054
  void dump_to(std::string &out) const override;
1010
1055
  #endif
@@ -1012,6 +1057,7 @@ class NoiseEncryptionSetKeyResponse : public ProtoMessage {
1012
1057
  protected:
1013
1058
  };
1014
1059
  #endif
1060
+ #ifdef USE_API_HOMEASSISTANT_SERVICES
1015
1061
  class SubscribeHomeassistantServicesRequest : public ProtoMessage {
1016
1062
  public:
1017
1063
  static constexpr uint8_t MESSAGE_TYPE = 34;
@@ -1027,16 +1073,16 @@ class SubscribeHomeassistantServicesRequest : public ProtoMessage {
1027
1073
  };
1028
1074
  class HomeassistantServiceMap : public ProtoMessage {
1029
1075
  public:
1030
- std::string key{};
1076
+ StringRef key_ref_{};
1077
+ void set_key(const StringRef &ref) { this->key_ref_ = ref; }
1031
1078
  std::string value{};
1032
1079
  void encode(ProtoWriteBuffer buffer) const override;
1033
- void calculate_size(uint32_t &total_size) const override;
1080
+ void calculate_size(ProtoSize &size) const override;
1034
1081
  #ifdef HAS_PROTO_MESSAGE_DUMP
1035
1082
  void dump_to(std::string &out) const override;
1036
1083
  #endif
1037
1084
 
1038
1085
  protected:
1039
- bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override;
1040
1086
  };
1041
1087
  class HomeassistantServiceResponse : public ProtoMessage {
1042
1088
  public:
@@ -1045,19 +1091,22 @@ class HomeassistantServiceResponse : public ProtoMessage {
1045
1091
  #ifdef HAS_PROTO_MESSAGE_DUMP
1046
1092
  const char *message_name() const override { return "homeassistant_service_response"; }
1047
1093
  #endif
1048
- std::string service{};
1094
+ StringRef service_ref_{};
1095
+ void set_service(const StringRef &ref) { this->service_ref_ = ref; }
1049
1096
  std::vector<HomeassistantServiceMap> data{};
1050
1097
  std::vector<HomeassistantServiceMap> data_template{};
1051
1098
  std::vector<HomeassistantServiceMap> variables{};
1052
1099
  bool is_event{false};
1053
1100
  void encode(ProtoWriteBuffer buffer) const override;
1054
- void calculate_size(uint32_t &total_size) const override;
1101
+ void calculate_size(ProtoSize &size) const override;
1055
1102
  #ifdef HAS_PROTO_MESSAGE_DUMP
1056
1103
  void dump_to(std::string &out) const override;
1057
1104
  #endif
1058
1105
 
1059
1106
  protected:
1060
1107
  };
1108
+ #endif
1109
+ #ifdef USE_API_HOMEASSISTANT_STATES
1061
1110
  class SubscribeHomeAssistantStatesRequest : public ProtoMessage {
1062
1111
  public:
1063
1112
  static constexpr uint8_t MESSAGE_TYPE = 38;
@@ -1078,18 +1127,20 @@ class SubscribeHomeAssistantStateResponse : public ProtoMessage {
1078
1127
  #ifdef HAS_PROTO_MESSAGE_DUMP
1079
1128
  const char *message_name() const override { return "subscribe_home_assistant_state_response"; }
1080
1129
  #endif
1081
- std::string entity_id{};
1082
- std::string attribute{};
1130
+ StringRef entity_id_ref_{};
1131
+ void set_entity_id(const StringRef &ref) { this->entity_id_ref_ = ref; }
1132
+ StringRef attribute_ref_{};
1133
+ void set_attribute(const StringRef &ref) { this->attribute_ref_ = ref; }
1083
1134
  bool once{false};
1084
1135
  void encode(ProtoWriteBuffer buffer) const override;
1085
- void calculate_size(uint32_t &total_size) const override;
1136
+ void calculate_size(ProtoSize &size) const override;
1086
1137
  #ifdef HAS_PROTO_MESSAGE_DUMP
1087
1138
  void dump_to(std::string &out) const override;
1088
1139
  #endif
1089
1140
 
1090
1141
  protected:
1091
1142
  };
1092
- class HomeAssistantStateResponse : public ProtoMessage {
1143
+ class HomeAssistantStateResponse : public ProtoDecodableMessage {
1093
1144
  public:
1094
1145
  static constexpr uint8_t MESSAGE_TYPE = 40;
1095
1146
  static constexpr uint8_t ESTIMATED_SIZE = 27;
@@ -1106,6 +1157,7 @@ class HomeAssistantStateResponse : public ProtoMessage {
1106
1157
  protected:
1107
1158
  bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override;
1108
1159
  };
1160
+ #endif
1109
1161
  class GetTimeRequest : public ProtoMessage {
1110
1162
  public:
1111
1163
  static constexpr uint8_t MESSAGE_TYPE = 36;
@@ -1119,7 +1171,7 @@ class GetTimeRequest : public ProtoMessage {
1119
1171
 
1120
1172
  protected:
1121
1173
  };
1122
- class GetTimeResponse : public ProtoMessage {
1174
+ class GetTimeResponse : public ProtoDecodableMessage {
1123
1175
  public:
1124
1176
  static constexpr uint8_t MESSAGE_TYPE = 37;
1125
1177
  static constexpr uint8_t ESTIMATED_SIZE = 5;
@@ -1128,7 +1180,7 @@ class GetTimeResponse : public ProtoMessage {
1128
1180
  #endif
1129
1181
  uint32_t epoch_seconds{0};
1130
1182
  void encode(ProtoWriteBuffer buffer) const override;
1131
- void calculate_size(uint32_t &total_size) const override;
1183
+ void calculate_size(ProtoSize &size) const override;
1132
1184
  #ifdef HAS_PROTO_MESSAGE_DUMP
1133
1185
  void dump_to(std::string &out) const override;
1134
1186
  #endif
@@ -1139,17 +1191,16 @@ class GetTimeResponse : public ProtoMessage {
1139
1191
  #ifdef USE_API_SERVICES
1140
1192
  class ListEntitiesServicesArgument : public ProtoMessage {
1141
1193
  public:
1142
- std::string name{};
1194
+ StringRef name_ref_{};
1195
+ void set_name(const StringRef &ref) { this->name_ref_ = ref; }
1143
1196
  enums::ServiceArgType type{};
1144
1197
  void encode(ProtoWriteBuffer buffer) const override;
1145
- void calculate_size(uint32_t &total_size) const override;
1198
+ void calculate_size(ProtoSize &size) const override;
1146
1199
  #ifdef HAS_PROTO_MESSAGE_DUMP
1147
1200
  void dump_to(std::string &out) const override;
1148
1201
  #endif
1149
1202
 
1150
1203
  protected:
1151
- bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override;
1152
- bool decode_varint(uint32_t field_id, ProtoVarInt value) override;
1153
1204
  };
1154
1205
  class ListEntitiesServicesResponse : public ProtoMessage {
1155
1206
  public:
@@ -1158,18 +1209,19 @@ class ListEntitiesServicesResponse : public ProtoMessage {
1158
1209
  #ifdef HAS_PROTO_MESSAGE_DUMP
1159
1210
  const char *message_name() const override { return "list_entities_services_response"; }
1160
1211
  #endif
1161
- std::string name{};
1212
+ StringRef name_ref_{};
1213
+ void set_name(const StringRef &ref) { this->name_ref_ = ref; }
1162
1214
  uint32_t key{0};
1163
1215
  std::vector<ListEntitiesServicesArgument> args{};
1164
1216
  void encode(ProtoWriteBuffer buffer) const override;
1165
- void calculate_size(uint32_t &total_size) const override;
1217
+ void calculate_size(ProtoSize &size) const override;
1166
1218
  #ifdef HAS_PROTO_MESSAGE_DUMP
1167
1219
  void dump_to(std::string &out) const override;
1168
1220
  #endif
1169
1221
 
1170
1222
  protected:
1171
1223
  };
1172
- class ExecuteServiceArgument : public ProtoMessage {
1224
+ class ExecuteServiceArgument : public ProtoDecodableMessage {
1173
1225
  public:
1174
1226
  bool bool_{false};
1175
1227
  int32_t legacy_int{0};
@@ -1180,8 +1232,6 @@ class ExecuteServiceArgument : public ProtoMessage {
1180
1232
  std::vector<int32_t> int_array{};
1181
1233
  std::vector<float> float_array{};
1182
1234
  std::vector<std::string> string_array{};
1183
- void encode(ProtoWriteBuffer buffer) const override;
1184
- void calculate_size(uint32_t &total_size) const override;
1185
1235
  #ifdef HAS_PROTO_MESSAGE_DUMP
1186
1236
  void dump_to(std::string &out) const override;
1187
1237
  #endif
@@ -1191,7 +1241,7 @@ class ExecuteServiceArgument : public ProtoMessage {
1191
1241
  bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override;
1192
1242
  bool decode_varint(uint32_t field_id, ProtoVarInt value) override;
1193
1243
  };
1194
- class ExecuteServiceRequest : public ProtoMessage {
1244
+ class ExecuteServiceRequest : public ProtoDecodableMessage {
1195
1245
  public:
1196
1246
  static constexpr uint8_t MESSAGE_TYPE = 42;
1197
1247
  static constexpr uint8_t ESTIMATED_SIZE = 39;
@@ -1213,12 +1263,12 @@ class ExecuteServiceRequest : public ProtoMessage {
1213
1263
  class ListEntitiesCameraResponse : public InfoResponseProtoMessage {
1214
1264
  public:
1215
1265
  static constexpr uint8_t MESSAGE_TYPE = 43;
1216
- static constexpr uint8_t ESTIMATED_SIZE = 49;
1266
+ static constexpr uint8_t ESTIMATED_SIZE = 40;
1217
1267
  #ifdef HAS_PROTO_MESSAGE_DUMP
1218
1268
  const char *message_name() const override { return "list_entities_camera_response"; }
1219
1269
  #endif
1220
1270
  void encode(ProtoWriteBuffer buffer) const override;
1221
- void calculate_size(uint32_t &total_size) const override;
1271
+ void calculate_size(ProtoSize &size) const override;
1222
1272
  #ifdef HAS_PROTO_MESSAGE_DUMP
1223
1273
  void dump_to(std::string &out) const override;
1224
1274
  #endif
@@ -1232,17 +1282,22 @@ class CameraImageResponse : public StateResponseProtoMessage {
1232
1282
  #ifdef HAS_PROTO_MESSAGE_DUMP
1233
1283
  const char *message_name() const override { return "camera_image_response"; }
1234
1284
  #endif
1235
- std::string data{};
1285
+ const uint8_t *data_ptr_{nullptr};
1286
+ size_t data_len_{0};
1287
+ void set_data(const uint8_t *data, size_t len) {
1288
+ this->data_ptr_ = data;
1289
+ this->data_len_ = len;
1290
+ }
1236
1291
  bool done{false};
1237
1292
  void encode(ProtoWriteBuffer buffer) const override;
1238
- void calculate_size(uint32_t &total_size) const override;
1293
+ void calculate_size(ProtoSize &size) const override;
1239
1294
  #ifdef HAS_PROTO_MESSAGE_DUMP
1240
1295
  void dump_to(std::string &out) const override;
1241
1296
  #endif
1242
1297
 
1243
1298
  protected:
1244
1299
  };
1245
- class CameraImageRequest : public ProtoMessage {
1300
+ class CameraImageRequest : public ProtoDecodableMessage {
1246
1301
  public:
1247
1302
  static constexpr uint8_t MESSAGE_TYPE = 45;
1248
1303
  static constexpr uint8_t ESTIMATED_SIZE = 4;
@@ -1263,30 +1318,29 @@ class CameraImageRequest : public ProtoMessage {
1263
1318
  class ListEntitiesClimateResponse : public InfoResponseProtoMessage {
1264
1319
  public:
1265
1320
  static constexpr uint8_t MESSAGE_TYPE = 46;
1266
- static constexpr uint8_t ESTIMATED_SIZE = 156;
1321
+ static constexpr uint8_t ESTIMATED_SIZE = 145;
1267
1322
  #ifdef HAS_PROTO_MESSAGE_DUMP
1268
1323
  const char *message_name() const override { return "list_entities_climate_response"; }
1269
1324
  #endif
1270
1325
  bool supports_current_temperature{false};
1271
1326
  bool supports_two_point_target_temperature{false};
1272
- std::vector<enums::ClimateMode> supported_modes{};
1327
+ const std::set<climate::ClimateMode> *supported_modes{};
1273
1328
  float visual_min_temperature{0.0f};
1274
1329
  float visual_max_temperature{0.0f};
1275
1330
  float visual_target_temperature_step{0.0f};
1276
- bool legacy_supports_away{false};
1277
1331
  bool supports_action{false};
1278
- std::vector<enums::ClimateFanMode> supported_fan_modes{};
1279
- std::vector<enums::ClimateSwingMode> supported_swing_modes{};
1280
- std::vector<std::string> supported_custom_fan_modes{};
1281
- std::vector<enums::ClimatePreset> supported_presets{};
1282
- std::vector<std::string> supported_custom_presets{};
1332
+ const std::set<climate::ClimateFanMode> *supported_fan_modes{};
1333
+ const std::set<climate::ClimateSwingMode> *supported_swing_modes{};
1334
+ const std::set<std::string> *supported_custom_fan_modes{};
1335
+ const std::set<climate::ClimatePreset> *supported_presets{};
1336
+ const std::set<std::string> *supported_custom_presets{};
1283
1337
  float visual_current_temperature_step{0.0f};
1284
1338
  bool supports_current_humidity{false};
1285
1339
  bool supports_target_humidity{false};
1286
1340
  float visual_min_humidity{0.0f};
1287
1341
  float visual_max_humidity{0.0f};
1288
1342
  void encode(ProtoWriteBuffer buffer) const override;
1289
- void calculate_size(uint32_t &total_size) const override;
1343
+ void calculate_size(ProtoSize &size) const override;
1290
1344
  #ifdef HAS_PROTO_MESSAGE_DUMP
1291
1345
  void dump_to(std::string &out) const override;
1292
1346
  #endif
@@ -1296,7 +1350,7 @@ class ListEntitiesClimateResponse : public InfoResponseProtoMessage {
1296
1350
  class ClimateStateResponse : public StateResponseProtoMessage {
1297
1351
  public:
1298
1352
  static constexpr uint8_t MESSAGE_TYPE = 47;
1299
- static constexpr uint8_t ESTIMATED_SIZE = 70;
1353
+ static constexpr uint8_t ESTIMATED_SIZE = 68;
1300
1354
  #ifdef HAS_PROTO_MESSAGE_DUMP
1301
1355
  const char *message_name() const override { return "climate_state_response"; }
1302
1356
  #endif
@@ -1305,17 +1359,18 @@ class ClimateStateResponse : public StateResponseProtoMessage {
1305
1359
  float target_temperature{0.0f};
1306
1360
  float target_temperature_low{0.0f};
1307
1361
  float target_temperature_high{0.0f};
1308
- bool unused_legacy_away{false};
1309
1362
  enums::ClimateAction action{};
1310
1363
  enums::ClimateFanMode fan_mode{};
1311
1364
  enums::ClimateSwingMode swing_mode{};
1312
- std::string custom_fan_mode{};
1365
+ StringRef custom_fan_mode_ref_{};
1366
+ void set_custom_fan_mode(const StringRef &ref) { this->custom_fan_mode_ref_ = ref; }
1313
1367
  enums::ClimatePreset preset{};
1314
- std::string custom_preset{};
1368
+ StringRef custom_preset_ref_{};
1369
+ void set_custom_preset(const StringRef &ref) { this->custom_preset_ref_ = ref; }
1315
1370
  float current_humidity{0.0f};
1316
1371
  float target_humidity{0.0f};
1317
1372
  void encode(ProtoWriteBuffer buffer) const override;
1318
- void calculate_size(uint32_t &total_size) const override;
1373
+ void calculate_size(ProtoSize &size) const override;
1319
1374
  #ifdef HAS_PROTO_MESSAGE_DUMP
1320
1375
  void dump_to(std::string &out) const override;
1321
1376
  #endif
@@ -1325,7 +1380,7 @@ class ClimateStateResponse : public StateResponseProtoMessage {
1325
1380
  class ClimateCommandRequest : public CommandProtoMessage {
1326
1381
  public:
1327
1382
  static constexpr uint8_t MESSAGE_TYPE = 48;
1328
- static constexpr uint8_t ESTIMATED_SIZE = 88;
1383
+ static constexpr uint8_t ESTIMATED_SIZE = 84;
1329
1384
  #ifdef HAS_PROTO_MESSAGE_DUMP
1330
1385
  const char *message_name() const override { return "climate_command_request"; }
1331
1386
  #endif
@@ -1337,8 +1392,6 @@ class ClimateCommandRequest : public CommandProtoMessage {
1337
1392
  float target_temperature_low{0.0f};
1338
1393
  bool has_target_temperature_high{false};
1339
1394
  float target_temperature_high{0.0f};
1340
- bool unused_has_legacy_away{false};
1341
- bool unused_legacy_away{false};
1342
1395
  bool has_fan_mode{false};
1343
1396
  enums::ClimateFanMode fan_mode{};
1344
1397
  bool has_swing_mode{false};
@@ -1365,18 +1418,20 @@ class ClimateCommandRequest : public CommandProtoMessage {
1365
1418
  class ListEntitiesNumberResponse : public InfoResponseProtoMessage {
1366
1419
  public:
1367
1420
  static constexpr uint8_t MESSAGE_TYPE = 49;
1368
- static constexpr uint8_t ESTIMATED_SIZE = 84;
1421
+ static constexpr uint8_t ESTIMATED_SIZE = 75;
1369
1422
  #ifdef HAS_PROTO_MESSAGE_DUMP
1370
1423
  const char *message_name() const override { return "list_entities_number_response"; }
1371
1424
  #endif
1372
1425
  float min_value{0.0f};
1373
1426
  float max_value{0.0f};
1374
1427
  float step{0.0f};
1375
- std::string unit_of_measurement{};
1428
+ StringRef unit_of_measurement_ref_{};
1429
+ void set_unit_of_measurement(const StringRef &ref) { this->unit_of_measurement_ref_ = ref; }
1376
1430
  enums::NumberMode mode{};
1377
- std::string device_class{};
1431
+ StringRef device_class_ref_{};
1432
+ void set_device_class(const StringRef &ref) { this->device_class_ref_ = ref; }
1378
1433
  void encode(ProtoWriteBuffer buffer) const override;
1379
- void calculate_size(uint32_t &total_size) const override;
1434
+ void calculate_size(ProtoSize &size) const override;
1380
1435
  #ifdef HAS_PROTO_MESSAGE_DUMP
1381
1436
  void dump_to(std::string &out) const override;
1382
1437
  #endif
@@ -1393,7 +1448,7 @@ class NumberStateResponse : public StateResponseProtoMessage {
1393
1448
  float state{0.0f};
1394
1449
  bool missing_state{false};
1395
1450
  void encode(ProtoWriteBuffer buffer) const override;
1396
- void calculate_size(uint32_t &total_size) const override;
1451
+ void calculate_size(ProtoSize &size) const override;
1397
1452
  #ifdef HAS_PROTO_MESSAGE_DUMP
1398
1453
  void dump_to(std::string &out) const override;
1399
1454
  #endif
@@ -1421,13 +1476,13 @@ class NumberCommandRequest : public CommandProtoMessage {
1421
1476
  class ListEntitiesSelectResponse : public InfoResponseProtoMessage {
1422
1477
  public:
1423
1478
  static constexpr uint8_t MESSAGE_TYPE = 52;
1424
- static constexpr uint8_t ESTIMATED_SIZE = 67;
1479
+ static constexpr uint8_t ESTIMATED_SIZE = 58;
1425
1480
  #ifdef HAS_PROTO_MESSAGE_DUMP
1426
1481
  const char *message_name() const override { return "list_entities_select_response"; }
1427
1482
  #endif
1428
- std::vector<std::string> options{};
1483
+ const std::vector<std::string> *options{};
1429
1484
  void encode(ProtoWriteBuffer buffer) const override;
1430
- void calculate_size(uint32_t &total_size) const override;
1485
+ void calculate_size(ProtoSize &size) const override;
1431
1486
  #ifdef HAS_PROTO_MESSAGE_DUMP
1432
1487
  void dump_to(std::string &out) const override;
1433
1488
  #endif
@@ -1441,10 +1496,11 @@ class SelectStateResponse : public StateResponseProtoMessage {
1441
1496
  #ifdef HAS_PROTO_MESSAGE_DUMP
1442
1497
  const char *message_name() const override { return "select_state_response"; }
1443
1498
  #endif
1444
- std::string state{};
1499
+ StringRef state_ref_{};
1500
+ void set_state(const StringRef &ref) { this->state_ref_ = ref; }
1445
1501
  bool missing_state{false};
1446
1502
  void encode(ProtoWriteBuffer buffer) const override;
1447
- void calculate_size(uint32_t &total_size) const override;
1503
+ void calculate_size(ProtoSize &size) const override;
1448
1504
  #ifdef HAS_PROTO_MESSAGE_DUMP
1449
1505
  void dump_to(std::string &out) const override;
1450
1506
  #endif
@@ -1473,7 +1529,7 @@ class SelectCommandRequest : public CommandProtoMessage {
1473
1529
  class ListEntitiesSirenResponse : public InfoResponseProtoMessage {
1474
1530
  public:
1475
1531
  static constexpr uint8_t MESSAGE_TYPE = 55;
1476
- static constexpr uint8_t ESTIMATED_SIZE = 71;
1532
+ static constexpr uint8_t ESTIMATED_SIZE = 62;
1477
1533
  #ifdef HAS_PROTO_MESSAGE_DUMP
1478
1534
  const char *message_name() const override { return "list_entities_siren_response"; }
1479
1535
  #endif
@@ -1481,7 +1537,7 @@ class ListEntitiesSirenResponse : public InfoResponseProtoMessage {
1481
1537
  bool supports_duration{false};
1482
1538
  bool supports_volume{false};
1483
1539
  void encode(ProtoWriteBuffer buffer) const override;
1484
- void calculate_size(uint32_t &total_size) const override;
1540
+ void calculate_size(ProtoSize &size) const override;
1485
1541
  #ifdef HAS_PROTO_MESSAGE_DUMP
1486
1542
  void dump_to(std::string &out) const override;
1487
1543
  #endif
@@ -1497,7 +1553,7 @@ class SirenStateResponse : public StateResponseProtoMessage {
1497
1553
  #endif
1498
1554
  bool state{false};
1499
1555
  void encode(ProtoWriteBuffer buffer) const override;
1500
- void calculate_size(uint32_t &total_size) const override;
1556
+ void calculate_size(ProtoSize &size) const override;
1501
1557
  #ifdef HAS_PROTO_MESSAGE_DUMP
1502
1558
  void dump_to(std::string &out) const override;
1503
1559
  #endif
@@ -1533,16 +1589,17 @@ class SirenCommandRequest : public CommandProtoMessage {
1533
1589
  class ListEntitiesLockResponse : public InfoResponseProtoMessage {
1534
1590
  public:
1535
1591
  static constexpr uint8_t MESSAGE_TYPE = 58;
1536
- static constexpr uint8_t ESTIMATED_SIZE = 64;
1592
+ static constexpr uint8_t ESTIMATED_SIZE = 55;
1537
1593
  #ifdef HAS_PROTO_MESSAGE_DUMP
1538
1594
  const char *message_name() const override { return "list_entities_lock_response"; }
1539
1595
  #endif
1540
1596
  bool assumed_state{false};
1541
1597
  bool supports_open{false};
1542
1598
  bool requires_code{false};
1543
- std::string code_format{};
1599
+ StringRef code_format_ref_{};
1600
+ void set_code_format(const StringRef &ref) { this->code_format_ref_ = ref; }
1544
1601
  void encode(ProtoWriteBuffer buffer) const override;
1545
- void calculate_size(uint32_t &total_size) const override;
1602
+ void calculate_size(ProtoSize &size) const override;
1546
1603
  #ifdef HAS_PROTO_MESSAGE_DUMP
1547
1604
  void dump_to(std::string &out) const override;
1548
1605
  #endif
@@ -1558,7 +1615,7 @@ class LockStateResponse : public StateResponseProtoMessage {
1558
1615
  #endif
1559
1616
  enums::LockState state{};
1560
1617
  void encode(ProtoWriteBuffer buffer) const override;
1561
- void calculate_size(uint32_t &total_size) const override;
1618
+ void calculate_size(ProtoSize &size) const override;
1562
1619
  #ifdef HAS_PROTO_MESSAGE_DUMP
1563
1620
  void dump_to(std::string &out) const override;
1564
1621
  #endif
@@ -1589,13 +1646,14 @@ class LockCommandRequest : public CommandProtoMessage {
1589
1646
  class ListEntitiesButtonResponse : public InfoResponseProtoMessage {
1590
1647
  public:
1591
1648
  static constexpr uint8_t MESSAGE_TYPE = 61;
1592
- static constexpr uint8_t ESTIMATED_SIZE = 58;
1649
+ static constexpr uint8_t ESTIMATED_SIZE = 49;
1593
1650
  #ifdef HAS_PROTO_MESSAGE_DUMP
1594
1651
  const char *message_name() const override { return "list_entities_button_response"; }
1595
1652
  #endif
1596
- std::string device_class{};
1653
+ StringRef device_class_ref_{};
1654
+ void set_device_class(const StringRef &ref) { this->device_class_ref_ = ref; }
1597
1655
  void encode(ProtoWriteBuffer buffer) const override;
1598
- void calculate_size(uint32_t &total_size) const override;
1656
+ void calculate_size(ProtoSize &size) const override;
1599
1657
  #ifdef HAS_PROTO_MESSAGE_DUMP
1600
1658
  void dump_to(std::string &out) const override;
1601
1659
  #endif
@@ -1621,32 +1679,32 @@ class ButtonCommandRequest : public CommandProtoMessage {
1621
1679
  #ifdef USE_MEDIA_PLAYER
1622
1680
  class MediaPlayerSupportedFormat : public ProtoMessage {
1623
1681
  public:
1624
- std::string format{};
1682
+ StringRef format_ref_{};
1683
+ void set_format(const StringRef &ref) { this->format_ref_ = ref; }
1625
1684
  uint32_t sample_rate{0};
1626
1685
  uint32_t num_channels{0};
1627
1686
  enums::MediaPlayerFormatPurpose purpose{};
1628
1687
  uint32_t sample_bytes{0};
1629
1688
  void encode(ProtoWriteBuffer buffer) const override;
1630
- void calculate_size(uint32_t &total_size) const override;
1689
+ void calculate_size(ProtoSize &size) const override;
1631
1690
  #ifdef HAS_PROTO_MESSAGE_DUMP
1632
1691
  void dump_to(std::string &out) const override;
1633
1692
  #endif
1634
1693
 
1635
1694
  protected:
1636
- bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override;
1637
- bool decode_varint(uint32_t field_id, ProtoVarInt value) override;
1638
1695
  };
1639
1696
  class ListEntitiesMediaPlayerResponse : public InfoResponseProtoMessage {
1640
1697
  public:
1641
1698
  static constexpr uint8_t MESSAGE_TYPE = 63;
1642
- static constexpr uint8_t ESTIMATED_SIZE = 85;
1699
+ static constexpr uint8_t ESTIMATED_SIZE = 80;
1643
1700
  #ifdef HAS_PROTO_MESSAGE_DUMP
1644
1701
  const char *message_name() const override { return "list_entities_media_player_response"; }
1645
1702
  #endif
1646
1703
  bool supports_pause{false};
1647
1704
  std::vector<MediaPlayerSupportedFormat> supported_formats{};
1705
+ uint32_t feature_flags{0};
1648
1706
  void encode(ProtoWriteBuffer buffer) const override;
1649
- void calculate_size(uint32_t &total_size) const override;
1707
+ void calculate_size(ProtoSize &size) const override;
1650
1708
  #ifdef HAS_PROTO_MESSAGE_DUMP
1651
1709
  void dump_to(std::string &out) const override;
1652
1710
  #endif
@@ -1664,7 +1722,7 @@ class MediaPlayerStateResponse : public StateResponseProtoMessage {
1664
1722
  float volume{0.0f};
1665
1723
  bool muted{false};
1666
1724
  void encode(ProtoWriteBuffer buffer) const override;
1667
- void calculate_size(uint32_t &total_size) const override;
1725
+ void calculate_size(ProtoSize &size) const override;
1668
1726
  #ifdef HAS_PROTO_MESSAGE_DUMP
1669
1727
  void dump_to(std::string &out) const override;
1670
1728
  #endif
@@ -1697,7 +1755,7 @@ class MediaPlayerCommandRequest : public CommandProtoMessage {
1697
1755
  };
1698
1756
  #endif
1699
1757
  #ifdef USE_BLUETOOTH_PROXY
1700
- class SubscribeBluetoothLEAdvertisementsRequest : public ProtoMessage {
1758
+ class SubscribeBluetoothLEAdvertisementsRequest : public ProtoDecodableMessage {
1701
1759
  public:
1702
1760
  static constexpr uint8_t MESSAGE_TYPE = 66;
1703
1761
  static constexpr uint8_t ESTIMATED_SIZE = 4;
@@ -1712,76 +1770,39 @@ class SubscribeBluetoothLEAdvertisementsRequest : public ProtoMessage {
1712
1770
  protected:
1713
1771
  bool decode_varint(uint32_t field_id, ProtoVarInt value) override;
1714
1772
  };
1715
- class BluetoothServiceData : public ProtoMessage {
1716
- public:
1717
- std::string uuid{};
1718
- std::vector<uint32_t> legacy_data{};
1719
- std::string data{};
1720
- void encode(ProtoWriteBuffer buffer) const override;
1721
- void calculate_size(uint32_t &total_size) const override;
1722
- #ifdef HAS_PROTO_MESSAGE_DUMP
1723
- void dump_to(std::string &out) const override;
1724
- #endif
1725
-
1726
- protected:
1727
- bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override;
1728
- bool decode_varint(uint32_t field_id, ProtoVarInt value) override;
1729
- };
1730
- class BluetoothLEAdvertisementResponse : public ProtoMessage {
1731
- public:
1732
- static constexpr uint8_t MESSAGE_TYPE = 67;
1733
- static constexpr uint8_t ESTIMATED_SIZE = 107;
1734
- #ifdef HAS_PROTO_MESSAGE_DUMP
1735
- const char *message_name() const override { return "bluetooth_le_advertisement_response"; }
1736
- #endif
1737
- uint64_t address{0};
1738
- std::string name{};
1739
- int32_t rssi{0};
1740
- std::vector<std::string> service_uuids{};
1741
- std::vector<BluetoothServiceData> service_data{};
1742
- std::vector<BluetoothServiceData> manufacturer_data{};
1743
- uint32_t address_type{0};
1744
- void encode(ProtoWriteBuffer buffer) const override;
1745
- void calculate_size(uint32_t &total_size) const override;
1746
- #ifdef HAS_PROTO_MESSAGE_DUMP
1747
- void dump_to(std::string &out) const override;
1748
- #endif
1749
-
1750
- protected:
1751
- };
1752
1773
  class BluetoothLERawAdvertisement : public ProtoMessage {
1753
1774
  public:
1754
1775
  uint64_t address{0};
1755
1776
  int32_t rssi{0};
1756
1777
  uint32_t address_type{0};
1757
- std::string data{};
1778
+ uint8_t data[62]{};
1779
+ uint8_t data_len{0};
1758
1780
  void encode(ProtoWriteBuffer buffer) const override;
1759
- void calculate_size(uint32_t &total_size) const override;
1781
+ void calculate_size(ProtoSize &size) const override;
1760
1782
  #ifdef HAS_PROTO_MESSAGE_DUMP
1761
1783
  void dump_to(std::string &out) const override;
1762
1784
  #endif
1763
1785
 
1764
1786
  protected:
1765
- bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override;
1766
- bool decode_varint(uint32_t field_id, ProtoVarInt value) override;
1767
1787
  };
1768
1788
  class BluetoothLERawAdvertisementsResponse : public ProtoMessage {
1769
1789
  public:
1770
1790
  static constexpr uint8_t MESSAGE_TYPE = 93;
1771
- static constexpr uint8_t ESTIMATED_SIZE = 34;
1791
+ static constexpr uint8_t ESTIMATED_SIZE = 136;
1772
1792
  #ifdef HAS_PROTO_MESSAGE_DUMP
1773
1793
  const char *message_name() const override { return "bluetooth_le_raw_advertisements_response"; }
1774
1794
  #endif
1775
- std::vector<BluetoothLERawAdvertisement> advertisements{};
1795
+ std::array<BluetoothLERawAdvertisement, BLUETOOTH_PROXY_ADVERTISEMENT_BATCH_SIZE> advertisements{};
1796
+ uint16_t advertisements_len{0};
1776
1797
  void encode(ProtoWriteBuffer buffer) const override;
1777
- void calculate_size(uint32_t &total_size) const override;
1798
+ void calculate_size(ProtoSize &size) const override;
1778
1799
  #ifdef HAS_PROTO_MESSAGE_DUMP
1779
1800
  void dump_to(std::string &out) const override;
1780
1801
  #endif
1781
1802
 
1782
1803
  protected:
1783
1804
  };
1784
- class BluetoothDeviceRequest : public ProtoMessage {
1805
+ class BluetoothDeviceRequest : public ProtoDecodableMessage {
1785
1806
  public:
1786
1807
  static constexpr uint8_t MESSAGE_TYPE = 68;
1787
1808
  static constexpr uint8_t ESTIMATED_SIZE = 12;
@@ -1811,14 +1832,14 @@ class BluetoothDeviceConnectionResponse : public ProtoMessage {
1811
1832
  uint32_t mtu{0};
1812
1833
  int32_t error{0};
1813
1834
  void encode(ProtoWriteBuffer buffer) const override;
1814
- void calculate_size(uint32_t &total_size) const override;
1835
+ void calculate_size(ProtoSize &size) const override;
1815
1836
  #ifdef HAS_PROTO_MESSAGE_DUMP
1816
1837
  void dump_to(std::string &out) const override;
1817
1838
  #endif
1818
1839
 
1819
1840
  protected:
1820
1841
  };
1821
- class BluetoothGATTGetServicesRequest : public ProtoMessage {
1842
+ class BluetoothGATTGetServicesRequest : public ProtoDecodableMessage {
1822
1843
  public:
1823
1844
  static constexpr uint8_t MESSAGE_TYPE = 70;
1824
1845
  static constexpr uint8_t ESTIMATED_SIZE = 4;
@@ -1835,47 +1856,45 @@ class BluetoothGATTGetServicesRequest : public ProtoMessage {
1835
1856
  };
1836
1857
  class BluetoothGATTDescriptor : public ProtoMessage {
1837
1858
  public:
1838
- std::vector<uint64_t> uuid{};
1859
+ std::array<uint64_t, 2> uuid{};
1839
1860
  uint32_t handle{0};
1861
+ uint32_t short_uuid{0};
1840
1862
  void encode(ProtoWriteBuffer buffer) const override;
1841
- void calculate_size(uint32_t &total_size) const override;
1863
+ void calculate_size(ProtoSize &size) const override;
1842
1864
  #ifdef HAS_PROTO_MESSAGE_DUMP
1843
1865
  void dump_to(std::string &out) const override;
1844
1866
  #endif
1845
1867
 
1846
1868
  protected:
1847
- bool decode_varint(uint32_t field_id, ProtoVarInt value) override;
1848
1869
  };
1849
1870
  class BluetoothGATTCharacteristic : public ProtoMessage {
1850
1871
  public:
1851
- std::vector<uint64_t> uuid{};
1872
+ std::array<uint64_t, 2> uuid{};
1852
1873
  uint32_t handle{0};
1853
1874
  uint32_t properties{0};
1854
1875
  std::vector<BluetoothGATTDescriptor> descriptors{};
1876
+ uint32_t short_uuid{0};
1855
1877
  void encode(ProtoWriteBuffer buffer) const override;
1856
- void calculate_size(uint32_t &total_size) const override;
1878
+ void calculate_size(ProtoSize &size) const override;
1857
1879
  #ifdef HAS_PROTO_MESSAGE_DUMP
1858
1880
  void dump_to(std::string &out) const override;
1859
1881
  #endif
1860
1882
 
1861
1883
  protected:
1862
- bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override;
1863
- bool decode_varint(uint32_t field_id, ProtoVarInt value) override;
1864
1884
  };
1865
1885
  class BluetoothGATTService : public ProtoMessage {
1866
1886
  public:
1867
- std::vector<uint64_t> uuid{};
1887
+ std::array<uint64_t, 2> uuid{};
1868
1888
  uint32_t handle{0};
1869
1889
  std::vector<BluetoothGATTCharacteristic> characteristics{};
1890
+ uint32_t short_uuid{0};
1870
1891
  void encode(ProtoWriteBuffer buffer) const override;
1871
- void calculate_size(uint32_t &total_size) const override;
1892
+ void calculate_size(ProtoSize &size) const override;
1872
1893
  #ifdef HAS_PROTO_MESSAGE_DUMP
1873
1894
  void dump_to(std::string &out) const override;
1874
1895
  #endif
1875
1896
 
1876
1897
  protected:
1877
- bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override;
1878
- bool decode_varint(uint32_t field_id, ProtoVarInt value) override;
1879
1898
  };
1880
1899
  class BluetoothGATTGetServicesResponse : public ProtoMessage {
1881
1900
  public:
@@ -1887,7 +1906,7 @@ class BluetoothGATTGetServicesResponse : public ProtoMessage {
1887
1906
  uint64_t address{0};
1888
1907
  std::vector<BluetoothGATTService> services{};
1889
1908
  void encode(ProtoWriteBuffer buffer) const override;
1890
- void calculate_size(uint32_t &total_size) const override;
1909
+ void calculate_size(ProtoSize &size) const override;
1891
1910
  #ifdef HAS_PROTO_MESSAGE_DUMP
1892
1911
  void dump_to(std::string &out) const override;
1893
1912
  #endif
@@ -1903,14 +1922,14 @@ class BluetoothGATTGetServicesDoneResponse : public ProtoMessage {
1903
1922
  #endif
1904
1923
  uint64_t address{0};
1905
1924
  void encode(ProtoWriteBuffer buffer) const override;
1906
- void calculate_size(uint32_t &total_size) const override;
1925
+ void calculate_size(ProtoSize &size) const override;
1907
1926
  #ifdef HAS_PROTO_MESSAGE_DUMP
1908
1927
  void dump_to(std::string &out) const override;
1909
1928
  #endif
1910
1929
 
1911
1930
  protected:
1912
1931
  };
1913
- class BluetoothGATTReadRequest : public ProtoMessage {
1932
+ class BluetoothGATTReadRequest : public ProtoDecodableMessage {
1914
1933
  public:
1915
1934
  static constexpr uint8_t MESSAGE_TYPE = 73;
1916
1935
  static constexpr uint8_t ESTIMATED_SIZE = 8;
@@ -1935,16 +1954,21 @@ class BluetoothGATTReadResponse : public ProtoMessage {
1935
1954
  #endif
1936
1955
  uint64_t address{0};
1937
1956
  uint32_t handle{0};
1938
- std::string data{};
1957
+ const uint8_t *data_ptr_{nullptr};
1958
+ size_t data_len_{0};
1959
+ void set_data(const uint8_t *data, size_t len) {
1960
+ this->data_ptr_ = data;
1961
+ this->data_len_ = len;
1962
+ }
1939
1963
  void encode(ProtoWriteBuffer buffer) const override;
1940
- void calculate_size(uint32_t &total_size) const override;
1964
+ void calculate_size(ProtoSize &size) const override;
1941
1965
  #ifdef HAS_PROTO_MESSAGE_DUMP
1942
1966
  void dump_to(std::string &out) const override;
1943
1967
  #endif
1944
1968
 
1945
1969
  protected:
1946
1970
  };
1947
- class BluetoothGATTWriteRequest : public ProtoMessage {
1971
+ class BluetoothGATTWriteRequest : public ProtoDecodableMessage {
1948
1972
  public:
1949
1973
  static constexpr uint8_t MESSAGE_TYPE = 75;
1950
1974
  static constexpr uint8_t ESTIMATED_SIZE = 19;
@@ -1963,7 +1987,7 @@ class BluetoothGATTWriteRequest : public ProtoMessage {
1963
1987
  bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override;
1964
1988
  bool decode_varint(uint32_t field_id, ProtoVarInt value) override;
1965
1989
  };
1966
- class BluetoothGATTReadDescriptorRequest : public ProtoMessage {
1990
+ class BluetoothGATTReadDescriptorRequest : public ProtoDecodableMessage {
1967
1991
  public:
1968
1992
  static constexpr uint8_t MESSAGE_TYPE = 76;
1969
1993
  static constexpr uint8_t ESTIMATED_SIZE = 8;
@@ -1979,7 +2003,7 @@ class BluetoothGATTReadDescriptorRequest : public ProtoMessage {
1979
2003
  protected:
1980
2004
  bool decode_varint(uint32_t field_id, ProtoVarInt value) override;
1981
2005
  };
1982
- class BluetoothGATTWriteDescriptorRequest : public ProtoMessage {
2006
+ class BluetoothGATTWriteDescriptorRequest : public ProtoDecodableMessage {
1983
2007
  public:
1984
2008
  static constexpr uint8_t MESSAGE_TYPE = 77;
1985
2009
  static constexpr uint8_t ESTIMATED_SIZE = 17;
@@ -1997,7 +2021,7 @@ class BluetoothGATTWriteDescriptorRequest : public ProtoMessage {
1997
2021
  bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override;
1998
2022
  bool decode_varint(uint32_t field_id, ProtoVarInt value) override;
1999
2023
  };
2000
- class BluetoothGATTNotifyRequest : public ProtoMessage {
2024
+ class BluetoothGATTNotifyRequest : public ProtoDecodableMessage {
2001
2025
  public:
2002
2026
  static constexpr uint8_t MESSAGE_TYPE = 78;
2003
2027
  static constexpr uint8_t ESTIMATED_SIZE = 10;
@@ -2023,9 +2047,14 @@ class BluetoothGATTNotifyDataResponse : public ProtoMessage {
2023
2047
  #endif
2024
2048
  uint64_t address{0};
2025
2049
  uint32_t handle{0};
2026
- std::string data{};
2050
+ const uint8_t *data_ptr_{nullptr};
2051
+ size_t data_len_{0};
2052
+ void set_data(const uint8_t *data, size_t len) {
2053
+ this->data_ptr_ = data;
2054
+ this->data_len_ = len;
2055
+ }
2027
2056
  void encode(ProtoWriteBuffer buffer) const override;
2028
- void calculate_size(uint32_t &total_size) const override;
2057
+ void calculate_size(ProtoSize &size) const override;
2029
2058
  #ifdef HAS_PROTO_MESSAGE_DUMP
2030
2059
  void dump_to(std::string &out) const override;
2031
2060
  #endif
@@ -2048,15 +2077,15 @@ class SubscribeBluetoothConnectionsFreeRequest : public ProtoMessage {
2048
2077
  class BluetoothConnectionsFreeResponse : public ProtoMessage {
2049
2078
  public:
2050
2079
  static constexpr uint8_t MESSAGE_TYPE = 81;
2051
- static constexpr uint8_t ESTIMATED_SIZE = 16;
2080
+ static constexpr uint8_t ESTIMATED_SIZE = 20;
2052
2081
  #ifdef HAS_PROTO_MESSAGE_DUMP
2053
2082
  const char *message_name() const override { return "bluetooth_connections_free_response"; }
2054
2083
  #endif
2055
2084
  uint32_t free{0};
2056
2085
  uint32_t limit{0};
2057
- std::vector<uint64_t> allocated{};
2086
+ std::array<uint64_t, BLUETOOTH_PROXY_MAX_CONNECTIONS> allocated{};
2058
2087
  void encode(ProtoWriteBuffer buffer) const override;
2059
- void calculate_size(uint32_t &total_size) const override;
2088
+ void calculate_size(ProtoSize &size) const override;
2060
2089
  #ifdef HAS_PROTO_MESSAGE_DUMP
2061
2090
  void dump_to(std::string &out) const override;
2062
2091
  #endif
@@ -2074,7 +2103,7 @@ class BluetoothGATTErrorResponse : public ProtoMessage {
2074
2103
  uint32_t handle{0};
2075
2104
  int32_t error{0};
2076
2105
  void encode(ProtoWriteBuffer buffer) const override;
2077
- void calculate_size(uint32_t &total_size) const override;
2106
+ void calculate_size(ProtoSize &size) const override;
2078
2107
  #ifdef HAS_PROTO_MESSAGE_DUMP
2079
2108
  void dump_to(std::string &out) const override;
2080
2109
  #endif
@@ -2091,7 +2120,7 @@ class BluetoothGATTWriteResponse : public ProtoMessage {
2091
2120
  uint64_t address{0};
2092
2121
  uint32_t handle{0};
2093
2122
  void encode(ProtoWriteBuffer buffer) const override;
2094
- void calculate_size(uint32_t &total_size) const override;
2123
+ void calculate_size(ProtoSize &size) const override;
2095
2124
  #ifdef HAS_PROTO_MESSAGE_DUMP
2096
2125
  void dump_to(std::string &out) const override;
2097
2126
  #endif
@@ -2108,7 +2137,7 @@ class BluetoothGATTNotifyResponse : public ProtoMessage {
2108
2137
  uint64_t address{0};
2109
2138
  uint32_t handle{0};
2110
2139
  void encode(ProtoWriteBuffer buffer) const override;
2111
- void calculate_size(uint32_t &total_size) const override;
2140
+ void calculate_size(ProtoSize &size) const override;
2112
2141
  #ifdef HAS_PROTO_MESSAGE_DUMP
2113
2142
  void dump_to(std::string &out) const override;
2114
2143
  #endif
@@ -2126,7 +2155,7 @@ class BluetoothDevicePairingResponse : public ProtoMessage {
2126
2155
  bool paired{false};
2127
2156
  int32_t error{0};
2128
2157
  void encode(ProtoWriteBuffer buffer) const override;
2129
- void calculate_size(uint32_t &total_size) const override;
2158
+ void calculate_size(ProtoSize &size) const override;
2130
2159
  #ifdef HAS_PROTO_MESSAGE_DUMP
2131
2160
  void dump_to(std::string &out) const override;
2132
2161
  #endif
@@ -2144,7 +2173,7 @@ class BluetoothDeviceUnpairingResponse : public ProtoMessage {
2144
2173
  bool success{false};
2145
2174
  int32_t error{0};
2146
2175
  void encode(ProtoWriteBuffer buffer) const override;
2147
- void calculate_size(uint32_t &total_size) const override;
2176
+ void calculate_size(ProtoSize &size) const override;
2148
2177
  #ifdef HAS_PROTO_MESSAGE_DUMP
2149
2178
  void dump_to(std::string &out) const override;
2150
2179
  #endif
@@ -2175,7 +2204,7 @@ class BluetoothDeviceClearCacheResponse : public ProtoMessage {
2175
2204
  bool success{false};
2176
2205
  int32_t error{0};
2177
2206
  void encode(ProtoWriteBuffer buffer) const override;
2178
- void calculate_size(uint32_t &total_size) const override;
2207
+ void calculate_size(ProtoSize &size) const override;
2179
2208
  #ifdef HAS_PROTO_MESSAGE_DUMP
2180
2209
  void dump_to(std::string &out) const override;
2181
2210
  #endif
@@ -2192,14 +2221,14 @@ class BluetoothScannerStateResponse : public ProtoMessage {
2192
2221
  enums::BluetoothScannerState state{};
2193
2222
  enums::BluetoothScannerMode mode{};
2194
2223
  void encode(ProtoWriteBuffer buffer) const override;
2195
- void calculate_size(uint32_t &total_size) const override;
2224
+ void calculate_size(ProtoSize &size) const override;
2196
2225
  #ifdef HAS_PROTO_MESSAGE_DUMP
2197
2226
  void dump_to(std::string &out) const override;
2198
2227
  #endif
2199
2228
 
2200
2229
  protected:
2201
2230
  };
2202
- class BluetoothScannerSetModeRequest : public ProtoMessage {
2231
+ class BluetoothScannerSetModeRequest : public ProtoDecodableMessage {
2203
2232
  public:
2204
2233
  static constexpr uint8_t MESSAGE_TYPE = 127;
2205
2234
  static constexpr uint8_t ESTIMATED_SIZE = 2;
@@ -2216,7 +2245,7 @@ class BluetoothScannerSetModeRequest : public ProtoMessage {
2216
2245
  };
2217
2246
  #endif
2218
2247
  #ifdef USE_VOICE_ASSISTANT
2219
- class SubscribeVoiceAssistantRequest : public ProtoMessage {
2248
+ class SubscribeVoiceAssistantRequest : public ProtoDecodableMessage {
2220
2249
  public:
2221
2250
  static constexpr uint8_t MESSAGE_TYPE = 89;
2222
2251
  static constexpr uint8_t ESTIMATED_SIZE = 6;
@@ -2238,14 +2267,12 @@ class VoiceAssistantAudioSettings : public ProtoMessage {
2238
2267
  uint32_t auto_gain{0};
2239
2268
  float volume_multiplier{0.0f};
2240
2269
  void encode(ProtoWriteBuffer buffer) const override;
2241
- void calculate_size(uint32_t &total_size) const override;
2270
+ void calculate_size(ProtoSize &size) const override;
2242
2271
  #ifdef HAS_PROTO_MESSAGE_DUMP
2243
2272
  void dump_to(std::string &out) const override;
2244
2273
  #endif
2245
2274
 
2246
2275
  protected:
2247
- bool decode_32bit(uint32_t field_id, Proto32Bit value) override;
2248
- bool decode_varint(uint32_t field_id, ProtoVarInt value) override;
2249
2276
  };
2250
2277
  class VoiceAssistantRequest : public ProtoMessage {
2251
2278
  public:
@@ -2255,19 +2282,21 @@ class VoiceAssistantRequest : public ProtoMessage {
2255
2282
  const char *message_name() const override { return "voice_assistant_request"; }
2256
2283
  #endif
2257
2284
  bool start{false};
2258
- std::string conversation_id{};
2285
+ StringRef conversation_id_ref_{};
2286
+ void set_conversation_id(const StringRef &ref) { this->conversation_id_ref_ = ref; }
2259
2287
  uint32_t flags{0};
2260
2288
  VoiceAssistantAudioSettings audio_settings{};
2261
- std::string wake_word_phrase{};
2289
+ StringRef wake_word_phrase_ref_{};
2290
+ void set_wake_word_phrase(const StringRef &ref) { this->wake_word_phrase_ref_ = ref; }
2262
2291
  void encode(ProtoWriteBuffer buffer) const override;
2263
- void calculate_size(uint32_t &total_size) const override;
2292
+ void calculate_size(ProtoSize &size) const override;
2264
2293
  #ifdef HAS_PROTO_MESSAGE_DUMP
2265
2294
  void dump_to(std::string &out) const override;
2266
2295
  #endif
2267
2296
 
2268
2297
  protected:
2269
2298
  };
2270
- class VoiceAssistantResponse : public ProtoMessage {
2299
+ class VoiceAssistantResponse : public ProtoDecodableMessage {
2271
2300
  public:
2272
2301
  static constexpr uint8_t MESSAGE_TYPE = 91;
2273
2302
  static constexpr uint8_t ESTIMATED_SIZE = 6;
@@ -2283,12 +2312,10 @@ class VoiceAssistantResponse : public ProtoMessage {
2283
2312
  protected:
2284
2313
  bool decode_varint(uint32_t field_id, ProtoVarInt value) override;
2285
2314
  };
2286
- class VoiceAssistantEventData : public ProtoMessage {
2315
+ class VoiceAssistantEventData : public ProtoDecodableMessage {
2287
2316
  public:
2288
2317
  std::string name{};
2289
2318
  std::string value{};
2290
- void encode(ProtoWriteBuffer buffer) const override;
2291
- void calculate_size(uint32_t &total_size) const override;
2292
2319
  #ifdef HAS_PROTO_MESSAGE_DUMP
2293
2320
  void dump_to(std::string &out) const override;
2294
2321
  #endif
@@ -2296,7 +2323,7 @@ class VoiceAssistantEventData : public ProtoMessage {
2296
2323
  protected:
2297
2324
  bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override;
2298
2325
  };
2299
- class VoiceAssistantEventResponse : public ProtoMessage {
2326
+ class VoiceAssistantEventResponse : public ProtoDecodableMessage {
2300
2327
  public:
2301
2328
  static constexpr uint8_t MESSAGE_TYPE = 92;
2302
2329
  static constexpr uint8_t ESTIMATED_SIZE = 36;
@@ -2313,7 +2340,7 @@ class VoiceAssistantEventResponse : public ProtoMessage {
2313
2340
  bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override;
2314
2341
  bool decode_varint(uint32_t field_id, ProtoVarInt value) override;
2315
2342
  };
2316
- class VoiceAssistantAudio : public ProtoMessage {
2343
+ class VoiceAssistantAudio : public ProtoDecodableMessage {
2317
2344
  public:
2318
2345
  static constexpr uint8_t MESSAGE_TYPE = 106;
2319
2346
  static constexpr uint8_t ESTIMATED_SIZE = 11;
@@ -2321,9 +2348,15 @@ class VoiceAssistantAudio : public ProtoMessage {
2321
2348
  const char *message_name() const override { return "voice_assistant_audio"; }
2322
2349
  #endif
2323
2350
  std::string data{};
2351
+ const uint8_t *data_ptr_{nullptr};
2352
+ size_t data_len_{0};
2353
+ void set_data(const uint8_t *data, size_t len) {
2354
+ this->data_ptr_ = data;
2355
+ this->data_len_ = len;
2356
+ }
2324
2357
  bool end{false};
2325
2358
  void encode(ProtoWriteBuffer buffer) const override;
2326
- void calculate_size(uint32_t &total_size) const override;
2359
+ void calculate_size(ProtoSize &size) const override;
2327
2360
  #ifdef HAS_PROTO_MESSAGE_DUMP
2328
2361
  void dump_to(std::string &out) const override;
2329
2362
  #endif
@@ -2332,7 +2365,7 @@ class VoiceAssistantAudio : public ProtoMessage {
2332
2365
  bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override;
2333
2366
  bool decode_varint(uint32_t field_id, ProtoVarInt value) override;
2334
2367
  };
2335
- class VoiceAssistantTimerEventResponse : public ProtoMessage {
2368
+ class VoiceAssistantTimerEventResponse : public ProtoDecodableMessage {
2336
2369
  public:
2337
2370
  static constexpr uint8_t MESSAGE_TYPE = 115;
2338
2371
  static constexpr uint8_t ESTIMATED_SIZE = 30;
@@ -2353,7 +2386,7 @@ class VoiceAssistantTimerEventResponse : public ProtoMessage {
2353
2386
  bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override;
2354
2387
  bool decode_varint(uint32_t field_id, ProtoVarInt value) override;
2355
2388
  };
2356
- class VoiceAssistantAnnounceRequest : public ProtoMessage {
2389
+ class VoiceAssistantAnnounceRequest : public ProtoDecodableMessage {
2357
2390
  public:
2358
2391
  static constexpr uint8_t MESSAGE_TYPE = 119;
2359
2392
  static constexpr uint8_t ESTIMATED_SIZE = 29;
@@ -2381,7 +2414,7 @@ class VoiceAssistantAnnounceFinished : public ProtoMessage {
2381
2414
  #endif
2382
2415
  bool success{false};
2383
2416
  void encode(ProtoWriteBuffer buffer) const override;
2384
- void calculate_size(uint32_t &total_size) const override;
2417
+ void calculate_size(ProtoSize &size) const override;
2385
2418
  #ifdef HAS_PROTO_MESSAGE_DUMP
2386
2419
  void dump_to(std::string &out) const override;
2387
2420
  #endif
@@ -2390,17 +2423,18 @@ class VoiceAssistantAnnounceFinished : public ProtoMessage {
2390
2423
  };
2391
2424
  class VoiceAssistantWakeWord : public ProtoMessage {
2392
2425
  public:
2393
- std::string id{};
2394
- std::string wake_word{};
2426
+ StringRef id_ref_{};
2427
+ void set_id(const StringRef &ref) { this->id_ref_ = ref; }
2428
+ StringRef wake_word_ref_{};
2429
+ void set_wake_word(const StringRef &ref) { this->wake_word_ref_ = ref; }
2395
2430
  std::vector<std::string> trained_languages{};
2396
2431
  void encode(ProtoWriteBuffer buffer) const override;
2397
- void calculate_size(uint32_t &total_size) const override;
2432
+ void calculate_size(ProtoSize &size) const override;
2398
2433
  #ifdef HAS_PROTO_MESSAGE_DUMP
2399
2434
  void dump_to(std::string &out) const override;
2400
2435
  #endif
2401
2436
 
2402
2437
  protected:
2403
- bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override;
2404
2438
  };
2405
2439
  class VoiceAssistantConfigurationRequest : public ProtoMessage {
2406
2440
  public:
@@ -2423,17 +2457,17 @@ class VoiceAssistantConfigurationResponse : public ProtoMessage {
2423
2457
  const char *message_name() const override { return "voice_assistant_configuration_response"; }
2424
2458
  #endif
2425
2459
  std::vector<VoiceAssistantWakeWord> available_wake_words{};
2426
- std::vector<std::string> active_wake_words{};
2460
+ const std::vector<std::string> *active_wake_words{};
2427
2461
  uint32_t max_active_wake_words{0};
2428
2462
  void encode(ProtoWriteBuffer buffer) const override;
2429
- void calculate_size(uint32_t &total_size) const override;
2463
+ void calculate_size(ProtoSize &size) const override;
2430
2464
  #ifdef HAS_PROTO_MESSAGE_DUMP
2431
2465
  void dump_to(std::string &out) const override;
2432
2466
  #endif
2433
2467
 
2434
2468
  protected:
2435
2469
  };
2436
- class VoiceAssistantSetConfiguration : public ProtoMessage {
2470
+ class VoiceAssistantSetConfiguration : public ProtoDecodableMessage {
2437
2471
  public:
2438
2472
  static constexpr uint8_t MESSAGE_TYPE = 123;
2439
2473
  static constexpr uint8_t ESTIMATED_SIZE = 18;
@@ -2453,7 +2487,7 @@ class VoiceAssistantSetConfiguration : public ProtoMessage {
2453
2487
  class ListEntitiesAlarmControlPanelResponse : public InfoResponseProtoMessage {
2454
2488
  public:
2455
2489
  static constexpr uint8_t MESSAGE_TYPE = 94;
2456
- static constexpr uint8_t ESTIMATED_SIZE = 57;
2490
+ static constexpr uint8_t ESTIMATED_SIZE = 48;
2457
2491
  #ifdef HAS_PROTO_MESSAGE_DUMP
2458
2492
  const char *message_name() const override { return "list_entities_alarm_control_panel_response"; }
2459
2493
  #endif
@@ -2461,7 +2495,7 @@ class ListEntitiesAlarmControlPanelResponse : public InfoResponseProtoMessage {
2461
2495
  bool requires_code{false};
2462
2496
  bool requires_code_to_arm{false};
2463
2497
  void encode(ProtoWriteBuffer buffer) const override;
2464
- void calculate_size(uint32_t &total_size) const override;
2498
+ void calculate_size(ProtoSize &size) const override;
2465
2499
  #ifdef HAS_PROTO_MESSAGE_DUMP
2466
2500
  void dump_to(std::string &out) const override;
2467
2501
  #endif
@@ -2477,7 +2511,7 @@ class AlarmControlPanelStateResponse : public StateResponseProtoMessage {
2477
2511
  #endif
2478
2512
  enums::AlarmControlPanelState state{};
2479
2513
  void encode(ProtoWriteBuffer buffer) const override;
2480
- void calculate_size(uint32_t &total_size) const override;
2514
+ void calculate_size(ProtoSize &size) const override;
2481
2515
  #ifdef HAS_PROTO_MESSAGE_DUMP
2482
2516
  void dump_to(std::string &out) const override;
2483
2517
  #endif
@@ -2507,16 +2541,17 @@ class AlarmControlPanelCommandRequest : public CommandProtoMessage {
2507
2541
  class ListEntitiesTextResponse : public InfoResponseProtoMessage {
2508
2542
  public:
2509
2543
  static constexpr uint8_t MESSAGE_TYPE = 97;
2510
- static constexpr uint8_t ESTIMATED_SIZE = 68;
2544
+ static constexpr uint8_t ESTIMATED_SIZE = 59;
2511
2545
  #ifdef HAS_PROTO_MESSAGE_DUMP
2512
2546
  const char *message_name() const override { return "list_entities_text_response"; }
2513
2547
  #endif
2514
2548
  uint32_t min_length{0};
2515
2549
  uint32_t max_length{0};
2516
- std::string pattern{};
2550
+ StringRef pattern_ref_{};
2551
+ void set_pattern(const StringRef &ref) { this->pattern_ref_ = ref; }
2517
2552
  enums::TextMode mode{};
2518
2553
  void encode(ProtoWriteBuffer buffer) const override;
2519
- void calculate_size(uint32_t &total_size) const override;
2554
+ void calculate_size(ProtoSize &size) const override;
2520
2555
  #ifdef HAS_PROTO_MESSAGE_DUMP
2521
2556
  void dump_to(std::string &out) const override;
2522
2557
  #endif
@@ -2530,10 +2565,11 @@ class TextStateResponse : public StateResponseProtoMessage {
2530
2565
  #ifdef HAS_PROTO_MESSAGE_DUMP
2531
2566
  const char *message_name() const override { return "text_state_response"; }
2532
2567
  #endif
2533
- std::string state{};
2568
+ StringRef state_ref_{};
2569
+ void set_state(const StringRef &ref) { this->state_ref_ = ref; }
2534
2570
  bool missing_state{false};
2535
2571
  void encode(ProtoWriteBuffer buffer) const override;
2536
- void calculate_size(uint32_t &total_size) const override;
2572
+ void calculate_size(ProtoSize &size) const override;
2537
2573
  #ifdef HAS_PROTO_MESSAGE_DUMP
2538
2574
  void dump_to(std::string &out) const override;
2539
2575
  #endif
@@ -2562,12 +2598,12 @@ class TextCommandRequest : public CommandProtoMessage {
2562
2598
  class ListEntitiesDateResponse : public InfoResponseProtoMessage {
2563
2599
  public:
2564
2600
  static constexpr uint8_t MESSAGE_TYPE = 100;
2565
- static constexpr uint8_t ESTIMATED_SIZE = 49;
2601
+ static constexpr uint8_t ESTIMATED_SIZE = 40;
2566
2602
  #ifdef HAS_PROTO_MESSAGE_DUMP
2567
2603
  const char *message_name() const override { return "list_entities_date_response"; }
2568
2604
  #endif
2569
2605
  void encode(ProtoWriteBuffer buffer) const override;
2570
- void calculate_size(uint32_t &total_size) const override;
2606
+ void calculate_size(ProtoSize &size) const override;
2571
2607
  #ifdef HAS_PROTO_MESSAGE_DUMP
2572
2608
  void dump_to(std::string &out) const override;
2573
2609
  #endif
@@ -2586,7 +2622,7 @@ class DateStateResponse : public StateResponseProtoMessage {
2586
2622
  uint32_t month{0};
2587
2623
  uint32_t day{0};
2588
2624
  void encode(ProtoWriteBuffer buffer) const override;
2589
- void calculate_size(uint32_t &total_size) const override;
2625
+ void calculate_size(ProtoSize &size) const override;
2590
2626
  #ifdef HAS_PROTO_MESSAGE_DUMP
2591
2627
  void dump_to(std::string &out) const override;
2592
2628
  #endif
@@ -2616,12 +2652,12 @@ class DateCommandRequest : public CommandProtoMessage {
2616
2652
  class ListEntitiesTimeResponse : public InfoResponseProtoMessage {
2617
2653
  public:
2618
2654
  static constexpr uint8_t MESSAGE_TYPE = 103;
2619
- static constexpr uint8_t ESTIMATED_SIZE = 49;
2655
+ static constexpr uint8_t ESTIMATED_SIZE = 40;
2620
2656
  #ifdef HAS_PROTO_MESSAGE_DUMP
2621
2657
  const char *message_name() const override { return "list_entities_time_response"; }
2622
2658
  #endif
2623
2659
  void encode(ProtoWriteBuffer buffer) const override;
2624
- void calculate_size(uint32_t &total_size) const override;
2660
+ void calculate_size(ProtoSize &size) const override;
2625
2661
  #ifdef HAS_PROTO_MESSAGE_DUMP
2626
2662
  void dump_to(std::string &out) const override;
2627
2663
  #endif
@@ -2640,7 +2676,7 @@ class TimeStateResponse : public StateResponseProtoMessage {
2640
2676
  uint32_t minute{0};
2641
2677
  uint32_t second{0};
2642
2678
  void encode(ProtoWriteBuffer buffer) const override;
2643
- void calculate_size(uint32_t &total_size) const override;
2679
+ void calculate_size(ProtoSize &size) const override;
2644
2680
  #ifdef HAS_PROTO_MESSAGE_DUMP
2645
2681
  void dump_to(std::string &out) const override;
2646
2682
  #endif
@@ -2670,14 +2706,15 @@ class TimeCommandRequest : public CommandProtoMessage {
2670
2706
  class ListEntitiesEventResponse : public InfoResponseProtoMessage {
2671
2707
  public:
2672
2708
  static constexpr uint8_t MESSAGE_TYPE = 107;
2673
- static constexpr uint8_t ESTIMATED_SIZE = 76;
2709
+ static constexpr uint8_t ESTIMATED_SIZE = 67;
2674
2710
  #ifdef HAS_PROTO_MESSAGE_DUMP
2675
2711
  const char *message_name() const override { return "list_entities_event_response"; }
2676
2712
  #endif
2677
- std::string device_class{};
2713
+ StringRef device_class_ref_{};
2714
+ void set_device_class(const StringRef &ref) { this->device_class_ref_ = ref; }
2678
2715
  std::vector<std::string> event_types{};
2679
2716
  void encode(ProtoWriteBuffer buffer) const override;
2680
- void calculate_size(uint32_t &total_size) const override;
2717
+ void calculate_size(ProtoSize &size) const override;
2681
2718
  #ifdef HAS_PROTO_MESSAGE_DUMP
2682
2719
  void dump_to(std::string &out) const override;
2683
2720
  #endif
@@ -2691,9 +2728,10 @@ class EventResponse : public StateResponseProtoMessage {
2691
2728
  #ifdef HAS_PROTO_MESSAGE_DUMP
2692
2729
  const char *message_name() const override { return "event_response"; }
2693
2730
  #endif
2694
- std::string event_type{};
2731
+ StringRef event_type_ref_{};
2732
+ void set_event_type(const StringRef &ref) { this->event_type_ref_ = ref; }
2695
2733
  void encode(ProtoWriteBuffer buffer) const override;
2696
- void calculate_size(uint32_t &total_size) const override;
2734
+ void calculate_size(ProtoSize &size) const override;
2697
2735
  #ifdef HAS_PROTO_MESSAGE_DUMP
2698
2736
  void dump_to(std::string &out) const override;
2699
2737
  #endif
@@ -2705,16 +2743,17 @@ class EventResponse : public StateResponseProtoMessage {
2705
2743
  class ListEntitiesValveResponse : public InfoResponseProtoMessage {
2706
2744
  public:
2707
2745
  static constexpr uint8_t MESSAGE_TYPE = 109;
2708
- static constexpr uint8_t ESTIMATED_SIZE = 64;
2746
+ static constexpr uint8_t ESTIMATED_SIZE = 55;
2709
2747
  #ifdef HAS_PROTO_MESSAGE_DUMP
2710
2748
  const char *message_name() const override { return "list_entities_valve_response"; }
2711
2749
  #endif
2712
- std::string device_class{};
2750
+ StringRef device_class_ref_{};
2751
+ void set_device_class(const StringRef &ref) { this->device_class_ref_ = ref; }
2713
2752
  bool assumed_state{false};
2714
2753
  bool supports_position{false};
2715
2754
  bool supports_stop{false};
2716
2755
  void encode(ProtoWriteBuffer buffer) const override;
2717
- void calculate_size(uint32_t &total_size) const override;
2756
+ void calculate_size(ProtoSize &size) const override;
2718
2757
  #ifdef HAS_PROTO_MESSAGE_DUMP
2719
2758
  void dump_to(std::string &out) const override;
2720
2759
  #endif
@@ -2731,7 +2770,7 @@ class ValveStateResponse : public StateResponseProtoMessage {
2731
2770
  float position{0.0f};
2732
2771
  enums::ValveOperation current_operation{};
2733
2772
  void encode(ProtoWriteBuffer buffer) const override;
2734
- void calculate_size(uint32_t &total_size) const override;
2773
+ void calculate_size(ProtoSize &size) const override;
2735
2774
  #ifdef HAS_PROTO_MESSAGE_DUMP
2736
2775
  void dump_to(std::string &out) const override;
2737
2776
  #endif
@@ -2761,12 +2800,12 @@ class ValveCommandRequest : public CommandProtoMessage {
2761
2800
  class ListEntitiesDateTimeResponse : public InfoResponseProtoMessage {
2762
2801
  public:
2763
2802
  static constexpr uint8_t MESSAGE_TYPE = 112;
2764
- static constexpr uint8_t ESTIMATED_SIZE = 49;
2803
+ static constexpr uint8_t ESTIMATED_SIZE = 40;
2765
2804
  #ifdef HAS_PROTO_MESSAGE_DUMP
2766
2805
  const char *message_name() const override { return "list_entities_date_time_response"; }
2767
2806
  #endif
2768
2807
  void encode(ProtoWriteBuffer buffer) const override;
2769
- void calculate_size(uint32_t &total_size) const override;
2808
+ void calculate_size(ProtoSize &size) const override;
2770
2809
  #ifdef HAS_PROTO_MESSAGE_DUMP
2771
2810
  void dump_to(std::string &out) const override;
2772
2811
  #endif
@@ -2783,7 +2822,7 @@ class DateTimeStateResponse : public StateResponseProtoMessage {
2783
2822
  bool missing_state{false};
2784
2823
  uint32_t epoch_seconds{0};
2785
2824
  void encode(ProtoWriteBuffer buffer) const override;
2786
- void calculate_size(uint32_t &total_size) const override;
2825
+ void calculate_size(ProtoSize &size) const override;
2787
2826
  #ifdef HAS_PROTO_MESSAGE_DUMP
2788
2827
  void dump_to(std::string &out) const override;
2789
2828
  #endif
@@ -2811,13 +2850,14 @@ class DateTimeCommandRequest : public CommandProtoMessage {
2811
2850
  class ListEntitiesUpdateResponse : public InfoResponseProtoMessage {
2812
2851
  public:
2813
2852
  static constexpr uint8_t MESSAGE_TYPE = 116;
2814
- static constexpr uint8_t ESTIMATED_SIZE = 58;
2853
+ static constexpr uint8_t ESTIMATED_SIZE = 49;
2815
2854
  #ifdef HAS_PROTO_MESSAGE_DUMP
2816
2855
  const char *message_name() const override { return "list_entities_update_response"; }
2817
2856
  #endif
2818
- std::string device_class{};
2857
+ StringRef device_class_ref_{};
2858
+ void set_device_class(const StringRef &ref) { this->device_class_ref_ = ref; }
2819
2859
  void encode(ProtoWriteBuffer buffer) const override;
2820
- void calculate_size(uint32_t &total_size) const override;
2860
+ void calculate_size(ProtoSize &size) const override;
2821
2861
  #ifdef HAS_PROTO_MESSAGE_DUMP
2822
2862
  void dump_to(std::string &out) const override;
2823
2863
  #endif
@@ -2835,13 +2875,18 @@ class UpdateStateResponse : public StateResponseProtoMessage {
2835
2875
  bool in_progress{false};
2836
2876
  bool has_progress{false};
2837
2877
  float progress{0.0f};
2838
- std::string current_version{};
2839
- std::string latest_version{};
2840
- std::string title{};
2841
- std::string release_summary{};
2842
- std::string release_url{};
2878
+ StringRef current_version_ref_{};
2879
+ void set_current_version(const StringRef &ref) { this->current_version_ref_ = ref; }
2880
+ StringRef latest_version_ref_{};
2881
+ void set_latest_version(const StringRef &ref) { this->latest_version_ref_ = ref; }
2882
+ StringRef title_ref_{};
2883
+ void set_title(const StringRef &ref) { this->title_ref_ = ref; }
2884
+ StringRef release_summary_ref_{};
2885
+ void set_release_summary(const StringRef &ref) { this->release_summary_ref_ = ref; }
2886
+ StringRef release_url_ref_{};
2887
+ void set_release_url(const StringRef &ref) { this->release_url_ref_ = ref; }
2843
2888
  void encode(ProtoWriteBuffer buffer) const override;
2844
- void calculate_size(uint32_t &total_size) const override;
2889
+ void calculate_size(ProtoSize &size) const override;
2845
2890
  #ifdef HAS_PROTO_MESSAGE_DUMP
2846
2891
  void dump_to(std::string &out) const override;
2847
2892
  #endif
@@ -2866,5 +2911,4 @@ class UpdateCommandRequest : public CommandProtoMessage {
2866
2911
  };
2867
2912
  #endif
2868
2913
 
2869
- } // namespace api
2870
- } // namespace esphome
2914
+ } // namespace esphome::api