esphome 2025.4.2__py3-none-any.whl → 2025.5.0b3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (440) hide show
  1. esphome/__main__.py +16 -14
  2. esphome/components/ac_dimmer/ac_dimmer.cpp +3 -2
  3. esphome/components/adc/__init__.py +51 -34
  4. esphome/components/airthings_wave_base/__init__.py +1 -1
  5. esphome/components/alarm_control_panel/__init__.py +37 -2
  6. esphome/components/am43/cover/__init__.py +4 -5
  7. esphome/components/analog_threshold/analog_threshold_binary_sensor.cpp +6 -4
  8. esphome/components/analog_threshold/analog_threshold_binary_sensor.h +4 -5
  9. esphome/components/analog_threshold/binary_sensor.py +10 -8
  10. esphome/components/anova/climate.py +4 -5
  11. esphome/components/api/__init__.py +25 -8
  12. esphome/components/api/api_connection.cpp +81 -13
  13. esphome/components/api/api_connection.h +13 -1
  14. esphome/components/api/api_frame_helper.cpp +232 -177
  15. esphome/components/api/api_frame_helper.h +61 -8
  16. esphome/components/api/api_noise_context.h +13 -4
  17. esphome/components/api/api_pb2.cpp +1422 -1
  18. esphome/components/api/api_pb2.h +255 -1
  19. esphome/components/api/api_pb2_service.cpp +162 -49
  20. esphome/components/api/api_pb2_service.h +90 -51
  21. esphome/components/api/api_pb2_size.h +361 -0
  22. esphome/components/api/api_server.cpp +110 -34
  23. esphome/components/api/api_server.h +8 -0
  24. esphome/components/api/proto.h +86 -17
  25. esphome/components/as7341/as7341.h +1 -1
  26. esphome/components/atm90e32/__init__.py +1 -0
  27. esphome/components/atm90e32/atm90e32.cpp +576 -199
  28. esphome/components/atm90e32/atm90e32.h +128 -31
  29. esphome/components/atm90e32/atm90e32_reg.h +4 -2
  30. esphome/components/atm90e32/button/__init__.py +62 -10
  31. esphome/components/atm90e32/button/atm90e32_button.cpp +63 -4
  32. esphome/components/atm90e32/button/atm90e32_button.h +36 -4
  33. esphome/components/atm90e32/number/__init__.py +130 -0
  34. esphome/components/atm90e32/number/atm90e32_number.h +16 -0
  35. esphome/components/atm90e32/sensor.py +21 -4
  36. esphome/components/atm90e32/text_sensor/__init__.py +48 -0
  37. esphome/components/audio/__init__.py +96 -49
  38. esphome/components/audio/audio.h +48 -0
  39. esphome/components/audio/audio_decoder.cpp +1 -1
  40. esphome/components/audio/audio_resampler.cpp +2 -0
  41. esphome/components/audio/audio_resampler.h +1 -0
  42. esphome/components/ballu/climate.py +2 -9
  43. esphome/components/bang_bang/climate.py +5 -6
  44. esphome/components/bedjet/bedjet_hub.cpp +1 -0
  45. esphome/components/bedjet/climate/__init__.py +3 -8
  46. esphome/components/bedjet/fan/__init__.py +2 -11
  47. esphome/components/binary/fan/__init__.py +13 -16
  48. esphome/components/binary_sensor/__init__.py +13 -10
  49. esphome/components/bl0906/constants.h +16 -16
  50. esphome/components/ble_client/text_sensor/__init__.py +3 -5
  51. esphome/components/bluetooth_proxy/bluetooth_connection.cpp +4 -6
  52. esphome/components/bluetooth_proxy/bluetooth_proxy.cpp +136 -21
  53. esphome/components/bluetooth_proxy/bluetooth_proxy.h +7 -0
  54. esphome/components/button/__init__.py +11 -8
  55. esphome/components/canbus/canbus.cpp +3 -0
  56. esphome/components/canbus/canbus.h +16 -0
  57. esphome/components/ccs811/sensor.py +9 -6
  58. esphome/components/climate/__init__.py +35 -2
  59. esphome/components/climate/climate_mode.h +1 -1
  60. esphome/components/climate/climate_traits.h +63 -57
  61. esphome/components/climate_ir/__init__.py +57 -17
  62. esphome/components/climate_ir_lg/climate.py +2 -5
  63. esphome/components/climate_ir_lg/climate_ir_lg.cpp +7 -7
  64. esphome/components/climate_ir_lg/climate_ir_lg.h +1 -1
  65. esphome/components/color/__init__.py +2 -0
  66. esphome/components/const/__init__.py +5 -0
  67. esphome/components/coolix/climate.py +2 -9
  68. esphome/components/copy/cover/__init__.py +10 -9
  69. esphome/components/copy/fan/__init__.py +11 -9
  70. esphome/components/copy/lock/__init__.py +11 -9
  71. esphome/components/copy/text/__init__.py +9 -6
  72. esphome/components/cover/__init__.py +37 -2
  73. esphome/components/cse7766/cse7766.cpp +2 -1
  74. esphome/components/cst226/binary_sensor/__init__.py +28 -0
  75. esphome/components/cst226/binary_sensor/cs226_button.h +22 -0
  76. esphome/components/cst226/binary_sensor/cstt6_button.cpp +19 -0
  77. esphome/components/cst226/touchscreen/cst226_touchscreen.cpp +27 -5
  78. esphome/components/cst226/touchscreen/cst226_touchscreen.h +10 -10
  79. esphome/components/current_based/cover.py +37 -36
  80. esphome/components/current_based/current_based_cover.cpp +2 -1
  81. esphome/components/daikin/climate.py +2 -9
  82. esphome/components/daikin/daikin.cpp +15 -9
  83. esphome/components/daikin/daikin.h +5 -5
  84. esphome/components/daikin_arc/climate.py +2 -7
  85. esphome/components/daikin_brc/climate.py +3 -5
  86. esphome/components/dallas_temp/dallas_temp.cpp +17 -24
  87. esphome/components/dallas_temp/dallas_temp.h +0 -1
  88. esphome/components/daly_bms/daly_bms.cpp +2 -1
  89. esphome/components/debug/debug_component.cpp +6 -1
  90. esphome/components/debug/debug_component.h +6 -0
  91. esphome/components/debug/debug_esp32.cpp +109 -254
  92. esphome/components/debug/sensor.py +14 -0
  93. esphome/components/deep_sleep/deep_sleep_esp32.cpp +13 -1
  94. esphome/components/delonghi/climate.py +2 -9
  95. esphome/components/demo/__init__.py +18 -20
  96. esphome/components/dfrobot_sen0395/switch/__init__.py +21 -22
  97. esphome/components/dps310/sensor.py +6 -6
  98. esphome/components/ee895/sensor.py +9 -9
  99. esphome/components/emmeti/climate.py +2 -9
  100. esphome/components/endstop/cover.py +17 -16
  101. esphome/components/endstop/endstop_cover.cpp +2 -1
  102. esphome/components/ens160_base/__init__.py +12 -9
  103. esphome/components/esp32/__init__.py +60 -3
  104. esphome/components/esp32/core.cpp +11 -5
  105. esphome/components/esp32/gpio.cpp +86 -24
  106. esphome/components/esp32/gpio.py +15 -16
  107. esphome/components/esp32/gpio_esp32.py +1 -2
  108. esphome/components/esp32/gpio_esp32_c2.py +1 -1
  109. esphome/components/esp32/gpio_esp32_c3.py +1 -1
  110. esphome/components/esp32/gpio_esp32_c6.py +1 -1
  111. esphome/components/esp32/gpio_esp32_h2.py +1 -1
  112. esphome/components/esp32_ble/ble.cpp +1 -0
  113. esphome/components/esp32_ble/ble.h +5 -3
  114. esphome/components/esp32_ble/ble_advertising.cpp +2 -1
  115. esphome/components/esp32_ble/ble_advertising.h +1 -0
  116. esphome/components/esp32_ble_server/__init__.py +3 -0
  117. esphome/components/esp32_ble_tracker/__init__.py +7 -1
  118. esphome/components/esp32_ble_tracker/esp32_ble_tracker.cpp +192 -118
  119. esphome/components/esp32_ble_tracker/esp32_ble_tracker.h +29 -3
  120. esphome/components/esp32_camera/esp32_camera.cpp +2 -1
  121. esphome/components/esp32_camera/esp32_camera.h +1 -1
  122. esphome/components/esp32_can/esp32_can.cpp +1 -1
  123. esphome/components/esp32_improv/esp32_improv_component.cpp +1 -1
  124. esphome/components/esp32_rmt_led_strip/led_strip.cpp +1 -1
  125. esphome/components/esp32_rmt_led_strip/led_strip.h +7 -5
  126. esphome/components/esp32_rmt_led_strip/light.py +9 -1
  127. esphome/components/esp32_touch/esp32_touch.cpp +1 -1
  128. esphome/components/esp8266/gpio.cpp +69 -8
  129. esphome/components/ethernet/ethernet_component.cpp +1 -1
  130. esphome/components/event/__init__.py +13 -10
  131. esphome/components/factory_reset/switch/__init__.py +7 -21
  132. esphome/components/fan/__init__.py +52 -5
  133. esphome/components/fastled_base/__init__.py +1 -4
  134. esphome/components/fastled_base/fastled_light.cpp +1 -1
  135. esphome/components/feedback/cover.py +38 -33
  136. esphome/components/feedback/feedback_cover.cpp +2 -1
  137. esphome/components/fujitsu_general/climate.py +2 -9
  138. esphome/components/gcja5/gcja5.cpp +2 -1
  139. esphome/components/gpio/one_wire/gpio_one_wire.cpp +45 -43
  140. esphome/components/gpio/one_wire/gpio_one_wire.h +2 -1
  141. esphome/components/gpio_expander/cached_gpio.h +22 -7
  142. esphome/components/gps/__init__.py +47 -17
  143. esphome/components/gps/gps.cpp +42 -23
  144. esphome/components/gps/gps.h +17 -13
  145. esphome/components/graph/__init__.py +1 -2
  146. esphome/components/gree/climate.py +4 -6
  147. esphome/components/gree/gree.cpp +16 -2
  148. esphome/components/gree/gree.h +2 -2
  149. esphome/components/growatt_solar/growatt_solar.cpp +2 -1
  150. esphome/components/haier/climate.py +37 -34
  151. esphome/components/hbridge/fan/__init__.py +19 -17
  152. esphome/components/he60r/cover.py +4 -5
  153. esphome/components/heatpumpir/climate.py +3 -6
  154. esphome/components/hitachi_ac344/climate.py +2 -9
  155. esphome/components/hitachi_ac424/climate.py +2 -9
  156. esphome/components/hm3301/hm3301.h +1 -1
  157. esphome/components/hte501/sensor.py +6 -6
  158. esphome/components/http_request/__init__.py +39 -6
  159. esphome/components/http_request/http_request.cpp +20 -0
  160. esphome/components/http_request/http_request.h +57 -15
  161. esphome/components/http_request/http_request_arduino.cpp +22 -6
  162. esphome/components/http_request/http_request_arduino.h +4 -3
  163. esphome/components/http_request/http_request_host.cpp +141 -0
  164. esphome/components/http_request/http_request_host.h +37 -0
  165. esphome/components/http_request/http_request_idf.cpp +35 -3
  166. esphome/components/http_request/http_request_idf.h +10 -3
  167. esphome/components/http_request/httplib.h +9691 -0
  168. esphome/components/http_request/update/__init__.py +11 -8
  169. esphome/components/hyt271/sensor.py +6 -6
  170. esphome/components/i2c/i2c.h +4 -0
  171. esphome/components/i2c/i2c_bus_esp_idf.cpp +1 -1
  172. esphome/components/i2s_audio/__init__.py +131 -22
  173. esphome/components/i2s_audio/i2s_audio.h +44 -4
  174. esphome/components/i2s_audio/media_player/__init__.py +19 -9
  175. esphome/components/i2s_audio/microphone/__init__.py +63 -5
  176. esphome/components/i2s_audio/microphone/i2s_audio_microphone.cpp +351 -61
  177. esphome/components/i2s_audio/microphone/i2s_audio_microphone.h +40 -6
  178. esphome/components/i2s_audio/speaker/__init__.py +31 -5
  179. esphome/components/i2s_audio/speaker/i2s_audio_speaker.cpp +155 -19
  180. esphome/components/i2s_audio/speaker/i2s_audio_speaker.h +17 -4
  181. esphome/components/ili9xxx/ili9xxx_init.h +1 -1
  182. esphome/components/image/__init__.py +37 -17
  183. esphome/components/image/image.cpp +25 -8
  184. esphome/components/internal_temperature/internal_temperature.cpp +6 -4
  185. esphome/components/key_collector/__init__.py +35 -0
  186. esphome/components/key_collector/key_collector.cpp +8 -0
  187. esphome/components/key_collector/key_collector.h +10 -0
  188. esphome/components/kuntze/kuntze.cpp +2 -1
  189. esphome/components/ld2410/ld2410.h +1 -1
  190. esphome/components/ld2450/ld2450.h +1 -1
  191. esphome/components/light/__init__.py +57 -0
  192. esphome/components/lock/__init__.py +51 -4
  193. esphome/components/lock/automation.h +2 -13
  194. esphome/components/logger/__init__.py +22 -0
  195. esphome/components/logger/logger.cpp +154 -103
  196. esphome/components/logger/logger.h +211 -36
  197. esphome/components/logger/task_log_buffer.cpp +138 -0
  198. esphome/components/logger/task_log_buffer.h +69 -0
  199. esphome/components/lvgl/__init__.py +13 -5
  200. esphome/components/lvgl/automation.py +50 -1
  201. esphome/components/lvgl/defines.py +0 -1
  202. esphome/components/lvgl/lvgl_esphome.cpp +5 -1
  203. esphome/components/lvgl/text/__init__.py +1 -2
  204. esphome/components/mapping/__init__.py +134 -0
  205. esphome/components/matrix_keypad/matrix_keypad.cpp +2 -1
  206. esphome/components/max7219digit/max7219digit.cpp +28 -27
  207. esphome/components/mdns/__init__.py +11 -5
  208. esphome/components/mdns/mdns_component.cpp +11 -5
  209. esphome/components/mdns/mdns_component.h +3 -2
  210. esphome/components/mdns/mdns_esp32.cpp +4 -3
  211. esphome/components/mdns/mdns_esp8266.cpp +4 -2
  212. esphome/components/mdns/mdns_libretiny.cpp +4 -2
  213. esphome/components/mdns/mdns_rp2040.cpp +4 -2
  214. esphome/components/media_player/__init__.py +33 -1
  215. esphome/components/mhz19/sensor.py +11 -7
  216. esphome/components/micro_wake_word/__init__.py +99 -31
  217. esphome/components/micro_wake_word/automation.h +54 -0
  218. esphome/components/micro_wake_word/micro_wake_word.cpp +331 -319
  219. esphome/components/micro_wake_word/micro_wake_word.h +58 -105
  220. esphome/components/micro_wake_word/preprocessor_settings.h +19 -2
  221. esphome/components/micro_wake_word/streaming_model.cpp +158 -41
  222. esphome/components/micro_wake_word/streaming_model.h +85 -13
  223. esphome/components/microphone/__init__.py +139 -9
  224. esphome/components/microphone/automation.h +14 -2
  225. esphome/components/microphone/microphone.cpp +21 -0
  226. esphome/components/microphone/microphone.h +14 -5
  227. esphome/components/microphone/microphone_source.cpp +95 -0
  228. esphome/components/microphone/microphone_source.h +80 -0
  229. esphome/components/mics_4514/sensor.py +25 -14
  230. esphome/components/midea/climate.py +3 -4
  231. esphome/components/midea_ir/climate.py +3 -5
  232. esphome/components/mipi_spi/__init__.py +15 -0
  233. esphome/components/mipi_spi/display.py +474 -0
  234. esphome/components/mipi_spi/mipi_spi.cpp +481 -0
  235. esphome/components/mipi_spi/mipi_spi.h +171 -0
  236. esphome/components/mipi_spi/models/__init__.py +65 -0
  237. esphome/components/mipi_spi/models/amoled.py +72 -0
  238. esphome/components/mipi_spi/models/commands.py +82 -0
  239. esphome/components/mipi_spi/models/cyd.py +10 -0
  240. esphome/components/mipi_spi/models/ili.py +749 -0
  241. esphome/components/mipi_spi/models/jc.py +260 -0
  242. esphome/components/mipi_spi/models/lanbon.py +15 -0
  243. esphome/components/mipi_spi/models/lilygo.py +60 -0
  244. esphome/components/mipi_spi/models/waveshare.py +139 -0
  245. esphome/components/mitsubishi/climate.py +2 -5
  246. esphome/components/mitsubishi/mitsubishi.cpp +9 -9
  247. esphome/components/mixer/speaker/mixer_speaker.cpp +12 -22
  248. esphome/components/mixer/speaker/mixer_speaker.h +1 -3
  249. esphome/components/mlx90393/sensor.py +5 -0
  250. esphome/components/mlx90393/sensor_mlx90393.cpp +195 -13
  251. esphome/components/mlx90393/sensor_mlx90393.h +21 -4
  252. esphome/components/modbus/modbus.cpp +2 -1
  253. esphome/components/mqtt/__init__.py +1 -1
  254. esphome/components/mqtt/mqtt_client.cpp +6 -2
  255. esphome/components/mqtt/mqtt_const.h +4 -0
  256. esphome/components/mqtt/mqtt_fan.cpp +39 -0
  257. esphome/components/mqtt/mqtt_fan.h +2 -0
  258. esphome/components/ms5611/sensor.py +6 -6
  259. esphome/components/ms8607/sensor.py +3 -3
  260. esphome/components/network/__init__.py +1 -1
  261. esphome/components/nextion/base_component.py +17 -16
  262. esphome/components/nextion/display.py +11 -2
  263. esphome/components/nextion/nextion.cpp +39 -1
  264. esphome/components/nextion/nextion.h +50 -0
  265. esphome/components/noblex/climate.py +2 -9
  266. esphome/components/number/__init__.py +12 -9
  267. esphome/components/one_wire/one_wire_bus.cpp +14 -10
  268. esphome/components/one_wire/one_wire_bus.h +14 -8
  269. esphome/components/online_image/bmp_image.cpp +48 -11
  270. esphome/components/online_image/bmp_image.h +2 -0
  271. esphome/components/opentherm/binary_sensor/__init__.py +2 -4
  272. esphome/components/opentherm/number/__init__.py +11 -20
  273. esphome/components/opentherm/sensor/__init__.py +3 -3
  274. esphome/components/opentherm/switch/__init__.py +3 -5
  275. esphome/components/output/lock/__init__.py +11 -9
  276. esphome/components/packages/__init__.py +33 -31
  277. esphome/components/packet_transport/__init__.py +201 -0
  278. esphome/components/packet_transport/binary_sensor.py +19 -0
  279. esphome/components/packet_transport/packet_transport.cpp +534 -0
  280. esphome/components/packet_transport/packet_transport.h +154 -0
  281. esphome/components/packet_transport/sensor.py +19 -0
  282. esphome/components/pca9685/pca9685_output.cpp +2 -1
  283. esphome/components/pid/climate.py +2 -4
  284. esphome/components/pm2005/__init__.py +1 -0
  285. esphome/components/pm2005/pm2005.cpp +123 -0
  286. esphome/components/pm2005/pm2005.h +46 -0
  287. esphome/components/pm2005/sensor.py +86 -0
  288. esphome/components/pmsa003i/pmsa003i.cpp +43 -16
  289. esphome/components/pmsa003i/pmsa003i.h +25 -25
  290. esphome/components/pmsx003/pmsx003.cpp +195 -230
  291. esphome/components/pmsx003/pmsx003.h +51 -33
  292. esphome/components/pmsx003/sensor.py +21 -11
  293. esphome/components/pn7150/pn7150.h +2 -2
  294. esphome/components/pn7160/pn7160.h +2 -2
  295. esphome/components/prometheus/prometheus_handler.cpp +174 -0
  296. esphome/components/prometheus/prometheus_handler.h +17 -0
  297. esphome/components/psram/__init__.py +7 -5
  298. esphome/components/pulse_meter/pulse_meter_sensor.cpp +32 -12
  299. esphome/components/pulse_meter/pulse_meter_sensor.h +5 -5
  300. esphome/components/pzem004t/pzem004t.cpp +2 -1
  301. esphome/components/qspi_dbi/__init__.py +0 -1
  302. esphome/components/qspi_dbi/display.py +2 -1
  303. esphome/components/qspi_dbi/models.py +1 -2
  304. esphome/components/remote_base/__init__.py +91 -0
  305. esphome/components/remote_base/beo4_protocol.cpp +153 -0
  306. esphome/components/remote_base/beo4_protocol.h +43 -0
  307. esphome/components/remote_base/gobox_protocol.cpp +131 -0
  308. esphome/components/remote_base/gobox_protocol.h +54 -0
  309. esphome/components/remote_receiver/remote_receiver_esp32.cpp +16 -9
  310. esphome/components/resampler/speaker/resampler_speaker.cpp +12 -10
  311. esphome/components/resampler/speaker/resampler_speaker.h +1 -1
  312. esphome/components/rf_bridge/rf_bridge.cpp +2 -1
  313. esphome/components/scd30/sensor.py +2 -3
  314. esphome/components/scd4x/sensor.py +4 -5
  315. esphome/components/sdp3x/sensor.py +2 -1
  316. esphome/components/sds011/sds011.cpp +2 -1
  317. esphome/components/select/__init__.py +19 -20
  318. esphome/components/sen5x/sen5x.cpp +55 -36
  319. esphome/components/sen5x/sensor.py +1 -1
  320. esphome/components/senseair/sensor.py +3 -3
  321. esphome/components/sensor/__init__.py +158 -14
  322. esphome/components/sensor/filter.cpp +23 -0
  323. esphome/components/sensor/filter.h +22 -0
  324. esphome/components/sgp30/sensor.py +14 -16
  325. esphome/components/sgp4x/sensor.py +1 -1
  326. esphome/components/sht4x/sht4x.cpp +43 -22
  327. esphome/components/sht4x/sht4x.h +1 -1
  328. esphome/components/shtcx/sensor.py +6 -6
  329. esphome/components/slow_pwm/slow_pwm_output.cpp +2 -1
  330. esphome/components/sml/text_sensor/__init__.py +4 -6
  331. esphome/components/sound_level/__init__.py +0 -0
  332. esphome/components/sound_level/sensor.py +97 -0
  333. esphome/components/sound_level/sound_level.cpp +194 -0
  334. esphome/components/sound_level/sound_level.h +73 -0
  335. esphome/components/speaker/media_player/__init__.py +4 -8
  336. esphome/components/speaker/media_player/speaker_media_player.cpp +0 -18
  337. esphome/components/speaker/media_player/speaker_media_player.h +0 -11
  338. esphome/components/speaker/speaker.h +4 -7
  339. esphome/components/speed/fan/__init__.py +17 -16
  340. esphome/components/spi/spi.h +11 -1
  341. esphome/components/sprinkler/__init__.py +18 -19
  342. esphome/components/sprinkler/sprinkler.cpp +6 -5
  343. esphome/components/switch/__init__.py +32 -42
  344. esphome/components/syslog/__init__.py +41 -0
  345. esphome/components/syslog/esphome_syslog.cpp +49 -0
  346. esphome/components/syslog/esphome_syslog.h +27 -0
  347. esphome/components/t6615/sensor.py +3 -3
  348. esphome/components/t6615/t6615.cpp +2 -1
  349. esphome/components/tca9555/tca9555.cpp +11 -6
  350. esphome/components/tcl112/climate.py +2 -9
  351. esphome/components/template/alarm_control_panel/__init__.py +7 -6
  352. esphome/components/template/alarm_control_panel/template_alarm_control_panel.cpp +21 -17
  353. esphome/components/template/alarm_control_panel/template_alarm_control_panel.h +2 -1
  354. esphome/components/template/cover/__init__.py +27 -21
  355. esphome/components/template/fan/__init__.py +14 -12
  356. esphome/components/template/lock/__init__.py +20 -25
  357. esphome/components/template/lock/automation.h +18 -0
  358. esphome/components/template/text/__init__.py +4 -3
  359. esphome/components/template/valve/__init__.py +32 -21
  360. esphome/components/template/valve/automation.h +24 -0
  361. esphome/components/text/__init__.py +32 -1
  362. esphome/components/text_sensor/__init__.py +24 -29
  363. esphome/components/thermostat/climate.py +5 -5
  364. esphome/components/time_based/cover.py +17 -16
  365. esphome/components/time_based/time_based_cover.cpp +2 -1
  366. esphome/components/tm1638/switch/__init__.py +10 -7
  367. esphome/components/tormatic/cover.py +4 -5
  368. esphome/components/toshiba/climate.py +3 -5
  369. esphome/components/touchscreen/touchscreen.cpp +3 -1
  370. esphome/components/tuya/climate/__init__.py +5 -6
  371. esphome/components/tuya/cover/__init__.py +6 -11
  372. esphome/components/tuya/select/__init__.py +15 -5
  373. esphome/components/tuya/select/tuya_select.cpp +6 -1
  374. esphome/components/tuya/select/tuya_select.h +5 -1
  375. esphome/components/uart/packet_transport/__init__.py +20 -0
  376. esphome/components/uart/packet_transport/uart_transport.cpp +88 -0
  377. esphome/components/uart/packet_transport/uart_transport.h +41 -0
  378. esphome/components/uart/switch/uart_switch.cpp +2 -1
  379. esphome/components/udp/__init__.py +126 -128
  380. esphome/components/udp/automation.h +40 -0
  381. esphome/components/udp/binary_sensor.py +3 -25
  382. esphome/components/udp/packet_transport/__init__.py +29 -0
  383. esphome/components/udp/packet_transport/udp_transport.cpp +36 -0
  384. esphome/components/udp/packet_transport/udp_transport.h +28 -0
  385. esphome/components/udp/sensor.py +3 -25
  386. esphome/components/udp/udp_component.cpp +26 -470
  387. esphome/components/udp/udp_component.h +21 -128
  388. esphome/components/update/__init__.py +31 -1
  389. esphome/components/uponor_smatrix/climate/__init__.py +4 -9
  390. esphome/components/uponor_smatrix/climate/uponor_smatrix_climate.cpp +2 -1
  391. esphome/components/uponor_smatrix/uponor_smatrix.cpp +2 -1
  392. esphome/components/uptime/text_sensor/__init__.py +47 -7
  393. esphome/components/uptime/text_sensor/uptime_text_sensor.cpp +12 -7
  394. esphome/components/uptime/text_sensor/uptime_text_sensor.h +19 -0
  395. esphome/components/valve/__init__.py +34 -3
  396. esphome/components/valve/automation.h +1 -19
  397. esphome/components/vl53l0x/sensor.py +11 -0
  398. esphome/components/vl53l0x/vl53l0x_sensor.cpp +5 -1
  399. esphome/components/vl53l0x/vl53l0x_sensor.h +2 -1
  400. esphome/components/voice_assistant/__init__.py +36 -10
  401. esphome/components/voice_assistant/voice_assistant.cpp +170 -144
  402. esphome/components/voice_assistant/voice_assistant.h +26 -25
  403. esphome/components/waveshare_epaper/display.py +6 -0
  404. esphome/components/waveshare_epaper/waveshare_epaper.cpp +439 -37
  405. esphome/components/waveshare_epaper/waveshare_epaper.h +60 -11
  406. esphome/components/whirlpool/climate.py +3 -5
  407. esphome/components/whynter/climate.py +3 -5
  408. esphome/components/xpt2046/touchscreen/xpt2046.cpp +1 -1
  409. esphome/components/yashima/climate.py +6 -6
  410. esphome/components/zhlt01/climate.py +2 -7
  411. esphome/config.py +13 -13
  412. esphome/config_validation.py +38 -58
  413. esphome/const.py +15 -1
  414. esphome/core/__init__.py +2 -0
  415. esphome/core/application.cpp +23 -10
  416. esphome/core/application.h +9 -1
  417. esphome/core/automation.h +4 -3
  418. esphome/core/component.cpp +28 -7
  419. esphome/core/component.h +10 -1
  420. esphome/core/defines.h +23 -17
  421. esphome/core/macros.h +4 -0
  422. esphome/core/scheduler.cpp +7 -1
  423. esphome/cpp_generator.py +6 -2
  424. esphome/dashboard/web_server.py +3 -3
  425. esphome/helpers.py +39 -0
  426. esphome/loader.py +4 -0
  427. esphome/log.py +15 -19
  428. esphome/mqtt.py +23 -10
  429. esphome/platformio_api.py +1 -1
  430. esphome/schema_extractors.py +0 -1
  431. esphome/voluptuous_schema.py +3 -1
  432. esphome/vscode.py +15 -0
  433. esphome/wizard.py +47 -37
  434. esphome/zeroconf.py +7 -3
  435. {esphome-2025.4.2.dist-info → esphome-2025.5.0b3.dist-info}/METADATA +10 -11
  436. {esphome-2025.4.2.dist-info → esphome-2025.5.0b3.dist-info}/RECORD +440 -380
  437. {esphome-2025.4.2.dist-info → esphome-2025.5.0b3.dist-info}/WHEEL +1 -1
  438. {esphome-2025.4.2.dist-info → esphome-2025.5.0b3.dist-info}/entry_points.txt +0 -0
  439. {esphome-2025.4.2.dist-info → esphome-2025.5.0b3.dist-info}/licenses/LICENSE +0 -0
  440. {esphome-2025.4.2.dist-info → esphome-2025.5.0b3.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,7 @@
1
1
  // This file was automatically generated with a tool.
2
- // See scripts/api_protobuf/api_protobuf.py
2
+ // See script/api_protobuf/api_protobuf.py
3
3
  #include "api_pb2.h"
4
+ #include "api_pb2_size.h"
4
5
  #include "esphome/core/log.h"
5
6
 
6
7
  #include <cinttypes>
@@ -422,6 +423,38 @@ const char *proto_enum_to_string<enums::BluetoothDeviceRequestType>(enums::Bluet
422
423
  }
423
424
  #endif
424
425
  #ifdef HAS_PROTO_MESSAGE_DUMP
426
+ template<> const char *proto_enum_to_string<enums::BluetoothScannerState>(enums::BluetoothScannerState value) {
427
+ switch (value) {
428
+ case enums::BLUETOOTH_SCANNER_STATE_IDLE:
429
+ return "BLUETOOTH_SCANNER_STATE_IDLE";
430
+ case enums::BLUETOOTH_SCANNER_STATE_STARTING:
431
+ return "BLUETOOTH_SCANNER_STATE_STARTING";
432
+ case enums::BLUETOOTH_SCANNER_STATE_RUNNING:
433
+ return "BLUETOOTH_SCANNER_STATE_RUNNING";
434
+ case enums::BLUETOOTH_SCANNER_STATE_FAILED:
435
+ return "BLUETOOTH_SCANNER_STATE_FAILED";
436
+ case enums::BLUETOOTH_SCANNER_STATE_STOPPING:
437
+ return "BLUETOOTH_SCANNER_STATE_STOPPING";
438
+ case enums::BLUETOOTH_SCANNER_STATE_STOPPED:
439
+ return "BLUETOOTH_SCANNER_STATE_STOPPED";
440
+ default:
441
+ return "UNKNOWN";
442
+ }
443
+ }
444
+ #endif
445
+ #ifdef HAS_PROTO_MESSAGE_DUMP
446
+ template<> const char *proto_enum_to_string<enums::BluetoothScannerMode>(enums::BluetoothScannerMode value) {
447
+ switch (value) {
448
+ case enums::BLUETOOTH_SCANNER_MODE_PASSIVE:
449
+ return "BLUETOOTH_SCANNER_MODE_PASSIVE";
450
+ case enums::BLUETOOTH_SCANNER_MODE_ACTIVE:
451
+ return "BLUETOOTH_SCANNER_MODE_ACTIVE";
452
+ default:
453
+ return "UNKNOWN";
454
+ }
455
+ }
456
+ #endif
457
+ #ifdef HAS_PROTO_MESSAGE_DUMP
425
458
  template<>
426
459
  const char *proto_enum_to_string<enums::VoiceAssistantSubscribeFlag>(enums::VoiceAssistantSubscribeFlag value) {
427
460
  switch (value) {
@@ -622,6 +655,11 @@ void HelloRequest::encode(ProtoWriteBuffer buffer) const {
622
655
  buffer.encode_uint32(2, this->api_version_major);
623
656
  buffer.encode_uint32(3, this->api_version_minor);
624
657
  }
658
+ void HelloRequest::calculate_size(uint32_t &total_size) const {
659
+ ProtoSize::add_string_field(total_size, 1, this->client_info, false);
660
+ ProtoSize::add_uint32_field(total_size, 1, this->api_version_major, false);
661
+ ProtoSize::add_uint32_field(total_size, 1, this->api_version_minor, false);
662
+ }
625
663
  #ifdef HAS_PROTO_MESSAGE_DUMP
626
664
  void HelloRequest::dump_to(std::string &out) const {
627
665
  __attribute__((unused)) char buffer[64];
@@ -676,6 +714,12 @@ void HelloResponse::encode(ProtoWriteBuffer buffer) const {
676
714
  buffer.encode_string(3, this->server_info);
677
715
  buffer.encode_string(4, this->name);
678
716
  }
717
+ void HelloResponse::calculate_size(uint32_t &total_size) const {
718
+ ProtoSize::add_uint32_field(total_size, 1, this->api_version_major, false);
719
+ ProtoSize::add_uint32_field(total_size, 1, this->api_version_minor, false);
720
+ ProtoSize::add_string_field(total_size, 1, this->server_info, false);
721
+ ProtoSize::add_string_field(total_size, 1, this->name, false);
722
+ }
679
723
  #ifdef HAS_PROTO_MESSAGE_DUMP
680
724
  void HelloResponse::dump_to(std::string &out) const {
681
725
  __attribute__((unused)) char buffer[64];
@@ -711,6 +755,9 @@ bool ConnectRequest::decode_length(uint32_t field_id, ProtoLengthDelimited value
711
755
  }
712
756
  }
713
757
  void ConnectRequest::encode(ProtoWriteBuffer buffer) const { buffer.encode_string(1, this->password); }
758
+ void ConnectRequest::calculate_size(uint32_t &total_size) const {
759
+ ProtoSize::add_string_field(total_size, 1, this->password, false);
760
+ }
714
761
  #ifdef HAS_PROTO_MESSAGE_DUMP
715
762
  void ConnectRequest::dump_to(std::string &out) const {
716
763
  __attribute__((unused)) char buffer[64];
@@ -732,6 +779,9 @@ bool ConnectResponse::decode_varint(uint32_t field_id, ProtoVarInt value) {
732
779
  }
733
780
  }
734
781
  void ConnectResponse::encode(ProtoWriteBuffer buffer) const { buffer.encode_bool(1, this->invalid_password); }
782
+ void ConnectResponse::calculate_size(uint32_t &total_size) const {
783
+ ProtoSize::add_bool_field(total_size, 1, this->invalid_password, false);
784
+ }
735
785
  #ifdef HAS_PROTO_MESSAGE_DUMP
736
786
  void ConnectResponse::dump_to(std::string &out) const {
737
787
  __attribute__((unused)) char buffer[64];
@@ -743,22 +793,27 @@ void ConnectResponse::dump_to(std::string &out) const {
743
793
  }
744
794
  #endif
745
795
  void DisconnectRequest::encode(ProtoWriteBuffer buffer) const {}
796
+ void DisconnectRequest::calculate_size(uint32_t &total_size) const {}
746
797
  #ifdef HAS_PROTO_MESSAGE_DUMP
747
798
  void DisconnectRequest::dump_to(std::string &out) const { out.append("DisconnectRequest {}"); }
748
799
  #endif
749
800
  void DisconnectResponse::encode(ProtoWriteBuffer buffer) const {}
801
+ void DisconnectResponse::calculate_size(uint32_t &total_size) const {}
750
802
  #ifdef HAS_PROTO_MESSAGE_DUMP
751
803
  void DisconnectResponse::dump_to(std::string &out) const { out.append("DisconnectResponse {}"); }
752
804
  #endif
753
805
  void PingRequest::encode(ProtoWriteBuffer buffer) const {}
806
+ void PingRequest::calculate_size(uint32_t &total_size) const {}
754
807
  #ifdef HAS_PROTO_MESSAGE_DUMP
755
808
  void PingRequest::dump_to(std::string &out) const { out.append("PingRequest {}"); }
756
809
  #endif
757
810
  void PingResponse::encode(ProtoWriteBuffer buffer) const {}
811
+ void PingResponse::calculate_size(uint32_t &total_size) const {}
758
812
  #ifdef HAS_PROTO_MESSAGE_DUMP
759
813
  void PingResponse::dump_to(std::string &out) const { out.append("PingResponse {}"); }
760
814
  #endif
761
815
  void DeviceInfoRequest::encode(ProtoWriteBuffer buffer) const {}
816
+ void DeviceInfoRequest::calculate_size(uint32_t &total_size) const {}
762
817
  #ifdef HAS_PROTO_MESSAGE_DUMP
763
818
  void DeviceInfoRequest::dump_to(std::string &out) const { out.append("DeviceInfoRequest {}"); }
764
819
  #endif
@@ -792,6 +847,10 @@ bool DeviceInfoResponse::decode_varint(uint32_t field_id, ProtoVarInt value) {
792
847
  this->voice_assistant_feature_flags = value.as_uint32();
793
848
  return true;
794
849
  }
850
+ case 19: {
851
+ this->api_encryption_supported = value.as_bool();
852
+ return true;
853
+ }
795
854
  default:
796
855
  return false;
797
856
  }
@@ -865,6 +924,28 @@ void DeviceInfoResponse::encode(ProtoWriteBuffer buffer) const {
865
924
  buffer.encode_uint32(17, this->voice_assistant_feature_flags);
866
925
  buffer.encode_string(16, this->suggested_area);
867
926
  buffer.encode_string(18, this->bluetooth_mac_address);
927
+ buffer.encode_bool(19, this->api_encryption_supported);
928
+ }
929
+ void DeviceInfoResponse::calculate_size(uint32_t &total_size) const {
930
+ ProtoSize::add_bool_field(total_size, 1, this->uses_password, false);
931
+ ProtoSize::add_string_field(total_size, 1, this->name, false);
932
+ ProtoSize::add_string_field(total_size, 1, this->mac_address, false);
933
+ ProtoSize::add_string_field(total_size, 1, this->esphome_version, false);
934
+ ProtoSize::add_string_field(total_size, 1, this->compilation_time, false);
935
+ ProtoSize::add_string_field(total_size, 1, this->model, false);
936
+ ProtoSize::add_bool_field(total_size, 1, this->has_deep_sleep, false);
937
+ ProtoSize::add_string_field(total_size, 1, this->project_name, false);
938
+ ProtoSize::add_string_field(total_size, 1, this->project_version, false);
939
+ ProtoSize::add_uint32_field(total_size, 1, this->webserver_port, false);
940
+ ProtoSize::add_uint32_field(total_size, 1, this->legacy_bluetooth_proxy_version, false);
941
+ ProtoSize::add_uint32_field(total_size, 1, this->bluetooth_proxy_feature_flags, false);
942
+ ProtoSize::add_string_field(total_size, 1, this->manufacturer, false);
943
+ ProtoSize::add_string_field(total_size, 1, this->friendly_name, false);
944
+ ProtoSize::add_uint32_field(total_size, 1, this->legacy_voice_assistant_version, false);
945
+ ProtoSize::add_uint32_field(total_size, 2, this->voice_assistant_feature_flags, false);
946
+ ProtoSize::add_string_field(total_size, 2, this->suggested_area, false);
947
+ ProtoSize::add_string_field(total_size, 2, this->bluetooth_mac_address, false);
948
+ ProtoSize::add_bool_field(total_size, 2, this->api_encryption_supported, false);
868
949
  }
869
950
  #ifdef HAS_PROTO_MESSAGE_DUMP
870
951
  void DeviceInfoResponse::dump_to(std::string &out) const {
@@ -946,18 +1027,25 @@ void DeviceInfoResponse::dump_to(std::string &out) const {
946
1027
  out.append(" bluetooth_mac_address: ");
947
1028
  out.append("'").append(this->bluetooth_mac_address).append("'");
948
1029
  out.append("\n");
1030
+
1031
+ out.append(" api_encryption_supported: ");
1032
+ out.append(YESNO(this->api_encryption_supported));
1033
+ out.append("\n");
949
1034
  out.append("}");
950
1035
  }
951
1036
  #endif
952
1037
  void ListEntitiesRequest::encode(ProtoWriteBuffer buffer) const {}
1038
+ void ListEntitiesRequest::calculate_size(uint32_t &total_size) const {}
953
1039
  #ifdef HAS_PROTO_MESSAGE_DUMP
954
1040
  void ListEntitiesRequest::dump_to(std::string &out) const { out.append("ListEntitiesRequest {}"); }
955
1041
  #endif
956
1042
  void ListEntitiesDoneResponse::encode(ProtoWriteBuffer buffer) const {}
1043
+ void ListEntitiesDoneResponse::calculate_size(uint32_t &total_size) const {}
957
1044
  #ifdef HAS_PROTO_MESSAGE_DUMP
958
1045
  void ListEntitiesDoneResponse::dump_to(std::string &out) const { out.append("ListEntitiesDoneResponse {}"); }
959
1046
  #endif
960
1047
  void SubscribeStatesRequest::encode(ProtoWriteBuffer buffer) const {}
1048
+ void SubscribeStatesRequest::calculate_size(uint32_t &total_size) const {}
961
1049
  #ifdef HAS_PROTO_MESSAGE_DUMP
962
1050
  void SubscribeStatesRequest::dump_to(std::string &out) const { out.append("SubscribeStatesRequest {}"); }
963
1051
  #endif
@@ -1026,6 +1114,17 @@ void ListEntitiesBinarySensorResponse::encode(ProtoWriteBuffer buffer) const {
1026
1114
  buffer.encode_string(8, this->icon);
1027
1115
  buffer.encode_enum<enums::EntityCategory>(9, this->entity_category);
1028
1116
  }
1117
+ void ListEntitiesBinarySensorResponse::calculate_size(uint32_t &total_size) const {
1118
+ ProtoSize::add_string_field(total_size, 1, this->object_id, false);
1119
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
1120
+ ProtoSize::add_string_field(total_size, 1, this->name, false);
1121
+ ProtoSize::add_string_field(total_size, 1, this->unique_id, false);
1122
+ ProtoSize::add_string_field(total_size, 1, this->device_class, false);
1123
+ ProtoSize::add_bool_field(total_size, 1, this->is_status_binary_sensor, false);
1124
+ ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false);
1125
+ ProtoSize::add_string_field(total_size, 1, this->icon, false);
1126
+ ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false);
1127
+ }
1029
1128
  #ifdef HAS_PROTO_MESSAGE_DUMP
1030
1129
  void ListEntitiesBinarySensorResponse::dump_to(std::string &out) const {
1031
1130
  __attribute__((unused)) char buffer[64];
@@ -1098,6 +1197,11 @@ void BinarySensorStateResponse::encode(ProtoWriteBuffer buffer) const {
1098
1197
  buffer.encode_bool(2, this->state);
1099
1198
  buffer.encode_bool(3, this->missing_state);
1100
1199
  }
1200
+ void BinarySensorStateResponse::calculate_size(uint32_t &total_size) const {
1201
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
1202
+ ProtoSize::add_bool_field(total_size, 1, this->state, false);
1203
+ ProtoSize::add_bool_field(total_size, 1, this->missing_state, false);
1204
+ }
1101
1205
  #ifdef HAS_PROTO_MESSAGE_DUMP
1102
1206
  void BinarySensorStateResponse::dump_to(std::string &out) const {
1103
1207
  __attribute__((unused)) char buffer[64];
@@ -1197,6 +1301,20 @@ void ListEntitiesCoverResponse::encode(ProtoWriteBuffer buffer) const {
1197
1301
  buffer.encode_enum<enums::EntityCategory>(11, this->entity_category);
1198
1302
  buffer.encode_bool(12, this->supports_stop);
1199
1303
  }
1304
+ void ListEntitiesCoverResponse::calculate_size(uint32_t &total_size) const {
1305
+ ProtoSize::add_string_field(total_size, 1, this->object_id, false);
1306
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
1307
+ ProtoSize::add_string_field(total_size, 1, this->name, false);
1308
+ ProtoSize::add_string_field(total_size, 1, this->unique_id, false);
1309
+ ProtoSize::add_bool_field(total_size, 1, this->assumed_state, false);
1310
+ ProtoSize::add_bool_field(total_size, 1, this->supports_position, false);
1311
+ ProtoSize::add_bool_field(total_size, 1, this->supports_tilt, false);
1312
+ ProtoSize::add_string_field(total_size, 1, this->device_class, false);
1313
+ ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false);
1314
+ ProtoSize::add_string_field(total_size, 1, this->icon, false);
1315
+ ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false);
1316
+ ProtoSize::add_bool_field(total_size, 1, this->supports_stop, false);
1317
+ }
1200
1318
  #ifdef HAS_PROTO_MESSAGE_DUMP
1201
1319
  void ListEntitiesCoverResponse::dump_to(std::string &out) const {
1202
1320
  __attribute__((unused)) char buffer[64];
@@ -1291,6 +1409,13 @@ void CoverStateResponse::encode(ProtoWriteBuffer buffer) const {
1291
1409
  buffer.encode_float(4, this->tilt);
1292
1410
  buffer.encode_enum<enums::CoverOperation>(5, this->current_operation);
1293
1411
  }
1412
+ void CoverStateResponse::calculate_size(uint32_t &total_size) const {
1413
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
1414
+ ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->legacy_state), false);
1415
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->position != 0.0f, false);
1416
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->tilt != 0.0f, false);
1417
+ ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->current_operation), false);
1418
+ }
1294
1419
  #ifdef HAS_PROTO_MESSAGE_DUMP
1295
1420
  void CoverStateResponse::dump_to(std::string &out) const {
1296
1421
  __attribute__((unused)) char buffer[64];
@@ -1374,6 +1499,16 @@ void CoverCommandRequest::encode(ProtoWriteBuffer buffer) const {
1374
1499
  buffer.encode_float(7, this->tilt);
1375
1500
  buffer.encode_bool(8, this->stop);
1376
1501
  }
1502
+ void CoverCommandRequest::calculate_size(uint32_t &total_size) const {
1503
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
1504
+ ProtoSize::add_bool_field(total_size, 1, this->has_legacy_command, false);
1505
+ ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->legacy_command), false);
1506
+ ProtoSize::add_bool_field(total_size, 1, this->has_position, false);
1507
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->position != 0.0f, false);
1508
+ ProtoSize::add_bool_field(total_size, 1, this->has_tilt, false);
1509
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->tilt != 0.0f, false);
1510
+ ProtoSize::add_bool_field(total_size, 1, this->stop, false);
1511
+ }
1377
1512
  #ifdef HAS_PROTO_MESSAGE_DUMP
1378
1513
  void CoverCommandRequest::dump_to(std::string &out) const {
1379
1514
  __attribute__((unused)) char buffer[64];
@@ -1497,6 +1632,24 @@ void ListEntitiesFanResponse::encode(ProtoWriteBuffer buffer) const {
1497
1632
  buffer.encode_string(12, it, true);
1498
1633
  }
1499
1634
  }
1635
+ void ListEntitiesFanResponse::calculate_size(uint32_t &total_size) const {
1636
+ ProtoSize::add_string_field(total_size, 1, this->object_id, false);
1637
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
1638
+ ProtoSize::add_string_field(total_size, 1, this->name, false);
1639
+ ProtoSize::add_string_field(total_size, 1, this->unique_id, false);
1640
+ ProtoSize::add_bool_field(total_size, 1, this->supports_oscillation, false);
1641
+ ProtoSize::add_bool_field(total_size, 1, this->supports_speed, false);
1642
+ ProtoSize::add_bool_field(total_size, 1, this->supports_direction, false);
1643
+ ProtoSize::add_int32_field(total_size, 1, this->supported_speed_count, false);
1644
+ ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false);
1645
+ ProtoSize::add_string_field(total_size, 1, this->icon, false);
1646
+ ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false);
1647
+ if (!this->supported_preset_modes.empty()) {
1648
+ for (const auto &it : this->supported_preset_modes) {
1649
+ ProtoSize::add_string_field(total_size, 1, it, true);
1650
+ }
1651
+ }
1652
+ }
1500
1653
  #ifdef HAS_PROTO_MESSAGE_DUMP
1501
1654
  void ListEntitiesFanResponse::dump_to(std::string &out) const {
1502
1655
  __attribute__((unused)) char buffer[64];
@@ -1610,6 +1763,15 @@ void FanStateResponse::encode(ProtoWriteBuffer buffer) const {
1610
1763
  buffer.encode_int32(6, this->speed_level);
1611
1764
  buffer.encode_string(7, this->preset_mode);
1612
1765
  }
1766
+ void FanStateResponse::calculate_size(uint32_t &total_size) const {
1767
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
1768
+ ProtoSize::add_bool_field(total_size, 1, this->state, false);
1769
+ ProtoSize::add_bool_field(total_size, 1, this->oscillating, false);
1770
+ ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->speed), false);
1771
+ ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->direction), false);
1772
+ ProtoSize::add_int32_field(total_size, 1, this->speed_level, false);
1773
+ ProtoSize::add_string_field(total_size, 1, this->preset_mode, false);
1774
+ }
1613
1775
  #ifdef HAS_PROTO_MESSAGE_DUMP
1614
1776
  void FanStateResponse::dump_to(std::string &out) const {
1615
1777
  __attribute__((unused)) char buffer[64];
@@ -1731,6 +1893,21 @@ void FanCommandRequest::encode(ProtoWriteBuffer buffer) const {
1731
1893
  buffer.encode_bool(12, this->has_preset_mode);
1732
1894
  buffer.encode_string(13, this->preset_mode);
1733
1895
  }
1896
+ void FanCommandRequest::calculate_size(uint32_t &total_size) const {
1897
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
1898
+ ProtoSize::add_bool_field(total_size, 1, this->has_state, false);
1899
+ ProtoSize::add_bool_field(total_size, 1, this->state, false);
1900
+ ProtoSize::add_bool_field(total_size, 1, this->has_speed, false);
1901
+ ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->speed), false);
1902
+ ProtoSize::add_bool_field(total_size, 1, this->has_oscillating, false);
1903
+ ProtoSize::add_bool_field(total_size, 1, this->oscillating, false);
1904
+ ProtoSize::add_bool_field(total_size, 1, this->has_direction, false);
1905
+ ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->direction), false);
1906
+ ProtoSize::add_bool_field(total_size, 1, this->has_speed_level, false);
1907
+ ProtoSize::add_int32_field(total_size, 1, this->speed_level, false);
1908
+ ProtoSize::add_bool_field(total_size, 1, this->has_preset_mode, false);
1909
+ ProtoSize::add_string_field(total_size, 1, this->preset_mode, false);
1910
+ }
1734
1911
  #ifdef HAS_PROTO_MESSAGE_DUMP
1735
1912
  void FanCommandRequest::dump_to(std::string &out) const {
1736
1913
  __attribute__((unused)) char buffer[64];
@@ -1890,6 +2067,31 @@ void ListEntitiesLightResponse::encode(ProtoWriteBuffer buffer) const {
1890
2067
  buffer.encode_string(14, this->icon);
1891
2068
  buffer.encode_enum<enums::EntityCategory>(15, this->entity_category);
1892
2069
  }
2070
+ void ListEntitiesLightResponse::calculate_size(uint32_t &total_size) const {
2071
+ ProtoSize::add_string_field(total_size, 1, this->object_id, false);
2072
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
2073
+ ProtoSize::add_string_field(total_size, 1, this->name, false);
2074
+ ProtoSize::add_string_field(total_size, 1, this->unique_id, false);
2075
+ if (!this->supported_color_modes.empty()) {
2076
+ for (const auto &it : this->supported_color_modes) {
2077
+ ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(it), true);
2078
+ }
2079
+ }
2080
+ ProtoSize::add_bool_field(total_size, 1, this->legacy_supports_brightness, false);
2081
+ ProtoSize::add_bool_field(total_size, 1, this->legacy_supports_rgb, false);
2082
+ ProtoSize::add_bool_field(total_size, 1, this->legacy_supports_white_value, false);
2083
+ ProtoSize::add_bool_field(total_size, 1, this->legacy_supports_color_temperature, false);
2084
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->min_mireds != 0.0f, false);
2085
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->max_mireds != 0.0f, false);
2086
+ if (!this->effects.empty()) {
2087
+ for (const auto &it : this->effects) {
2088
+ ProtoSize::add_string_field(total_size, 1, it, true);
2089
+ }
2090
+ }
2091
+ ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false);
2092
+ ProtoSize::add_string_field(total_size, 1, this->icon, false);
2093
+ ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false);
2094
+ }
1893
2095
  #ifdef HAS_PROTO_MESSAGE_DUMP
1894
2096
  void ListEntitiesLightResponse::dump_to(std::string &out) const {
1895
2097
  __attribute__((unused)) char buffer[64];
@@ -2048,6 +2250,21 @@ void LightStateResponse::encode(ProtoWriteBuffer buffer) const {
2048
2250
  buffer.encode_float(13, this->warm_white);
2049
2251
  buffer.encode_string(9, this->effect);
2050
2252
  }
2253
+ void LightStateResponse::calculate_size(uint32_t &total_size) const {
2254
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
2255
+ ProtoSize::add_bool_field(total_size, 1, this->state, false);
2256
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->brightness != 0.0f, false);
2257
+ ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->color_mode), false);
2258
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->color_brightness != 0.0f, false);
2259
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->red != 0.0f, false);
2260
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->green != 0.0f, false);
2261
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->blue != 0.0f, false);
2262
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->white != 0.0f, false);
2263
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->color_temperature != 0.0f, false);
2264
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->cold_white != 0.0f, false);
2265
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->warm_white != 0.0f, false);
2266
+ ProtoSize::add_string_field(total_size, 1, this->effect, false);
2267
+ }
2051
2268
  #ifdef HAS_PROTO_MESSAGE_DUMP
2052
2269
  void LightStateResponse::dump_to(std::string &out) const {
2053
2270
  __attribute__((unused)) char buffer[64];
@@ -2271,6 +2488,35 @@ void LightCommandRequest::encode(ProtoWriteBuffer buffer) const {
2271
2488
  buffer.encode_bool(18, this->has_effect);
2272
2489
  buffer.encode_string(19, this->effect);
2273
2490
  }
2491
+ void LightCommandRequest::calculate_size(uint32_t &total_size) const {
2492
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
2493
+ ProtoSize::add_bool_field(total_size, 1, this->has_state, false);
2494
+ ProtoSize::add_bool_field(total_size, 1, this->state, false);
2495
+ ProtoSize::add_bool_field(total_size, 1, this->has_brightness, false);
2496
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->brightness != 0.0f, false);
2497
+ ProtoSize::add_bool_field(total_size, 2, this->has_color_mode, false);
2498
+ ProtoSize::add_enum_field(total_size, 2, static_cast<uint32_t>(this->color_mode), false);
2499
+ ProtoSize::add_bool_field(total_size, 2, this->has_color_brightness, false);
2500
+ ProtoSize::add_fixed_field<4>(total_size, 2, this->color_brightness != 0.0f, false);
2501
+ ProtoSize::add_bool_field(total_size, 1, this->has_rgb, false);
2502
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->red != 0.0f, false);
2503
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->green != 0.0f, false);
2504
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->blue != 0.0f, false);
2505
+ ProtoSize::add_bool_field(total_size, 1, this->has_white, false);
2506
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->white != 0.0f, false);
2507
+ ProtoSize::add_bool_field(total_size, 1, this->has_color_temperature, false);
2508
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->color_temperature != 0.0f, false);
2509
+ ProtoSize::add_bool_field(total_size, 2, this->has_cold_white, false);
2510
+ ProtoSize::add_fixed_field<4>(total_size, 2, this->cold_white != 0.0f, false);
2511
+ ProtoSize::add_bool_field(total_size, 2, this->has_warm_white, false);
2512
+ ProtoSize::add_fixed_field<4>(total_size, 2, this->warm_white != 0.0f, false);
2513
+ ProtoSize::add_bool_field(total_size, 1, this->has_transition_length, false);
2514
+ ProtoSize::add_uint32_field(total_size, 1, this->transition_length, false);
2515
+ ProtoSize::add_bool_field(total_size, 2, this->has_flash_length, false);
2516
+ ProtoSize::add_uint32_field(total_size, 2, this->flash_length, false);
2517
+ ProtoSize::add_bool_field(total_size, 2, this->has_effect, false);
2518
+ ProtoSize::add_string_field(total_size, 2, this->effect, false);
2519
+ }
2274
2520
  #ifdef HAS_PROTO_MESSAGE_DUMP
2275
2521
  void LightCommandRequest::dump_to(std::string &out) const {
2276
2522
  __attribute__((unused)) char buffer[64];
@@ -2482,6 +2728,21 @@ void ListEntitiesSensorResponse::encode(ProtoWriteBuffer buffer) const {
2482
2728
  buffer.encode_bool(12, this->disabled_by_default);
2483
2729
  buffer.encode_enum<enums::EntityCategory>(13, this->entity_category);
2484
2730
  }
2731
+ void ListEntitiesSensorResponse::calculate_size(uint32_t &total_size) const {
2732
+ ProtoSize::add_string_field(total_size, 1, this->object_id, false);
2733
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
2734
+ ProtoSize::add_string_field(total_size, 1, this->name, false);
2735
+ ProtoSize::add_string_field(total_size, 1, this->unique_id, false);
2736
+ ProtoSize::add_string_field(total_size, 1, this->icon, false);
2737
+ ProtoSize::add_string_field(total_size, 1, this->unit_of_measurement, false);
2738
+ ProtoSize::add_int32_field(total_size, 1, this->accuracy_decimals, false);
2739
+ ProtoSize::add_bool_field(total_size, 1, this->force_update, false);
2740
+ ProtoSize::add_string_field(total_size, 1, this->device_class, false);
2741
+ ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->state_class), false);
2742
+ ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->legacy_last_reset_type), false);
2743
+ ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false);
2744
+ ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false);
2745
+ }
2485
2746
  #ifdef HAS_PROTO_MESSAGE_DUMP
2486
2747
  void ListEntitiesSensorResponse::dump_to(std::string &out) const {
2487
2748
  __attribute__((unused)) char buffer[64];
@@ -2571,6 +2832,11 @@ void SensorStateResponse::encode(ProtoWriteBuffer buffer) const {
2571
2832
  buffer.encode_float(2, this->state);
2572
2833
  buffer.encode_bool(3, this->missing_state);
2573
2834
  }
2835
+ void SensorStateResponse::calculate_size(uint32_t &total_size) const {
2836
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
2837
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->state != 0.0f, false);
2838
+ ProtoSize::add_bool_field(total_size, 1, this->missing_state, false);
2839
+ }
2574
2840
  #ifdef HAS_PROTO_MESSAGE_DUMP
2575
2841
  void SensorStateResponse::dump_to(std::string &out) const {
2576
2842
  __attribute__((unused)) char buffer[64];
@@ -2656,6 +2922,17 @@ void ListEntitiesSwitchResponse::encode(ProtoWriteBuffer buffer) const {
2656
2922
  buffer.encode_enum<enums::EntityCategory>(8, this->entity_category);
2657
2923
  buffer.encode_string(9, this->device_class);
2658
2924
  }
2925
+ void ListEntitiesSwitchResponse::calculate_size(uint32_t &total_size) const {
2926
+ ProtoSize::add_string_field(total_size, 1, this->object_id, false);
2927
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
2928
+ ProtoSize::add_string_field(total_size, 1, this->name, false);
2929
+ ProtoSize::add_string_field(total_size, 1, this->unique_id, false);
2930
+ ProtoSize::add_string_field(total_size, 1, this->icon, false);
2931
+ ProtoSize::add_bool_field(total_size, 1, this->assumed_state, false);
2932
+ ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false);
2933
+ ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false);
2934
+ ProtoSize::add_string_field(total_size, 1, this->device_class, false);
2935
+ }
2659
2936
  #ifdef HAS_PROTO_MESSAGE_DUMP
2660
2937
  void ListEntitiesSwitchResponse::dump_to(std::string &out) const {
2661
2938
  __attribute__((unused)) char buffer[64];
@@ -2723,6 +3000,10 @@ void SwitchStateResponse::encode(ProtoWriteBuffer buffer) const {
2723
3000
  buffer.encode_fixed32(1, this->key);
2724
3001
  buffer.encode_bool(2, this->state);
2725
3002
  }
3003
+ void SwitchStateResponse::calculate_size(uint32_t &total_size) const {
3004
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
3005
+ ProtoSize::add_bool_field(total_size, 1, this->state, false);
3006
+ }
2726
3007
  #ifdef HAS_PROTO_MESSAGE_DUMP
2727
3008
  void SwitchStateResponse::dump_to(std::string &out) const {
2728
3009
  __attribute__((unused)) char buffer[64];
@@ -2762,6 +3043,10 @@ void SwitchCommandRequest::encode(ProtoWriteBuffer buffer) const {
2762
3043
  buffer.encode_fixed32(1, this->key);
2763
3044
  buffer.encode_bool(2, this->state);
2764
3045
  }
3046
+ void SwitchCommandRequest::calculate_size(uint32_t &total_size) const {
3047
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
3048
+ ProtoSize::add_bool_field(total_size, 1, this->state, false);
3049
+ }
2765
3050
  #ifdef HAS_PROTO_MESSAGE_DUMP
2766
3051
  void SwitchCommandRequest::dump_to(std::string &out) const {
2767
3052
  __attribute__((unused)) char buffer[64];
@@ -2837,6 +3122,16 @@ void ListEntitiesTextSensorResponse::encode(ProtoWriteBuffer buffer) const {
2837
3122
  buffer.encode_enum<enums::EntityCategory>(7, this->entity_category);
2838
3123
  buffer.encode_string(8, this->device_class);
2839
3124
  }
3125
+ void ListEntitiesTextSensorResponse::calculate_size(uint32_t &total_size) const {
3126
+ ProtoSize::add_string_field(total_size, 1, this->object_id, false);
3127
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
3128
+ ProtoSize::add_string_field(total_size, 1, this->name, false);
3129
+ ProtoSize::add_string_field(total_size, 1, this->unique_id, false);
3130
+ ProtoSize::add_string_field(total_size, 1, this->icon, false);
3131
+ ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false);
3132
+ ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false);
3133
+ ProtoSize::add_string_field(total_size, 1, this->device_class, false);
3134
+ }
2840
3135
  #ifdef HAS_PROTO_MESSAGE_DUMP
2841
3136
  void ListEntitiesTextSensorResponse::dump_to(std::string &out) const {
2842
3137
  __attribute__((unused)) char buffer[64];
@@ -2911,6 +3206,11 @@ void TextSensorStateResponse::encode(ProtoWriteBuffer buffer) const {
2911
3206
  buffer.encode_string(2, this->state);
2912
3207
  buffer.encode_bool(3, this->missing_state);
2913
3208
  }
3209
+ void TextSensorStateResponse::calculate_size(uint32_t &total_size) const {
3210
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
3211
+ ProtoSize::add_string_field(total_size, 1, this->state, false);
3212
+ ProtoSize::add_bool_field(total_size, 1, this->missing_state, false);
3213
+ }
2914
3214
  #ifdef HAS_PROTO_MESSAGE_DUMP
2915
3215
  void TextSensorStateResponse::dump_to(std::string &out) const {
2916
3216
  __attribute__((unused)) char buffer[64];
@@ -2948,6 +3248,10 @@ void SubscribeLogsRequest::encode(ProtoWriteBuffer buffer) const {
2948
3248
  buffer.encode_enum<enums::LogLevel>(1, this->level);
2949
3249
  buffer.encode_bool(2, this->dump_config);
2950
3250
  }
3251
+ void SubscribeLogsRequest::calculate_size(uint32_t &total_size) const {
3252
+ ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->level), false);
3253
+ ProtoSize::add_bool_field(total_size, 1, this->dump_config, false);
3254
+ }
2951
3255
  #ifdef HAS_PROTO_MESSAGE_DUMP
2952
3256
  void SubscribeLogsRequest::dump_to(std::string &out) const {
2953
3257
  __attribute__((unused)) char buffer[64];
@@ -2991,6 +3295,11 @@ void SubscribeLogsResponse::encode(ProtoWriteBuffer buffer) const {
2991
3295
  buffer.encode_string(3, this->message);
2992
3296
  buffer.encode_bool(4, this->send_failed);
2993
3297
  }
3298
+ void SubscribeLogsResponse::calculate_size(uint32_t &total_size) const {
3299
+ ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->level), false);
3300
+ ProtoSize::add_string_field(total_size, 1, this->message, false);
3301
+ ProtoSize::add_bool_field(total_size, 1, this->send_failed, false);
3302
+ }
2994
3303
  #ifdef HAS_PROTO_MESSAGE_DUMP
2995
3304
  void SubscribeLogsResponse::dump_to(std::string &out) const {
2996
3305
  __attribute__((unused)) char buffer[64];
@@ -3009,7 +3318,56 @@ void SubscribeLogsResponse::dump_to(std::string &out) const {
3009
3318
  out.append("}");
3010
3319
  }
3011
3320
  #endif
3321
+ bool NoiseEncryptionSetKeyRequest::decode_length(uint32_t field_id, ProtoLengthDelimited value) {
3322
+ switch (field_id) {
3323
+ case 1: {
3324
+ this->key = value.as_string();
3325
+ return true;
3326
+ }
3327
+ default:
3328
+ return false;
3329
+ }
3330
+ }
3331
+ void NoiseEncryptionSetKeyRequest::encode(ProtoWriteBuffer buffer) const { buffer.encode_string(1, this->key); }
3332
+ void NoiseEncryptionSetKeyRequest::calculate_size(uint32_t &total_size) const {
3333
+ ProtoSize::add_string_field(total_size, 1, this->key, false);
3334
+ }
3335
+ #ifdef HAS_PROTO_MESSAGE_DUMP
3336
+ void NoiseEncryptionSetKeyRequest::dump_to(std::string &out) const {
3337
+ __attribute__((unused)) char buffer[64];
3338
+ out.append("NoiseEncryptionSetKeyRequest {\n");
3339
+ out.append(" key: ");
3340
+ out.append("'").append(this->key).append("'");
3341
+ out.append("\n");
3342
+ out.append("}");
3343
+ }
3344
+ #endif
3345
+ bool NoiseEncryptionSetKeyResponse::decode_varint(uint32_t field_id, ProtoVarInt value) {
3346
+ switch (field_id) {
3347
+ case 1: {
3348
+ this->success = value.as_bool();
3349
+ return true;
3350
+ }
3351
+ default:
3352
+ return false;
3353
+ }
3354
+ }
3355
+ void NoiseEncryptionSetKeyResponse::encode(ProtoWriteBuffer buffer) const { buffer.encode_bool(1, this->success); }
3356
+ void NoiseEncryptionSetKeyResponse::calculate_size(uint32_t &total_size) const {
3357
+ ProtoSize::add_bool_field(total_size, 1, this->success, false);
3358
+ }
3359
+ #ifdef HAS_PROTO_MESSAGE_DUMP
3360
+ void NoiseEncryptionSetKeyResponse::dump_to(std::string &out) const {
3361
+ __attribute__((unused)) char buffer[64];
3362
+ out.append("NoiseEncryptionSetKeyResponse {\n");
3363
+ out.append(" success: ");
3364
+ out.append(YESNO(this->success));
3365
+ out.append("\n");
3366
+ out.append("}");
3367
+ }
3368
+ #endif
3012
3369
  void SubscribeHomeassistantServicesRequest::encode(ProtoWriteBuffer buffer) const {}
3370
+ void SubscribeHomeassistantServicesRequest::calculate_size(uint32_t &total_size) const {}
3013
3371
  #ifdef HAS_PROTO_MESSAGE_DUMP
3014
3372
  void SubscribeHomeassistantServicesRequest::dump_to(std::string &out) const {
3015
3373
  out.append("SubscribeHomeassistantServicesRequest {}");
@@ -3033,6 +3391,10 @@ void HomeassistantServiceMap::encode(ProtoWriteBuffer buffer) const {
3033
3391
  buffer.encode_string(1, this->key);
3034
3392
  buffer.encode_string(2, this->value);
3035
3393
  }
3394
+ void HomeassistantServiceMap::calculate_size(uint32_t &total_size) const {
3395
+ ProtoSize::add_string_field(total_size, 1, this->key, false);
3396
+ ProtoSize::add_string_field(total_size, 1, this->value, false);
3397
+ }
3036
3398
  #ifdef HAS_PROTO_MESSAGE_DUMP
3037
3399
  void HomeassistantServiceMap::dump_to(std::string &out) const {
3038
3400
  __attribute__((unused)) char buffer[64];
@@ -3092,6 +3454,13 @@ void HomeassistantServiceResponse::encode(ProtoWriteBuffer buffer) const {
3092
3454
  }
3093
3455
  buffer.encode_bool(5, this->is_event);
3094
3456
  }
3457
+ void HomeassistantServiceResponse::calculate_size(uint32_t &total_size) const {
3458
+ ProtoSize::add_string_field(total_size, 1, this->service, false);
3459
+ ProtoSize::add_repeated_message(total_size, 1, this->data);
3460
+ ProtoSize::add_repeated_message(total_size, 1, this->data_template);
3461
+ ProtoSize::add_repeated_message(total_size, 1, this->variables);
3462
+ ProtoSize::add_bool_field(total_size, 1, this->is_event, false);
3463
+ }
3095
3464
  #ifdef HAS_PROTO_MESSAGE_DUMP
3096
3465
  void HomeassistantServiceResponse::dump_to(std::string &out) const {
3097
3466
  __attribute__((unused)) char buffer[64];
@@ -3125,6 +3494,7 @@ void HomeassistantServiceResponse::dump_to(std::string &out) const {
3125
3494
  }
3126
3495
  #endif
3127
3496
  void SubscribeHomeAssistantStatesRequest::encode(ProtoWriteBuffer buffer) const {}
3497
+ void SubscribeHomeAssistantStatesRequest::calculate_size(uint32_t &total_size) const {}
3128
3498
  #ifdef HAS_PROTO_MESSAGE_DUMP
3129
3499
  void SubscribeHomeAssistantStatesRequest::dump_to(std::string &out) const {
3130
3500
  out.append("SubscribeHomeAssistantStatesRequest {}");
@@ -3159,6 +3529,11 @@ void SubscribeHomeAssistantStateResponse::encode(ProtoWriteBuffer buffer) const
3159
3529
  buffer.encode_string(2, this->attribute);
3160
3530
  buffer.encode_bool(3, this->once);
3161
3531
  }
3532
+ void SubscribeHomeAssistantStateResponse::calculate_size(uint32_t &total_size) const {
3533
+ ProtoSize::add_string_field(total_size, 1, this->entity_id, false);
3534
+ ProtoSize::add_string_field(total_size, 1, this->attribute, false);
3535
+ ProtoSize::add_bool_field(total_size, 1, this->once, false);
3536
+ }
3162
3537
  #ifdef HAS_PROTO_MESSAGE_DUMP
3163
3538
  void SubscribeHomeAssistantStateResponse::dump_to(std::string &out) const {
3164
3539
  __attribute__((unused)) char buffer[64];
@@ -3200,6 +3575,11 @@ void HomeAssistantStateResponse::encode(ProtoWriteBuffer buffer) const {
3200
3575
  buffer.encode_string(2, this->state);
3201
3576
  buffer.encode_string(3, this->attribute);
3202
3577
  }
3578
+ void HomeAssistantStateResponse::calculate_size(uint32_t &total_size) const {
3579
+ ProtoSize::add_string_field(total_size, 1, this->entity_id, false);
3580
+ ProtoSize::add_string_field(total_size, 1, this->state, false);
3581
+ ProtoSize::add_string_field(total_size, 1, this->attribute, false);
3582
+ }
3203
3583
  #ifdef HAS_PROTO_MESSAGE_DUMP
3204
3584
  void HomeAssistantStateResponse::dump_to(std::string &out) const {
3205
3585
  __attribute__((unused)) char buffer[64];
@@ -3219,6 +3599,7 @@ void HomeAssistantStateResponse::dump_to(std::string &out) const {
3219
3599
  }
3220
3600
  #endif
3221
3601
  void GetTimeRequest::encode(ProtoWriteBuffer buffer) const {}
3602
+ void GetTimeRequest::calculate_size(uint32_t &total_size) const {}
3222
3603
  #ifdef HAS_PROTO_MESSAGE_DUMP
3223
3604
  void GetTimeRequest::dump_to(std::string &out) const { out.append("GetTimeRequest {}"); }
3224
3605
  #endif
@@ -3233,6 +3614,9 @@ bool GetTimeResponse::decode_32bit(uint32_t field_id, Proto32Bit value) {
3233
3614
  }
3234
3615
  }
3235
3616
  void GetTimeResponse::encode(ProtoWriteBuffer buffer) const { buffer.encode_fixed32(1, this->epoch_seconds); }
3617
+ void GetTimeResponse::calculate_size(uint32_t &total_size) const {
3618
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->epoch_seconds != 0, false);
3619
+ }
3236
3620
  #ifdef HAS_PROTO_MESSAGE_DUMP
3237
3621
  void GetTimeResponse::dump_to(std::string &out) const {
3238
3622
  __attribute__((unused)) char buffer[64];
@@ -3268,6 +3652,10 @@ void ListEntitiesServicesArgument::encode(ProtoWriteBuffer buffer) const {
3268
3652
  buffer.encode_string(1, this->name);
3269
3653
  buffer.encode_enum<enums::ServiceArgType>(2, this->type);
3270
3654
  }
3655
+ void ListEntitiesServicesArgument::calculate_size(uint32_t &total_size) const {
3656
+ ProtoSize::add_string_field(total_size, 1, this->name, false);
3657
+ ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->type), false);
3658
+ }
3271
3659
  #ifdef HAS_PROTO_MESSAGE_DUMP
3272
3660
  void ListEntitiesServicesArgument::dump_to(std::string &out) const {
3273
3661
  __attribute__((unused)) char buffer[64];
@@ -3313,6 +3701,11 @@ void ListEntitiesServicesResponse::encode(ProtoWriteBuffer buffer) const {
3313
3701
  buffer.encode_message<ListEntitiesServicesArgument>(3, it, true);
3314
3702
  }
3315
3703
  }
3704
+ void ListEntitiesServicesResponse::calculate_size(uint32_t &total_size) const {
3705
+ ProtoSize::add_string_field(total_size, 1, this->name, false);
3706
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
3707
+ ProtoSize::add_repeated_message(total_size, 1, this->args);
3708
+ }
3316
3709
  #ifdef HAS_PROTO_MESSAGE_DUMP
3317
3710
  void ListEntitiesServicesResponse::dump_to(std::string &out) const {
3318
3711
  __attribute__((unused)) char buffer[64];
@@ -3407,6 +3800,33 @@ void ExecuteServiceArgument::encode(ProtoWriteBuffer buffer) const {
3407
3800
  buffer.encode_string(9, it, true);
3408
3801
  }
3409
3802
  }
3803
+ void ExecuteServiceArgument::calculate_size(uint32_t &total_size) const {
3804
+ ProtoSize::add_bool_field(total_size, 1, this->bool_, false);
3805
+ ProtoSize::add_int32_field(total_size, 1, this->legacy_int, false);
3806
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->float_ != 0.0f, false);
3807
+ ProtoSize::add_string_field(total_size, 1, this->string_, false);
3808
+ ProtoSize::add_sint32_field(total_size, 1, this->int_, false);
3809
+ if (!this->bool_array.empty()) {
3810
+ for (const auto it : this->bool_array) {
3811
+ ProtoSize::add_bool_field(total_size, 1, it, true);
3812
+ }
3813
+ }
3814
+ if (!this->int_array.empty()) {
3815
+ for (const auto &it : this->int_array) {
3816
+ ProtoSize::add_sint32_field(total_size, 1, it, true);
3817
+ }
3818
+ }
3819
+ if (!this->float_array.empty()) {
3820
+ for (const auto &it : this->float_array) {
3821
+ ProtoSize::add_fixed_field<4>(total_size, 1, it != 0.0f, true);
3822
+ }
3823
+ }
3824
+ if (!this->string_array.empty()) {
3825
+ for (const auto &it : this->string_array) {
3826
+ ProtoSize::add_string_field(total_size, 1, it, true);
3827
+ }
3828
+ }
3829
+ }
3410
3830
  #ifdef HAS_PROTO_MESSAGE_DUMP
3411
3831
  void ExecuteServiceArgument::dump_to(std::string &out) const {
3412
3832
  __attribute__((unused)) char buffer[64];
@@ -3488,6 +3908,10 @@ void ExecuteServiceRequest::encode(ProtoWriteBuffer buffer) const {
3488
3908
  buffer.encode_message<ExecuteServiceArgument>(2, it, true);
3489
3909
  }
3490
3910
  }
3911
+ void ExecuteServiceRequest::calculate_size(uint32_t &total_size) const {
3912
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
3913
+ ProtoSize::add_repeated_message(total_size, 1, this->args);
3914
+ }
3491
3915
  #ifdef HAS_PROTO_MESSAGE_DUMP
3492
3916
  void ExecuteServiceRequest::dump_to(std::string &out) const {
3493
3917
  __attribute__((unused)) char buffer[64];
@@ -3560,6 +3984,15 @@ void ListEntitiesCameraResponse::encode(ProtoWriteBuffer buffer) const {
3560
3984
  buffer.encode_string(6, this->icon);
3561
3985
  buffer.encode_enum<enums::EntityCategory>(7, this->entity_category);
3562
3986
  }
3987
+ void ListEntitiesCameraResponse::calculate_size(uint32_t &total_size) const {
3988
+ ProtoSize::add_string_field(total_size, 1, this->object_id, false);
3989
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
3990
+ ProtoSize::add_string_field(total_size, 1, this->name, false);
3991
+ ProtoSize::add_string_field(total_size, 1, this->unique_id, false);
3992
+ ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false);
3993
+ ProtoSize::add_string_field(total_size, 1, this->icon, false);
3994
+ ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false);
3995
+ }
3563
3996
  #ifdef HAS_PROTO_MESSAGE_DUMP
3564
3997
  void ListEntitiesCameraResponse::dump_to(std::string &out) const {
3565
3998
  __attribute__((unused)) char buffer[64];
@@ -3630,6 +4063,11 @@ void CameraImageResponse::encode(ProtoWriteBuffer buffer) const {
3630
4063
  buffer.encode_string(2, this->data);
3631
4064
  buffer.encode_bool(3, this->done);
3632
4065
  }
4066
+ void CameraImageResponse::calculate_size(uint32_t &total_size) const {
4067
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
4068
+ ProtoSize::add_string_field(total_size, 1, this->data, false);
4069
+ ProtoSize::add_bool_field(total_size, 1, this->done, false);
4070
+ }
3633
4071
  #ifdef HAS_PROTO_MESSAGE_DUMP
3634
4072
  void CameraImageResponse::dump_to(std::string &out) const {
3635
4073
  __attribute__((unused)) char buffer[64];
@@ -3667,6 +4105,10 @@ void CameraImageRequest::encode(ProtoWriteBuffer buffer) const {
3667
4105
  buffer.encode_bool(1, this->single);
3668
4106
  buffer.encode_bool(2, this->stream);
3669
4107
  }
4108
+ void CameraImageRequest::calculate_size(uint32_t &total_size) const {
4109
+ ProtoSize::add_bool_field(total_size, 1, this->single, false);
4110
+ ProtoSize::add_bool_field(total_size, 1, this->stream, false);
4111
+ }
3670
4112
  #ifdef HAS_PROTO_MESSAGE_DUMP
3671
4113
  void CameraImageRequest::dump_to(std::string &out) const {
3672
4114
  __attribute__((unused)) char buffer[64];
@@ -3838,6 +4280,57 @@ void ListEntitiesClimateResponse::encode(ProtoWriteBuffer buffer) const {
3838
4280
  buffer.encode_float(24, this->visual_min_humidity);
3839
4281
  buffer.encode_float(25, this->visual_max_humidity);
3840
4282
  }
4283
+ void ListEntitiesClimateResponse::calculate_size(uint32_t &total_size) const {
4284
+ ProtoSize::add_string_field(total_size, 1, this->object_id, false);
4285
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
4286
+ ProtoSize::add_string_field(total_size, 1, this->name, false);
4287
+ ProtoSize::add_string_field(total_size, 1, this->unique_id, false);
4288
+ ProtoSize::add_bool_field(total_size, 1, this->supports_current_temperature, false);
4289
+ ProtoSize::add_bool_field(total_size, 1, this->supports_two_point_target_temperature, false);
4290
+ if (!this->supported_modes.empty()) {
4291
+ for (const auto &it : this->supported_modes) {
4292
+ ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(it), true);
4293
+ }
4294
+ }
4295
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->visual_min_temperature != 0.0f, false);
4296
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->visual_max_temperature != 0.0f, false);
4297
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->visual_target_temperature_step != 0.0f, false);
4298
+ ProtoSize::add_bool_field(total_size, 1, this->legacy_supports_away, false);
4299
+ ProtoSize::add_bool_field(total_size, 1, this->supports_action, false);
4300
+ if (!this->supported_fan_modes.empty()) {
4301
+ for (const auto &it : this->supported_fan_modes) {
4302
+ ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(it), true);
4303
+ }
4304
+ }
4305
+ if (!this->supported_swing_modes.empty()) {
4306
+ for (const auto &it : this->supported_swing_modes) {
4307
+ ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(it), true);
4308
+ }
4309
+ }
4310
+ if (!this->supported_custom_fan_modes.empty()) {
4311
+ for (const auto &it : this->supported_custom_fan_modes) {
4312
+ ProtoSize::add_string_field(total_size, 1, it, true);
4313
+ }
4314
+ }
4315
+ if (!this->supported_presets.empty()) {
4316
+ for (const auto &it : this->supported_presets) {
4317
+ ProtoSize::add_enum_field(total_size, 2, static_cast<uint32_t>(it), true);
4318
+ }
4319
+ }
4320
+ if (!this->supported_custom_presets.empty()) {
4321
+ for (const auto &it : this->supported_custom_presets) {
4322
+ ProtoSize::add_string_field(total_size, 2, it, true);
4323
+ }
4324
+ }
4325
+ ProtoSize::add_bool_field(total_size, 2, this->disabled_by_default, false);
4326
+ ProtoSize::add_string_field(total_size, 2, this->icon, false);
4327
+ ProtoSize::add_enum_field(total_size, 2, static_cast<uint32_t>(this->entity_category), false);
4328
+ ProtoSize::add_fixed_field<4>(total_size, 2, this->visual_current_temperature_step != 0.0f, false);
4329
+ ProtoSize::add_bool_field(total_size, 2, this->supports_current_humidity, false);
4330
+ ProtoSize::add_bool_field(total_size, 2, this->supports_target_humidity, false);
4331
+ ProtoSize::add_fixed_field<4>(total_size, 2, this->visual_min_humidity != 0.0f, false);
4332
+ ProtoSize::add_fixed_field<4>(total_size, 2, this->visual_max_humidity != 0.0f, false);
4333
+ }
3841
4334
  #ifdef HAS_PROTO_MESSAGE_DUMP
3842
4335
  void ListEntitiesClimateResponse::dump_to(std::string &out) const {
3843
4336
  __attribute__((unused)) char buffer[64];
@@ -4058,6 +4551,23 @@ void ClimateStateResponse::encode(ProtoWriteBuffer buffer) const {
4058
4551
  buffer.encode_float(14, this->current_humidity);
4059
4552
  buffer.encode_float(15, this->target_humidity);
4060
4553
  }
4554
+ void ClimateStateResponse::calculate_size(uint32_t &total_size) const {
4555
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
4556
+ ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->mode), false);
4557
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->current_temperature != 0.0f, false);
4558
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->target_temperature != 0.0f, false);
4559
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->target_temperature_low != 0.0f, false);
4560
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->target_temperature_high != 0.0f, false);
4561
+ ProtoSize::add_bool_field(total_size, 1, this->unused_legacy_away, false);
4562
+ ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->action), false);
4563
+ ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->fan_mode), false);
4564
+ ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->swing_mode), false);
4565
+ ProtoSize::add_string_field(total_size, 1, this->custom_fan_mode, false);
4566
+ ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->preset), false);
4567
+ ProtoSize::add_string_field(total_size, 1, this->custom_preset, false);
4568
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->current_humidity != 0.0f, false);
4569
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->target_humidity != 0.0f, false);
4570
+ }
4061
4571
  #ifdef HAS_PROTO_MESSAGE_DUMP
4062
4572
  void ClimateStateResponse::dump_to(std::string &out) const {
4063
4573
  __attribute__((unused)) char buffer[64];
@@ -4266,6 +4776,31 @@ void ClimateCommandRequest::encode(ProtoWriteBuffer buffer) const {
4266
4776
  buffer.encode_bool(22, this->has_target_humidity);
4267
4777
  buffer.encode_float(23, this->target_humidity);
4268
4778
  }
4779
+ void ClimateCommandRequest::calculate_size(uint32_t &total_size) const {
4780
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
4781
+ ProtoSize::add_bool_field(total_size, 1, this->has_mode, false);
4782
+ ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->mode), false);
4783
+ ProtoSize::add_bool_field(total_size, 1, this->has_target_temperature, false);
4784
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->target_temperature != 0.0f, false);
4785
+ ProtoSize::add_bool_field(total_size, 1, this->has_target_temperature_low, false);
4786
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->target_temperature_low != 0.0f, false);
4787
+ ProtoSize::add_bool_field(total_size, 1, this->has_target_temperature_high, false);
4788
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->target_temperature_high != 0.0f, false);
4789
+ ProtoSize::add_bool_field(total_size, 1, this->unused_has_legacy_away, false);
4790
+ ProtoSize::add_bool_field(total_size, 1, this->unused_legacy_away, false);
4791
+ ProtoSize::add_bool_field(total_size, 1, this->has_fan_mode, false);
4792
+ ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->fan_mode), false);
4793
+ ProtoSize::add_bool_field(total_size, 1, this->has_swing_mode, false);
4794
+ ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->swing_mode), false);
4795
+ ProtoSize::add_bool_field(total_size, 2, this->has_custom_fan_mode, false);
4796
+ ProtoSize::add_string_field(total_size, 2, this->custom_fan_mode, false);
4797
+ ProtoSize::add_bool_field(total_size, 2, this->has_preset, false);
4798
+ ProtoSize::add_enum_field(total_size, 2, static_cast<uint32_t>(this->preset), false);
4799
+ ProtoSize::add_bool_field(total_size, 2, this->has_custom_preset, false);
4800
+ ProtoSize::add_string_field(total_size, 2, this->custom_preset, false);
4801
+ ProtoSize::add_bool_field(total_size, 2, this->has_target_humidity, false);
4802
+ ProtoSize::add_fixed_field<4>(total_size, 2, this->target_humidity != 0.0f, false);
4803
+ }
4269
4804
  #ifdef HAS_PROTO_MESSAGE_DUMP
4270
4805
  void ClimateCommandRequest::dump_to(std::string &out) const {
4271
4806
  __attribute__((unused)) char buffer[64];
@@ -4454,6 +4989,21 @@ void ListEntitiesNumberResponse::encode(ProtoWriteBuffer buffer) const {
4454
4989
  buffer.encode_enum<enums::NumberMode>(12, this->mode);
4455
4990
  buffer.encode_string(13, this->device_class);
4456
4991
  }
4992
+ void ListEntitiesNumberResponse::calculate_size(uint32_t &total_size) const {
4993
+ ProtoSize::add_string_field(total_size, 1, this->object_id, false);
4994
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
4995
+ ProtoSize::add_string_field(total_size, 1, this->name, false);
4996
+ ProtoSize::add_string_field(total_size, 1, this->unique_id, false);
4997
+ ProtoSize::add_string_field(total_size, 1, this->icon, false);
4998
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->min_value != 0.0f, false);
4999
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->max_value != 0.0f, false);
5000
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->step != 0.0f, false);
5001
+ ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false);
5002
+ ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false);
5003
+ ProtoSize::add_string_field(total_size, 1, this->unit_of_measurement, false);
5004
+ ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->mode), false);
5005
+ ProtoSize::add_string_field(total_size, 1, this->device_class, false);
5006
+ }
4457
5007
  #ifdef HAS_PROTO_MESSAGE_DUMP
4458
5008
  void ListEntitiesNumberResponse::dump_to(std::string &out) const {
4459
5009
  __attribute__((unused)) char buffer[64];
@@ -4545,6 +5095,11 @@ void NumberStateResponse::encode(ProtoWriteBuffer buffer) const {
4545
5095
  buffer.encode_float(2, this->state);
4546
5096
  buffer.encode_bool(3, this->missing_state);
4547
5097
  }
5098
+ void NumberStateResponse::calculate_size(uint32_t &total_size) const {
5099
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
5100
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->state != 0.0f, false);
5101
+ ProtoSize::add_bool_field(total_size, 1, this->missing_state, false);
5102
+ }
4548
5103
  #ifdef HAS_PROTO_MESSAGE_DUMP
4549
5104
  void NumberStateResponse::dump_to(std::string &out) const {
4550
5105
  __attribute__((unused)) char buffer[64];
@@ -4583,6 +5138,10 @@ void NumberCommandRequest::encode(ProtoWriteBuffer buffer) const {
4583
5138
  buffer.encode_fixed32(1, this->key);
4584
5139
  buffer.encode_float(2, this->state);
4585
5140
  }
5141
+ void NumberCommandRequest::calculate_size(uint32_t &total_size) const {
5142
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
5143
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->state != 0.0f, false);
5144
+ }
4586
5145
  #ifdef HAS_PROTO_MESSAGE_DUMP
4587
5146
  void NumberCommandRequest::dump_to(std::string &out) const {
4588
5147
  __attribute__((unused)) char buffer[64];
@@ -4661,6 +5220,20 @@ void ListEntitiesSelectResponse::encode(ProtoWriteBuffer buffer) const {
4661
5220
  buffer.encode_bool(7, this->disabled_by_default);
4662
5221
  buffer.encode_enum<enums::EntityCategory>(8, this->entity_category);
4663
5222
  }
5223
+ void ListEntitiesSelectResponse::calculate_size(uint32_t &total_size) const {
5224
+ ProtoSize::add_string_field(total_size, 1, this->object_id, false);
5225
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
5226
+ ProtoSize::add_string_field(total_size, 1, this->name, false);
5227
+ ProtoSize::add_string_field(total_size, 1, this->unique_id, false);
5228
+ ProtoSize::add_string_field(total_size, 1, this->icon, false);
5229
+ if (!this->options.empty()) {
5230
+ for (const auto &it : this->options) {
5231
+ ProtoSize::add_string_field(total_size, 1, it, true);
5232
+ }
5233
+ }
5234
+ ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false);
5235
+ ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false);
5236
+ }
4664
5237
  #ifdef HAS_PROTO_MESSAGE_DUMP
4665
5238
  void ListEntitiesSelectResponse::dump_to(std::string &out) const {
4666
5239
  __attribute__((unused)) char buffer[64];
@@ -4737,6 +5310,11 @@ void SelectStateResponse::encode(ProtoWriteBuffer buffer) const {
4737
5310
  buffer.encode_string(2, this->state);
4738
5311
  buffer.encode_bool(3, this->missing_state);
4739
5312
  }
5313
+ void SelectStateResponse::calculate_size(uint32_t &total_size) const {
5314
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
5315
+ ProtoSize::add_string_field(total_size, 1, this->state, false);
5316
+ ProtoSize::add_bool_field(total_size, 1, this->missing_state, false);
5317
+ }
4740
5318
  #ifdef HAS_PROTO_MESSAGE_DUMP
4741
5319
  void SelectStateResponse::dump_to(std::string &out) const {
4742
5320
  __attribute__((unused)) char buffer[64];
@@ -4780,6 +5358,10 @@ void SelectCommandRequest::encode(ProtoWriteBuffer buffer) const {
4780
5358
  buffer.encode_fixed32(1, this->key);
4781
5359
  buffer.encode_string(2, this->state);
4782
5360
  }
5361
+ void SelectCommandRequest::calculate_size(uint32_t &total_size) const {
5362
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
5363
+ ProtoSize::add_string_field(total_size, 1, this->state, false);
5364
+ }
4783
5365
  #ifdef HAS_PROTO_MESSAGE_DUMP
4784
5366
  void SelectCommandRequest::dump_to(std::string &out) const {
4785
5367
  __attribute__((unused)) char buffer[64];
@@ -4795,6 +5377,307 @@ void SelectCommandRequest::dump_to(std::string &out) const {
4795
5377
  out.append("}");
4796
5378
  }
4797
5379
  #endif
5380
+ bool ListEntitiesSirenResponse::decode_varint(uint32_t field_id, ProtoVarInt value) {
5381
+ switch (field_id) {
5382
+ case 6: {
5383
+ this->disabled_by_default = value.as_bool();
5384
+ return true;
5385
+ }
5386
+ case 8: {
5387
+ this->supports_duration = value.as_bool();
5388
+ return true;
5389
+ }
5390
+ case 9: {
5391
+ this->supports_volume = value.as_bool();
5392
+ return true;
5393
+ }
5394
+ case 10: {
5395
+ this->entity_category = value.as_enum<enums::EntityCategory>();
5396
+ return true;
5397
+ }
5398
+ default:
5399
+ return false;
5400
+ }
5401
+ }
5402
+ bool ListEntitiesSirenResponse::decode_length(uint32_t field_id, ProtoLengthDelimited value) {
5403
+ switch (field_id) {
5404
+ case 1: {
5405
+ this->object_id = value.as_string();
5406
+ return true;
5407
+ }
5408
+ case 3: {
5409
+ this->name = value.as_string();
5410
+ return true;
5411
+ }
5412
+ case 4: {
5413
+ this->unique_id = value.as_string();
5414
+ return true;
5415
+ }
5416
+ case 5: {
5417
+ this->icon = value.as_string();
5418
+ return true;
5419
+ }
5420
+ case 7: {
5421
+ this->tones.push_back(value.as_string());
5422
+ return true;
5423
+ }
5424
+ default:
5425
+ return false;
5426
+ }
5427
+ }
5428
+ bool ListEntitiesSirenResponse::decode_32bit(uint32_t field_id, Proto32Bit value) {
5429
+ switch (field_id) {
5430
+ case 2: {
5431
+ this->key = value.as_fixed32();
5432
+ return true;
5433
+ }
5434
+ default:
5435
+ return false;
5436
+ }
5437
+ }
5438
+ void ListEntitiesSirenResponse::encode(ProtoWriteBuffer buffer) const {
5439
+ buffer.encode_string(1, this->object_id);
5440
+ buffer.encode_fixed32(2, this->key);
5441
+ buffer.encode_string(3, this->name);
5442
+ buffer.encode_string(4, this->unique_id);
5443
+ buffer.encode_string(5, this->icon);
5444
+ buffer.encode_bool(6, this->disabled_by_default);
5445
+ for (auto &it : this->tones) {
5446
+ buffer.encode_string(7, it, true);
5447
+ }
5448
+ buffer.encode_bool(8, this->supports_duration);
5449
+ buffer.encode_bool(9, this->supports_volume);
5450
+ buffer.encode_enum<enums::EntityCategory>(10, this->entity_category);
5451
+ }
5452
+ void ListEntitiesSirenResponse::calculate_size(uint32_t &total_size) const {
5453
+ ProtoSize::add_string_field(total_size, 1, this->object_id, false);
5454
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
5455
+ ProtoSize::add_string_field(total_size, 1, this->name, false);
5456
+ ProtoSize::add_string_field(total_size, 1, this->unique_id, false);
5457
+ ProtoSize::add_string_field(total_size, 1, this->icon, false);
5458
+ ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false);
5459
+ if (!this->tones.empty()) {
5460
+ for (const auto &it : this->tones) {
5461
+ ProtoSize::add_string_field(total_size, 1, it, true);
5462
+ }
5463
+ }
5464
+ ProtoSize::add_bool_field(total_size, 1, this->supports_duration, false);
5465
+ ProtoSize::add_bool_field(total_size, 1, this->supports_volume, false);
5466
+ ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false);
5467
+ }
5468
+ #ifdef HAS_PROTO_MESSAGE_DUMP
5469
+ void ListEntitiesSirenResponse::dump_to(std::string &out) const {
5470
+ __attribute__((unused)) char buffer[64];
5471
+ out.append("ListEntitiesSirenResponse {\n");
5472
+ out.append(" object_id: ");
5473
+ out.append("'").append(this->object_id).append("'");
5474
+ out.append("\n");
5475
+
5476
+ out.append(" key: ");
5477
+ sprintf(buffer, "%" PRIu32, this->key);
5478
+ out.append(buffer);
5479
+ out.append("\n");
5480
+
5481
+ out.append(" name: ");
5482
+ out.append("'").append(this->name).append("'");
5483
+ out.append("\n");
5484
+
5485
+ out.append(" unique_id: ");
5486
+ out.append("'").append(this->unique_id).append("'");
5487
+ out.append("\n");
5488
+
5489
+ out.append(" icon: ");
5490
+ out.append("'").append(this->icon).append("'");
5491
+ out.append("\n");
5492
+
5493
+ out.append(" disabled_by_default: ");
5494
+ out.append(YESNO(this->disabled_by_default));
5495
+ out.append("\n");
5496
+
5497
+ for (const auto &it : this->tones) {
5498
+ out.append(" tones: ");
5499
+ out.append("'").append(it).append("'");
5500
+ out.append("\n");
5501
+ }
5502
+
5503
+ out.append(" supports_duration: ");
5504
+ out.append(YESNO(this->supports_duration));
5505
+ out.append("\n");
5506
+
5507
+ out.append(" supports_volume: ");
5508
+ out.append(YESNO(this->supports_volume));
5509
+ out.append("\n");
5510
+
5511
+ out.append(" entity_category: ");
5512
+ out.append(proto_enum_to_string<enums::EntityCategory>(this->entity_category));
5513
+ out.append("\n");
5514
+ out.append("}");
5515
+ }
5516
+ #endif
5517
+ bool SirenStateResponse::decode_varint(uint32_t field_id, ProtoVarInt value) {
5518
+ switch (field_id) {
5519
+ case 2: {
5520
+ this->state = value.as_bool();
5521
+ return true;
5522
+ }
5523
+ default:
5524
+ return false;
5525
+ }
5526
+ }
5527
+ bool SirenStateResponse::decode_32bit(uint32_t field_id, Proto32Bit value) {
5528
+ switch (field_id) {
5529
+ case 1: {
5530
+ this->key = value.as_fixed32();
5531
+ return true;
5532
+ }
5533
+ default:
5534
+ return false;
5535
+ }
5536
+ }
5537
+ void SirenStateResponse::encode(ProtoWriteBuffer buffer) const {
5538
+ buffer.encode_fixed32(1, this->key);
5539
+ buffer.encode_bool(2, this->state);
5540
+ }
5541
+ void SirenStateResponse::calculate_size(uint32_t &total_size) const {
5542
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
5543
+ ProtoSize::add_bool_field(total_size, 1, this->state, false);
5544
+ }
5545
+ #ifdef HAS_PROTO_MESSAGE_DUMP
5546
+ void SirenStateResponse::dump_to(std::string &out) const {
5547
+ __attribute__((unused)) char buffer[64];
5548
+ out.append("SirenStateResponse {\n");
5549
+ out.append(" key: ");
5550
+ sprintf(buffer, "%" PRIu32, this->key);
5551
+ out.append(buffer);
5552
+ out.append("\n");
5553
+
5554
+ out.append(" state: ");
5555
+ out.append(YESNO(this->state));
5556
+ out.append("\n");
5557
+ out.append("}");
5558
+ }
5559
+ #endif
5560
+ bool SirenCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
5561
+ switch (field_id) {
5562
+ case 2: {
5563
+ this->has_state = value.as_bool();
5564
+ return true;
5565
+ }
5566
+ case 3: {
5567
+ this->state = value.as_bool();
5568
+ return true;
5569
+ }
5570
+ case 4: {
5571
+ this->has_tone = value.as_bool();
5572
+ return true;
5573
+ }
5574
+ case 6: {
5575
+ this->has_duration = value.as_bool();
5576
+ return true;
5577
+ }
5578
+ case 7: {
5579
+ this->duration = value.as_uint32();
5580
+ return true;
5581
+ }
5582
+ case 8: {
5583
+ this->has_volume = value.as_bool();
5584
+ return true;
5585
+ }
5586
+ default:
5587
+ return false;
5588
+ }
5589
+ }
5590
+ bool SirenCommandRequest::decode_length(uint32_t field_id, ProtoLengthDelimited value) {
5591
+ switch (field_id) {
5592
+ case 5: {
5593
+ this->tone = value.as_string();
5594
+ return true;
5595
+ }
5596
+ default:
5597
+ return false;
5598
+ }
5599
+ }
5600
+ bool SirenCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
5601
+ switch (field_id) {
5602
+ case 1: {
5603
+ this->key = value.as_fixed32();
5604
+ return true;
5605
+ }
5606
+ case 9: {
5607
+ this->volume = value.as_float();
5608
+ return true;
5609
+ }
5610
+ default:
5611
+ return false;
5612
+ }
5613
+ }
5614
+ void SirenCommandRequest::encode(ProtoWriteBuffer buffer) const {
5615
+ buffer.encode_fixed32(1, this->key);
5616
+ buffer.encode_bool(2, this->has_state);
5617
+ buffer.encode_bool(3, this->state);
5618
+ buffer.encode_bool(4, this->has_tone);
5619
+ buffer.encode_string(5, this->tone);
5620
+ buffer.encode_bool(6, this->has_duration);
5621
+ buffer.encode_uint32(7, this->duration);
5622
+ buffer.encode_bool(8, this->has_volume);
5623
+ buffer.encode_float(9, this->volume);
5624
+ }
5625
+ void SirenCommandRequest::calculate_size(uint32_t &total_size) const {
5626
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
5627
+ ProtoSize::add_bool_field(total_size, 1, this->has_state, false);
5628
+ ProtoSize::add_bool_field(total_size, 1, this->state, false);
5629
+ ProtoSize::add_bool_field(total_size, 1, this->has_tone, false);
5630
+ ProtoSize::add_string_field(total_size, 1, this->tone, false);
5631
+ ProtoSize::add_bool_field(total_size, 1, this->has_duration, false);
5632
+ ProtoSize::add_uint32_field(total_size, 1, this->duration, false);
5633
+ ProtoSize::add_bool_field(total_size, 1, this->has_volume, false);
5634
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->volume != 0.0f, false);
5635
+ }
5636
+ #ifdef HAS_PROTO_MESSAGE_DUMP
5637
+ void SirenCommandRequest::dump_to(std::string &out) const {
5638
+ __attribute__((unused)) char buffer[64];
5639
+ out.append("SirenCommandRequest {\n");
5640
+ out.append(" key: ");
5641
+ sprintf(buffer, "%" PRIu32, this->key);
5642
+ out.append(buffer);
5643
+ out.append("\n");
5644
+
5645
+ out.append(" has_state: ");
5646
+ out.append(YESNO(this->has_state));
5647
+ out.append("\n");
5648
+
5649
+ out.append(" state: ");
5650
+ out.append(YESNO(this->state));
5651
+ out.append("\n");
5652
+
5653
+ out.append(" has_tone: ");
5654
+ out.append(YESNO(this->has_tone));
5655
+ out.append("\n");
5656
+
5657
+ out.append(" tone: ");
5658
+ out.append("'").append(this->tone).append("'");
5659
+ out.append("\n");
5660
+
5661
+ out.append(" has_duration: ");
5662
+ out.append(YESNO(this->has_duration));
5663
+ out.append("\n");
5664
+
5665
+ out.append(" duration: ");
5666
+ sprintf(buffer, "%" PRIu32, this->duration);
5667
+ out.append(buffer);
5668
+ out.append("\n");
5669
+
5670
+ out.append(" has_volume: ");
5671
+ out.append(YESNO(this->has_volume));
5672
+ out.append("\n");
5673
+
5674
+ out.append(" volume: ");
5675
+ sprintf(buffer, "%g", this->volume);
5676
+ out.append(buffer);
5677
+ out.append("\n");
5678
+ out.append("}");
5679
+ }
5680
+ #endif
4798
5681
  bool ListEntitiesLockResponse::decode_varint(uint32_t field_id, ProtoVarInt value) {
4799
5682
  switch (field_id) {
4800
5683
  case 6: {
@@ -4870,6 +5753,19 @@ void ListEntitiesLockResponse::encode(ProtoWriteBuffer buffer) const {
4870
5753
  buffer.encode_bool(10, this->requires_code);
4871
5754
  buffer.encode_string(11, this->code_format);
4872
5755
  }
5756
+ void ListEntitiesLockResponse::calculate_size(uint32_t &total_size) const {
5757
+ ProtoSize::add_string_field(total_size, 1, this->object_id, false);
5758
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
5759
+ ProtoSize::add_string_field(total_size, 1, this->name, false);
5760
+ ProtoSize::add_string_field(total_size, 1, this->unique_id, false);
5761
+ ProtoSize::add_string_field(total_size, 1, this->icon, false);
5762
+ ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false);
5763
+ ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false);
5764
+ ProtoSize::add_bool_field(total_size, 1, this->assumed_state, false);
5765
+ ProtoSize::add_bool_field(total_size, 1, this->supports_open, false);
5766
+ ProtoSize::add_bool_field(total_size, 1, this->requires_code, false);
5767
+ ProtoSize::add_string_field(total_size, 1, this->code_format, false);
5768
+ }
4873
5769
  #ifdef HAS_PROTO_MESSAGE_DUMP
4874
5770
  void ListEntitiesLockResponse::dump_to(std::string &out) const {
4875
5771
  __attribute__((unused)) char buffer[64];
@@ -4945,6 +5841,10 @@ void LockStateResponse::encode(ProtoWriteBuffer buffer) const {
4945
5841
  buffer.encode_fixed32(1, this->key);
4946
5842
  buffer.encode_enum<enums::LockState>(2, this->state);
4947
5843
  }
5844
+ void LockStateResponse::calculate_size(uint32_t &total_size) const {
5845
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
5846
+ ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->state), false);
5847
+ }
4948
5848
  #ifdef HAS_PROTO_MESSAGE_DUMP
4949
5849
  void LockStateResponse::dump_to(std::string &out) const {
4950
5850
  __attribute__((unused)) char buffer[64];
@@ -5000,6 +5900,12 @@ void LockCommandRequest::encode(ProtoWriteBuffer buffer) const {
5000
5900
  buffer.encode_bool(3, this->has_code);
5001
5901
  buffer.encode_string(4, this->code);
5002
5902
  }
5903
+ void LockCommandRequest::calculate_size(uint32_t &total_size) const {
5904
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
5905
+ ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->command), false);
5906
+ ProtoSize::add_bool_field(total_size, 1, this->has_code, false);
5907
+ ProtoSize::add_string_field(total_size, 1, this->code, false);
5908
+ }
5003
5909
  #ifdef HAS_PROTO_MESSAGE_DUMP
5004
5910
  void LockCommandRequest::dump_to(std::string &out) const {
5005
5911
  __attribute__((unused)) char buffer[64];
@@ -5083,6 +5989,16 @@ void ListEntitiesButtonResponse::encode(ProtoWriteBuffer buffer) const {
5083
5989
  buffer.encode_enum<enums::EntityCategory>(7, this->entity_category);
5084
5990
  buffer.encode_string(8, this->device_class);
5085
5991
  }
5992
+ void ListEntitiesButtonResponse::calculate_size(uint32_t &total_size) const {
5993
+ ProtoSize::add_string_field(total_size, 1, this->object_id, false);
5994
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
5995
+ ProtoSize::add_string_field(total_size, 1, this->name, false);
5996
+ ProtoSize::add_string_field(total_size, 1, this->unique_id, false);
5997
+ ProtoSize::add_string_field(total_size, 1, this->icon, false);
5998
+ ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false);
5999
+ ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false);
6000
+ ProtoSize::add_string_field(total_size, 1, this->device_class, false);
6001
+ }
5086
6002
  #ifdef HAS_PROTO_MESSAGE_DUMP
5087
6003
  void ListEntitiesButtonResponse::dump_to(std::string &out) const {
5088
6004
  __attribute__((unused)) char buffer[64];
@@ -5133,6 +6049,9 @@ bool ButtonCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
5133
6049
  }
5134
6050
  }
5135
6051
  void ButtonCommandRequest::encode(ProtoWriteBuffer buffer) const { buffer.encode_fixed32(1, this->key); }
6052
+ void ButtonCommandRequest::calculate_size(uint32_t &total_size) const {
6053
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
6054
+ }
5136
6055
  #ifdef HAS_PROTO_MESSAGE_DUMP
5137
6056
  void ButtonCommandRequest::dump_to(std::string &out) const {
5138
6057
  __attribute__((unused)) char buffer[64];
@@ -5183,6 +6102,13 @@ void MediaPlayerSupportedFormat::encode(ProtoWriteBuffer buffer) const {
5183
6102
  buffer.encode_enum<enums::MediaPlayerFormatPurpose>(4, this->purpose);
5184
6103
  buffer.encode_uint32(5, this->sample_bytes);
5185
6104
  }
6105
+ void MediaPlayerSupportedFormat::calculate_size(uint32_t &total_size) const {
6106
+ ProtoSize::add_string_field(total_size, 1, this->format, false);
6107
+ ProtoSize::add_uint32_field(total_size, 1, this->sample_rate, false);
6108
+ ProtoSize::add_uint32_field(total_size, 1, this->num_channels, false);
6109
+ ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->purpose), false);
6110
+ ProtoSize::add_uint32_field(total_size, 1, this->sample_bytes, false);
6111
+ }
5186
6112
  #ifdef HAS_PROTO_MESSAGE_DUMP
5187
6113
  void MediaPlayerSupportedFormat::dump_to(std::string &out) const {
5188
6114
  __attribute__((unused)) char buffer[64];
@@ -5279,6 +6205,17 @@ void ListEntitiesMediaPlayerResponse::encode(ProtoWriteBuffer buffer) const {
5279
6205
  buffer.encode_message<MediaPlayerSupportedFormat>(9, it, true);
5280
6206
  }
5281
6207
  }
6208
+ void ListEntitiesMediaPlayerResponse::calculate_size(uint32_t &total_size) const {
6209
+ ProtoSize::add_string_field(total_size, 1, this->object_id, false);
6210
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
6211
+ ProtoSize::add_string_field(total_size, 1, this->name, false);
6212
+ ProtoSize::add_string_field(total_size, 1, this->unique_id, false);
6213
+ ProtoSize::add_string_field(total_size, 1, this->icon, false);
6214
+ ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false);
6215
+ ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false);
6216
+ ProtoSize::add_bool_field(total_size, 1, this->supports_pause, false);
6217
+ ProtoSize::add_repeated_message(total_size, 1, this->supported_formats);
6218
+ }
5282
6219
  #ifdef HAS_PROTO_MESSAGE_DUMP
5283
6220
  void ListEntitiesMediaPlayerResponse::dump_to(std::string &out) const {
5284
6221
  __attribute__((unused)) char buffer[64];
@@ -5358,6 +6295,12 @@ void MediaPlayerStateResponse::encode(ProtoWriteBuffer buffer) const {
5358
6295
  buffer.encode_float(3, this->volume);
5359
6296
  buffer.encode_bool(4, this->muted);
5360
6297
  }
6298
+ void MediaPlayerStateResponse::calculate_size(uint32_t &total_size) const {
6299
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
6300
+ ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->state), false);
6301
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->volume != 0.0f, false);
6302
+ ProtoSize::add_bool_field(total_size, 1, this->muted, false);
6303
+ }
5361
6304
  #ifdef HAS_PROTO_MESSAGE_DUMP
5362
6305
  void MediaPlayerStateResponse::dump_to(std::string &out) const {
5363
6306
  __attribute__((unused)) char buffer[64];
@@ -5447,6 +6390,17 @@ void MediaPlayerCommandRequest::encode(ProtoWriteBuffer buffer) const {
5447
6390
  buffer.encode_bool(8, this->has_announcement);
5448
6391
  buffer.encode_bool(9, this->announcement);
5449
6392
  }
6393
+ void MediaPlayerCommandRequest::calculate_size(uint32_t &total_size) const {
6394
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
6395
+ ProtoSize::add_bool_field(total_size, 1, this->has_command, false);
6396
+ ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->command), false);
6397
+ ProtoSize::add_bool_field(total_size, 1, this->has_volume, false);
6398
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->volume != 0.0f, false);
6399
+ ProtoSize::add_bool_field(total_size, 1, this->has_media_url, false);
6400
+ ProtoSize::add_string_field(total_size, 1, this->media_url, false);
6401
+ ProtoSize::add_bool_field(total_size, 1, this->has_announcement, false);
6402
+ ProtoSize::add_bool_field(total_size, 1, this->announcement, false);
6403
+ }
5450
6404
  #ifdef HAS_PROTO_MESSAGE_DUMP
5451
6405
  void MediaPlayerCommandRequest::dump_to(std::string &out) const {
5452
6406
  __attribute__((unused)) char buffer[64];
@@ -5504,6 +6458,9 @@ bool SubscribeBluetoothLEAdvertisementsRequest::decode_varint(uint32_t field_id,
5504
6458
  void SubscribeBluetoothLEAdvertisementsRequest::encode(ProtoWriteBuffer buffer) const {
5505
6459
  buffer.encode_uint32(1, this->flags);
5506
6460
  }
6461
+ void SubscribeBluetoothLEAdvertisementsRequest::calculate_size(uint32_t &total_size) const {
6462
+ ProtoSize::add_uint32_field(total_size, 1, this->flags, false);
6463
+ }
5507
6464
  #ifdef HAS_PROTO_MESSAGE_DUMP
5508
6465
  void SubscribeBluetoothLEAdvertisementsRequest::dump_to(std::string &out) const {
5509
6466
  __attribute__((unused)) char buffer[64];
@@ -5546,6 +6503,15 @@ void BluetoothServiceData::encode(ProtoWriteBuffer buffer) const {
5546
6503
  }
5547
6504
  buffer.encode_string(3, this->data);
5548
6505
  }
6506
+ void BluetoothServiceData::calculate_size(uint32_t &total_size) const {
6507
+ ProtoSize::add_string_field(total_size, 1, this->uuid, false);
6508
+ if (!this->legacy_data.empty()) {
6509
+ for (const auto &it : this->legacy_data) {
6510
+ ProtoSize::add_uint32_field(total_size, 1, it, true);
6511
+ }
6512
+ }
6513
+ ProtoSize::add_string_field(total_size, 1, this->data, false);
6514
+ }
5549
6515
  #ifdef HAS_PROTO_MESSAGE_DUMP
5550
6516
  void BluetoothServiceData::dump_to(std::string &out) const {
5551
6517
  __attribute__((unused)) char buffer[64];
@@ -5622,6 +6588,19 @@ void BluetoothLEAdvertisementResponse::encode(ProtoWriteBuffer buffer) const {
5622
6588
  }
5623
6589
  buffer.encode_uint32(7, this->address_type);
5624
6590
  }
6591
+ void BluetoothLEAdvertisementResponse::calculate_size(uint32_t &total_size) const {
6592
+ ProtoSize::add_uint64_field(total_size, 1, this->address, false);
6593
+ ProtoSize::add_string_field(total_size, 1, this->name, false);
6594
+ ProtoSize::add_sint32_field(total_size, 1, this->rssi, false);
6595
+ if (!this->service_uuids.empty()) {
6596
+ for (const auto &it : this->service_uuids) {
6597
+ ProtoSize::add_string_field(total_size, 1, it, true);
6598
+ }
6599
+ }
6600
+ ProtoSize::add_repeated_message(total_size, 1, this->service_data);
6601
+ ProtoSize::add_repeated_message(total_size, 1, this->manufacturer_data);
6602
+ ProtoSize::add_uint32_field(total_size, 1, this->address_type, false);
6603
+ }
5625
6604
  #ifdef HAS_PROTO_MESSAGE_DUMP
5626
6605
  void BluetoothLEAdvertisementResponse::dump_to(std::string &out) const {
5627
6606
  __attribute__((unused)) char buffer[64];
@@ -5699,6 +6678,12 @@ void BluetoothLERawAdvertisement::encode(ProtoWriteBuffer buffer) const {
5699
6678
  buffer.encode_uint32(3, this->address_type);
5700
6679
  buffer.encode_string(4, this->data);
5701
6680
  }
6681
+ void BluetoothLERawAdvertisement::calculate_size(uint32_t &total_size) const {
6682
+ ProtoSize::add_uint64_field(total_size, 1, this->address, false);
6683
+ ProtoSize::add_sint32_field(total_size, 1, this->rssi, false);
6684
+ ProtoSize::add_uint32_field(total_size, 1, this->address_type, false);
6685
+ ProtoSize::add_string_field(total_size, 1, this->data, false);
6686
+ }
5702
6687
  #ifdef HAS_PROTO_MESSAGE_DUMP
5703
6688
  void BluetoothLERawAdvertisement::dump_to(std::string &out) const {
5704
6689
  __attribute__((unused)) char buffer[64];
@@ -5739,6 +6724,9 @@ void BluetoothLERawAdvertisementsResponse::encode(ProtoWriteBuffer buffer) const
5739
6724
  buffer.encode_message<BluetoothLERawAdvertisement>(1, it, true);
5740
6725
  }
5741
6726
  }
6727
+ void BluetoothLERawAdvertisementsResponse::calculate_size(uint32_t &total_size) const {
6728
+ ProtoSize::add_repeated_message(total_size, 1, this->advertisements);
6729
+ }
5742
6730
  #ifdef HAS_PROTO_MESSAGE_DUMP
5743
6731
  void BluetoothLERawAdvertisementsResponse::dump_to(std::string &out) const {
5744
6732
  __attribute__((unused)) char buffer[64];
@@ -5779,6 +6767,12 @@ void BluetoothDeviceRequest::encode(ProtoWriteBuffer buffer) const {
5779
6767
  buffer.encode_bool(3, this->has_address_type);
5780
6768
  buffer.encode_uint32(4, this->address_type);
5781
6769
  }
6770
+ void BluetoothDeviceRequest::calculate_size(uint32_t &total_size) const {
6771
+ ProtoSize::add_uint64_field(total_size, 1, this->address, false);
6772
+ ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->request_type), false);
6773
+ ProtoSize::add_bool_field(total_size, 1, this->has_address_type, false);
6774
+ ProtoSize::add_uint32_field(total_size, 1, this->address_type, false);
6775
+ }
5782
6776
  #ifdef HAS_PROTO_MESSAGE_DUMP
5783
6777
  void BluetoothDeviceRequest::dump_to(std::string &out) const {
5784
6778
  __attribute__((unused)) char buffer[64];
@@ -5831,6 +6825,12 @@ void BluetoothDeviceConnectionResponse::encode(ProtoWriteBuffer buffer) const {
5831
6825
  buffer.encode_uint32(3, this->mtu);
5832
6826
  buffer.encode_int32(4, this->error);
5833
6827
  }
6828
+ void BluetoothDeviceConnectionResponse::calculate_size(uint32_t &total_size) const {
6829
+ ProtoSize::add_uint64_field(total_size, 1, this->address, false);
6830
+ ProtoSize::add_bool_field(total_size, 1, this->connected, false);
6831
+ ProtoSize::add_uint32_field(total_size, 1, this->mtu, false);
6832
+ ProtoSize::add_int32_field(total_size, 1, this->error, false);
6833
+ }
5834
6834
  #ifdef HAS_PROTO_MESSAGE_DUMP
5835
6835
  void BluetoothDeviceConnectionResponse::dump_to(std::string &out) const {
5836
6836
  __attribute__((unused)) char buffer[64];
@@ -5867,6 +6867,9 @@ bool BluetoothGATTGetServicesRequest::decode_varint(uint32_t field_id, ProtoVarI
5867
6867
  }
5868
6868
  }
5869
6869
  void BluetoothGATTGetServicesRequest::encode(ProtoWriteBuffer buffer) const { buffer.encode_uint64(1, this->address); }
6870
+ void BluetoothGATTGetServicesRequest::calculate_size(uint32_t &total_size) const {
6871
+ ProtoSize::add_uint64_field(total_size, 1, this->address, false);
6872
+ }
5870
6873
  #ifdef HAS_PROTO_MESSAGE_DUMP
5871
6874
  void BluetoothGATTGetServicesRequest::dump_to(std::string &out) const {
5872
6875
  __attribute__((unused)) char buffer[64];
@@ -5898,6 +6901,14 @@ void BluetoothGATTDescriptor::encode(ProtoWriteBuffer buffer) const {
5898
6901
  }
5899
6902
  buffer.encode_uint32(2, this->handle);
5900
6903
  }
6904
+ void BluetoothGATTDescriptor::calculate_size(uint32_t &total_size) const {
6905
+ if (!this->uuid.empty()) {
6906
+ for (const auto &it : this->uuid) {
6907
+ ProtoSize::add_uint64_field(total_size, 1, it, true);
6908
+ }
6909
+ }
6910
+ ProtoSize::add_uint32_field(total_size, 1, this->handle, false);
6911
+ }
5901
6912
  #ifdef HAS_PROTO_MESSAGE_DUMP
5902
6913
  void BluetoothGATTDescriptor::dump_to(std::string &out) const {
5903
6914
  __attribute__((unused)) char buffer[64];
@@ -5954,6 +6965,16 @@ void BluetoothGATTCharacteristic::encode(ProtoWriteBuffer buffer) const {
5954
6965
  buffer.encode_message<BluetoothGATTDescriptor>(4, it, true);
5955
6966
  }
5956
6967
  }
6968
+ void BluetoothGATTCharacteristic::calculate_size(uint32_t &total_size) const {
6969
+ if (!this->uuid.empty()) {
6970
+ for (const auto &it : this->uuid) {
6971
+ ProtoSize::add_uint64_field(total_size, 1, it, true);
6972
+ }
6973
+ }
6974
+ ProtoSize::add_uint32_field(total_size, 1, this->handle, false);
6975
+ ProtoSize::add_uint32_field(total_size, 1, this->properties, false);
6976
+ ProtoSize::add_repeated_message(total_size, 1, this->descriptors);
6977
+ }
5957
6978
  #ifdef HAS_PROTO_MESSAGE_DUMP
5958
6979
  void BluetoothGATTCharacteristic::dump_to(std::string &out) const {
5959
6980
  __attribute__((unused)) char buffer[64];
@@ -6016,6 +7037,15 @@ void BluetoothGATTService::encode(ProtoWriteBuffer buffer) const {
6016
7037
  buffer.encode_message<BluetoothGATTCharacteristic>(3, it, true);
6017
7038
  }
6018
7039
  }
7040
+ void BluetoothGATTService::calculate_size(uint32_t &total_size) const {
7041
+ if (!this->uuid.empty()) {
7042
+ for (const auto &it : this->uuid) {
7043
+ ProtoSize::add_uint64_field(total_size, 1, it, true);
7044
+ }
7045
+ }
7046
+ ProtoSize::add_uint32_field(total_size, 1, this->handle, false);
7047
+ ProtoSize::add_repeated_message(total_size, 1, this->characteristics);
7048
+ }
6019
7049
  #ifdef HAS_PROTO_MESSAGE_DUMP
6020
7050
  void BluetoothGATTService::dump_to(std::string &out) const {
6021
7051
  __attribute__((unused)) char buffer[64];
@@ -6066,6 +7096,10 @@ void BluetoothGATTGetServicesResponse::encode(ProtoWriteBuffer buffer) const {
6066
7096
  buffer.encode_message<BluetoothGATTService>(2, it, true);
6067
7097
  }
6068
7098
  }
7099
+ void BluetoothGATTGetServicesResponse::calculate_size(uint32_t &total_size) const {
7100
+ ProtoSize::add_uint64_field(total_size, 1, this->address, false);
7101
+ ProtoSize::add_repeated_message(total_size, 1, this->services);
7102
+ }
6069
7103
  #ifdef HAS_PROTO_MESSAGE_DUMP
6070
7104
  void BluetoothGATTGetServicesResponse::dump_to(std::string &out) const {
6071
7105
  __attribute__((unused)) char buffer[64];
@@ -6096,6 +7130,9 @@ bool BluetoothGATTGetServicesDoneResponse::decode_varint(uint32_t field_id, Prot
6096
7130
  void BluetoothGATTGetServicesDoneResponse::encode(ProtoWriteBuffer buffer) const {
6097
7131
  buffer.encode_uint64(1, this->address);
6098
7132
  }
7133
+ void BluetoothGATTGetServicesDoneResponse::calculate_size(uint32_t &total_size) const {
7134
+ ProtoSize::add_uint64_field(total_size, 1, this->address, false);
7135
+ }
6099
7136
  #ifdef HAS_PROTO_MESSAGE_DUMP
6100
7137
  void BluetoothGATTGetServicesDoneResponse::dump_to(std::string &out) const {
6101
7138
  __attribute__((unused)) char buffer[64];
@@ -6125,6 +7162,10 @@ void BluetoothGATTReadRequest::encode(ProtoWriteBuffer buffer) const {
6125
7162
  buffer.encode_uint64(1, this->address);
6126
7163
  buffer.encode_uint32(2, this->handle);
6127
7164
  }
7165
+ void BluetoothGATTReadRequest::calculate_size(uint32_t &total_size) const {
7166
+ ProtoSize::add_uint64_field(total_size, 1, this->address, false);
7167
+ ProtoSize::add_uint32_field(total_size, 1, this->handle, false);
7168
+ }
6128
7169
  #ifdef HAS_PROTO_MESSAGE_DUMP
6129
7170
  void BluetoothGATTReadRequest::dump_to(std::string &out) const {
6130
7171
  __attribute__((unused)) char buffer[64];
@@ -6170,6 +7211,11 @@ void BluetoothGATTReadResponse::encode(ProtoWriteBuffer buffer) const {
6170
7211
  buffer.encode_uint32(2, this->handle);
6171
7212
  buffer.encode_string(3, this->data);
6172
7213
  }
7214
+ void BluetoothGATTReadResponse::calculate_size(uint32_t &total_size) const {
7215
+ ProtoSize::add_uint64_field(total_size, 1, this->address, false);
7216
+ ProtoSize::add_uint32_field(total_size, 1, this->handle, false);
7217
+ ProtoSize::add_string_field(total_size, 1, this->data, false);
7218
+ }
6173
7219
  #ifdef HAS_PROTO_MESSAGE_DUMP
6174
7220
  void BluetoothGATTReadResponse::dump_to(std::string &out) const {
6175
7221
  __attribute__((unused)) char buffer[64];
@@ -6224,6 +7270,12 @@ void BluetoothGATTWriteRequest::encode(ProtoWriteBuffer buffer) const {
6224
7270
  buffer.encode_bool(3, this->response);
6225
7271
  buffer.encode_string(4, this->data);
6226
7272
  }
7273
+ void BluetoothGATTWriteRequest::calculate_size(uint32_t &total_size) const {
7274
+ ProtoSize::add_uint64_field(total_size, 1, this->address, false);
7275
+ ProtoSize::add_uint32_field(total_size, 1, this->handle, false);
7276
+ ProtoSize::add_bool_field(total_size, 1, this->response, false);
7277
+ ProtoSize::add_string_field(total_size, 1, this->data, false);
7278
+ }
6227
7279
  #ifdef HAS_PROTO_MESSAGE_DUMP
6228
7280
  void BluetoothGATTWriteRequest::dump_to(std::string &out) const {
6229
7281
  __attribute__((unused)) char buffer[64];
@@ -6266,6 +7318,10 @@ void BluetoothGATTReadDescriptorRequest::encode(ProtoWriteBuffer buffer) const {
6266
7318
  buffer.encode_uint64(1, this->address);
6267
7319
  buffer.encode_uint32(2, this->handle);
6268
7320
  }
7321
+ void BluetoothGATTReadDescriptorRequest::calculate_size(uint32_t &total_size) const {
7322
+ ProtoSize::add_uint64_field(total_size, 1, this->address, false);
7323
+ ProtoSize::add_uint32_field(total_size, 1, this->handle, false);
7324
+ }
6269
7325
  #ifdef HAS_PROTO_MESSAGE_DUMP
6270
7326
  void BluetoothGATTReadDescriptorRequest::dump_to(std::string &out) const {
6271
7327
  __attribute__((unused)) char buffer[64];
@@ -6311,6 +7367,11 @@ void BluetoothGATTWriteDescriptorRequest::encode(ProtoWriteBuffer buffer) const
6311
7367
  buffer.encode_uint32(2, this->handle);
6312
7368
  buffer.encode_string(3, this->data);
6313
7369
  }
7370
+ void BluetoothGATTWriteDescriptorRequest::calculate_size(uint32_t &total_size) const {
7371
+ ProtoSize::add_uint64_field(total_size, 1, this->address, false);
7372
+ ProtoSize::add_uint32_field(total_size, 1, this->handle, false);
7373
+ ProtoSize::add_string_field(total_size, 1, this->data, false);
7374
+ }
6314
7375
  #ifdef HAS_PROTO_MESSAGE_DUMP
6315
7376
  void BluetoothGATTWriteDescriptorRequest::dump_to(std::string &out) const {
6316
7377
  __attribute__((unused)) char buffer[64];
@@ -6354,6 +7415,11 @@ void BluetoothGATTNotifyRequest::encode(ProtoWriteBuffer buffer) const {
6354
7415
  buffer.encode_uint32(2, this->handle);
6355
7416
  buffer.encode_bool(3, this->enable);
6356
7417
  }
7418
+ void BluetoothGATTNotifyRequest::calculate_size(uint32_t &total_size) const {
7419
+ ProtoSize::add_uint64_field(total_size, 1, this->address, false);
7420
+ ProtoSize::add_uint32_field(total_size, 1, this->handle, false);
7421
+ ProtoSize::add_bool_field(total_size, 1, this->enable, false);
7422
+ }
6357
7423
  #ifdef HAS_PROTO_MESSAGE_DUMP
6358
7424
  void BluetoothGATTNotifyRequest::dump_to(std::string &out) const {
6359
7425
  __attribute__((unused)) char buffer[64];
@@ -6403,6 +7469,11 @@ void BluetoothGATTNotifyDataResponse::encode(ProtoWriteBuffer buffer) const {
6403
7469
  buffer.encode_uint32(2, this->handle);
6404
7470
  buffer.encode_string(3, this->data);
6405
7471
  }
7472
+ void BluetoothGATTNotifyDataResponse::calculate_size(uint32_t &total_size) const {
7473
+ ProtoSize::add_uint64_field(total_size, 1, this->address, false);
7474
+ ProtoSize::add_uint32_field(total_size, 1, this->handle, false);
7475
+ ProtoSize::add_string_field(total_size, 1, this->data, false);
7476
+ }
6406
7477
  #ifdef HAS_PROTO_MESSAGE_DUMP
6407
7478
  void BluetoothGATTNotifyDataResponse::dump_to(std::string &out) const {
6408
7479
  __attribute__((unused)) char buffer[64];
@@ -6424,6 +7495,7 @@ void BluetoothGATTNotifyDataResponse::dump_to(std::string &out) const {
6424
7495
  }
6425
7496
  #endif
6426
7497
  void SubscribeBluetoothConnectionsFreeRequest::encode(ProtoWriteBuffer buffer) const {}
7498
+ void SubscribeBluetoothConnectionsFreeRequest::calculate_size(uint32_t &total_size) const {}
6427
7499
  #ifdef HAS_PROTO_MESSAGE_DUMP
6428
7500
  void SubscribeBluetoothConnectionsFreeRequest::dump_to(std::string &out) const {
6429
7501
  out.append("SubscribeBluetoothConnectionsFreeRequest {}");
@@ -6454,6 +7526,15 @@ void BluetoothConnectionsFreeResponse::encode(ProtoWriteBuffer buffer) const {
6454
7526
  buffer.encode_uint64(3, it, true);
6455
7527
  }
6456
7528
  }
7529
+ void BluetoothConnectionsFreeResponse::calculate_size(uint32_t &total_size) const {
7530
+ ProtoSize::add_uint32_field(total_size, 1, this->free, false);
7531
+ ProtoSize::add_uint32_field(total_size, 1, this->limit, false);
7532
+ if (!this->allocated.empty()) {
7533
+ for (const auto &it : this->allocated) {
7534
+ ProtoSize::add_uint64_field(total_size, 1, it, true);
7535
+ }
7536
+ }
7537
+ }
6457
7538
  #ifdef HAS_PROTO_MESSAGE_DUMP
6458
7539
  void BluetoothConnectionsFreeResponse::dump_to(std::string &out) const {
6459
7540
  __attribute__((unused)) char buffer[64];
@@ -6500,6 +7581,11 @@ void BluetoothGATTErrorResponse::encode(ProtoWriteBuffer buffer) const {
6500
7581
  buffer.encode_uint32(2, this->handle);
6501
7582
  buffer.encode_int32(3, this->error);
6502
7583
  }
7584
+ void BluetoothGATTErrorResponse::calculate_size(uint32_t &total_size) const {
7585
+ ProtoSize::add_uint64_field(total_size, 1, this->address, false);
7586
+ ProtoSize::add_uint32_field(total_size, 1, this->handle, false);
7587
+ ProtoSize::add_int32_field(total_size, 1, this->error, false);
7588
+ }
6503
7589
  #ifdef HAS_PROTO_MESSAGE_DUMP
6504
7590
  void BluetoothGATTErrorResponse::dump_to(std::string &out) const {
6505
7591
  __attribute__((unused)) char buffer[64];
@@ -6539,6 +7625,10 @@ void BluetoothGATTWriteResponse::encode(ProtoWriteBuffer buffer) const {
6539
7625
  buffer.encode_uint64(1, this->address);
6540
7626
  buffer.encode_uint32(2, this->handle);
6541
7627
  }
7628
+ void BluetoothGATTWriteResponse::calculate_size(uint32_t &total_size) const {
7629
+ ProtoSize::add_uint64_field(total_size, 1, this->address, false);
7630
+ ProtoSize::add_uint32_field(total_size, 1, this->handle, false);
7631
+ }
6542
7632
  #ifdef HAS_PROTO_MESSAGE_DUMP
6543
7633
  void BluetoothGATTWriteResponse::dump_to(std::string &out) const {
6544
7634
  __attribute__((unused)) char buffer[64];
@@ -6573,6 +7663,10 @@ void BluetoothGATTNotifyResponse::encode(ProtoWriteBuffer buffer) const {
6573
7663
  buffer.encode_uint64(1, this->address);
6574
7664
  buffer.encode_uint32(2, this->handle);
6575
7665
  }
7666
+ void BluetoothGATTNotifyResponse::calculate_size(uint32_t &total_size) const {
7667
+ ProtoSize::add_uint64_field(total_size, 1, this->address, false);
7668
+ ProtoSize::add_uint32_field(total_size, 1, this->handle, false);
7669
+ }
6576
7670
  #ifdef HAS_PROTO_MESSAGE_DUMP
6577
7671
  void BluetoothGATTNotifyResponse::dump_to(std::string &out) const {
6578
7672
  __attribute__((unused)) char buffer[64];
@@ -6612,6 +7706,11 @@ void BluetoothDevicePairingResponse::encode(ProtoWriteBuffer buffer) const {
6612
7706
  buffer.encode_bool(2, this->paired);
6613
7707
  buffer.encode_int32(3, this->error);
6614
7708
  }
7709
+ void BluetoothDevicePairingResponse::calculate_size(uint32_t &total_size) const {
7710
+ ProtoSize::add_uint64_field(total_size, 1, this->address, false);
7711
+ ProtoSize::add_bool_field(total_size, 1, this->paired, false);
7712
+ ProtoSize::add_int32_field(total_size, 1, this->error, false);
7713
+ }
6615
7714
  #ifdef HAS_PROTO_MESSAGE_DUMP
6616
7715
  void BluetoothDevicePairingResponse::dump_to(std::string &out) const {
6617
7716
  __attribute__((unused)) char buffer[64];
@@ -6655,6 +7754,11 @@ void BluetoothDeviceUnpairingResponse::encode(ProtoWriteBuffer buffer) const {
6655
7754
  buffer.encode_bool(2, this->success);
6656
7755
  buffer.encode_int32(3, this->error);
6657
7756
  }
7757
+ void BluetoothDeviceUnpairingResponse::calculate_size(uint32_t &total_size) const {
7758
+ ProtoSize::add_uint64_field(total_size, 1, this->address, false);
7759
+ ProtoSize::add_bool_field(total_size, 1, this->success, false);
7760
+ ProtoSize::add_int32_field(total_size, 1, this->error, false);
7761
+ }
6658
7762
  #ifdef HAS_PROTO_MESSAGE_DUMP
6659
7763
  void BluetoothDeviceUnpairingResponse::dump_to(std::string &out) const {
6660
7764
  __attribute__((unused)) char buffer[64];
@@ -6676,6 +7780,7 @@ void BluetoothDeviceUnpairingResponse::dump_to(std::string &out) const {
6676
7780
  }
6677
7781
  #endif
6678
7782
  void UnsubscribeBluetoothLEAdvertisementsRequest::encode(ProtoWriteBuffer buffer) const {}
7783
+ void UnsubscribeBluetoothLEAdvertisementsRequest::calculate_size(uint32_t &total_size) const {}
6679
7784
  #ifdef HAS_PROTO_MESSAGE_DUMP
6680
7785
  void UnsubscribeBluetoothLEAdvertisementsRequest::dump_to(std::string &out) const {
6681
7786
  out.append("UnsubscribeBluetoothLEAdvertisementsRequest {}");
@@ -6704,6 +7809,11 @@ void BluetoothDeviceClearCacheResponse::encode(ProtoWriteBuffer buffer) const {
6704
7809
  buffer.encode_bool(2, this->success);
6705
7810
  buffer.encode_int32(3, this->error);
6706
7811
  }
7812
+ void BluetoothDeviceClearCacheResponse::calculate_size(uint32_t &total_size) const {
7813
+ ProtoSize::add_uint64_field(total_size, 1, this->address, false);
7814
+ ProtoSize::add_bool_field(total_size, 1, this->success, false);
7815
+ ProtoSize::add_int32_field(total_size, 1, this->error, false);
7816
+ }
6707
7817
  #ifdef HAS_PROTO_MESSAGE_DUMP
6708
7818
  void BluetoothDeviceClearCacheResponse::dump_to(std::string &out) const {
6709
7819
  __attribute__((unused)) char buffer[64];
@@ -6724,6 +7834,68 @@ void BluetoothDeviceClearCacheResponse::dump_to(std::string &out) const {
6724
7834
  out.append("}");
6725
7835
  }
6726
7836
  #endif
7837
+ bool BluetoothScannerStateResponse::decode_varint(uint32_t field_id, ProtoVarInt value) {
7838
+ switch (field_id) {
7839
+ case 1: {
7840
+ this->state = value.as_enum<enums::BluetoothScannerState>();
7841
+ return true;
7842
+ }
7843
+ case 2: {
7844
+ this->mode = value.as_enum<enums::BluetoothScannerMode>();
7845
+ return true;
7846
+ }
7847
+ default:
7848
+ return false;
7849
+ }
7850
+ }
7851
+ void BluetoothScannerStateResponse::encode(ProtoWriteBuffer buffer) const {
7852
+ buffer.encode_enum<enums::BluetoothScannerState>(1, this->state);
7853
+ buffer.encode_enum<enums::BluetoothScannerMode>(2, this->mode);
7854
+ }
7855
+ void BluetoothScannerStateResponse::calculate_size(uint32_t &total_size) const {
7856
+ ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->state), false);
7857
+ ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->mode), false);
7858
+ }
7859
+ #ifdef HAS_PROTO_MESSAGE_DUMP
7860
+ void BluetoothScannerStateResponse::dump_to(std::string &out) const {
7861
+ __attribute__((unused)) char buffer[64];
7862
+ out.append("BluetoothScannerStateResponse {\n");
7863
+ out.append(" state: ");
7864
+ out.append(proto_enum_to_string<enums::BluetoothScannerState>(this->state));
7865
+ out.append("\n");
7866
+
7867
+ out.append(" mode: ");
7868
+ out.append(proto_enum_to_string<enums::BluetoothScannerMode>(this->mode));
7869
+ out.append("\n");
7870
+ out.append("}");
7871
+ }
7872
+ #endif
7873
+ bool BluetoothScannerSetModeRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
7874
+ switch (field_id) {
7875
+ case 1: {
7876
+ this->mode = value.as_enum<enums::BluetoothScannerMode>();
7877
+ return true;
7878
+ }
7879
+ default:
7880
+ return false;
7881
+ }
7882
+ }
7883
+ void BluetoothScannerSetModeRequest::encode(ProtoWriteBuffer buffer) const {
7884
+ buffer.encode_enum<enums::BluetoothScannerMode>(1, this->mode);
7885
+ }
7886
+ void BluetoothScannerSetModeRequest::calculate_size(uint32_t &total_size) const {
7887
+ ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->mode), false);
7888
+ }
7889
+ #ifdef HAS_PROTO_MESSAGE_DUMP
7890
+ void BluetoothScannerSetModeRequest::dump_to(std::string &out) const {
7891
+ __attribute__((unused)) char buffer[64];
7892
+ out.append("BluetoothScannerSetModeRequest {\n");
7893
+ out.append(" mode: ");
7894
+ out.append(proto_enum_to_string<enums::BluetoothScannerMode>(this->mode));
7895
+ out.append("\n");
7896
+ out.append("}");
7897
+ }
7898
+ #endif
6727
7899
  bool SubscribeVoiceAssistantRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
6728
7900
  switch (field_id) {
6729
7901
  case 1: {
@@ -6742,6 +7914,10 @@ void SubscribeVoiceAssistantRequest::encode(ProtoWriteBuffer buffer) const {
6742
7914
  buffer.encode_bool(1, this->subscribe);
6743
7915
  buffer.encode_uint32(2, this->flags);
6744
7916
  }
7917
+ void SubscribeVoiceAssistantRequest::calculate_size(uint32_t &total_size) const {
7918
+ ProtoSize::add_bool_field(total_size, 1, this->subscribe, false);
7919
+ ProtoSize::add_uint32_field(total_size, 1, this->flags, false);
7920
+ }
6745
7921
  #ifdef HAS_PROTO_MESSAGE_DUMP
6746
7922
  void SubscribeVoiceAssistantRequest::dump_to(std::string &out) const {
6747
7923
  __attribute__((unused)) char buffer[64];
@@ -6786,6 +7962,11 @@ void VoiceAssistantAudioSettings::encode(ProtoWriteBuffer buffer) const {
6786
7962
  buffer.encode_uint32(2, this->auto_gain);
6787
7963
  buffer.encode_float(3, this->volume_multiplier);
6788
7964
  }
7965
+ void VoiceAssistantAudioSettings::calculate_size(uint32_t &total_size) const {
7966
+ ProtoSize::add_uint32_field(total_size, 1, this->noise_suppression_level, false);
7967
+ ProtoSize::add_uint32_field(total_size, 1, this->auto_gain, false);
7968
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->volume_multiplier != 0.0f, false);
7969
+ }
6789
7970
  #ifdef HAS_PROTO_MESSAGE_DUMP
6790
7971
  void VoiceAssistantAudioSettings::dump_to(std::string &out) const {
6791
7972
  __attribute__((unused)) char buffer[64];
@@ -6846,6 +8027,13 @@ void VoiceAssistantRequest::encode(ProtoWriteBuffer buffer) const {
6846
8027
  buffer.encode_message<VoiceAssistantAudioSettings>(4, this->audio_settings);
6847
8028
  buffer.encode_string(5, this->wake_word_phrase);
6848
8029
  }
8030
+ void VoiceAssistantRequest::calculate_size(uint32_t &total_size) const {
8031
+ ProtoSize::add_bool_field(total_size, 1, this->start, false);
8032
+ ProtoSize::add_string_field(total_size, 1, this->conversation_id, false);
8033
+ ProtoSize::add_uint32_field(total_size, 1, this->flags, false);
8034
+ ProtoSize::add_message_object(total_size, 1, this->audio_settings, false);
8035
+ ProtoSize::add_string_field(total_size, 1, this->wake_word_phrase, false);
8036
+ }
6849
8037
  #ifdef HAS_PROTO_MESSAGE_DUMP
6850
8038
  void VoiceAssistantRequest::dump_to(std::string &out) const {
6851
8039
  __attribute__((unused)) char buffer[64];
@@ -6891,6 +8079,10 @@ void VoiceAssistantResponse::encode(ProtoWriteBuffer buffer) const {
6891
8079
  buffer.encode_uint32(1, this->port);
6892
8080
  buffer.encode_bool(2, this->error);
6893
8081
  }
8082
+ void VoiceAssistantResponse::calculate_size(uint32_t &total_size) const {
8083
+ ProtoSize::add_uint32_field(total_size, 1, this->port, false);
8084
+ ProtoSize::add_bool_field(total_size, 1, this->error, false);
8085
+ }
6894
8086
  #ifdef HAS_PROTO_MESSAGE_DUMP
6895
8087
  void VoiceAssistantResponse::dump_to(std::string &out) const {
6896
8088
  __attribute__((unused)) char buffer[64];
@@ -6924,6 +8116,10 @@ void VoiceAssistantEventData::encode(ProtoWriteBuffer buffer) const {
6924
8116
  buffer.encode_string(1, this->name);
6925
8117
  buffer.encode_string(2, this->value);
6926
8118
  }
8119
+ void VoiceAssistantEventData::calculate_size(uint32_t &total_size) const {
8120
+ ProtoSize::add_string_field(total_size, 1, this->name, false);
8121
+ ProtoSize::add_string_field(total_size, 1, this->value, false);
8122
+ }
6927
8123
  #ifdef HAS_PROTO_MESSAGE_DUMP
6928
8124
  void VoiceAssistantEventData::dump_to(std::string &out) const {
6929
8125
  __attribute__((unused)) char buffer[64];
@@ -6964,6 +8160,10 @@ void VoiceAssistantEventResponse::encode(ProtoWriteBuffer buffer) const {
6964
8160
  buffer.encode_message<VoiceAssistantEventData>(2, it, true);
6965
8161
  }
6966
8162
  }
8163
+ void VoiceAssistantEventResponse::calculate_size(uint32_t &total_size) const {
8164
+ ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->event_type), false);
8165
+ ProtoSize::add_repeated_message(total_size, 1, this->data);
8166
+ }
6967
8167
  #ifdef HAS_PROTO_MESSAGE_DUMP
6968
8168
  void VoiceAssistantEventResponse::dump_to(std::string &out) const {
6969
8169
  __attribute__((unused)) char buffer[64];
@@ -7004,6 +8204,10 @@ void VoiceAssistantAudio::encode(ProtoWriteBuffer buffer) const {
7004
8204
  buffer.encode_string(1, this->data);
7005
8205
  buffer.encode_bool(2, this->end);
7006
8206
  }
8207
+ void VoiceAssistantAudio::calculate_size(uint32_t &total_size) const {
8208
+ ProtoSize::add_string_field(total_size, 1, this->data, false);
8209
+ ProtoSize::add_bool_field(total_size, 1, this->end, false);
8210
+ }
7007
8211
  #ifdef HAS_PROTO_MESSAGE_DUMP
7008
8212
  void VoiceAssistantAudio::dump_to(std::string &out) const {
7009
8213
  __attribute__((unused)) char buffer[64];
@@ -7062,6 +8266,14 @@ void VoiceAssistantTimerEventResponse::encode(ProtoWriteBuffer buffer) const {
7062
8266
  buffer.encode_uint32(5, this->seconds_left);
7063
8267
  buffer.encode_bool(6, this->is_active);
7064
8268
  }
8269
+ void VoiceAssistantTimerEventResponse::calculate_size(uint32_t &total_size) const {
8270
+ ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->event_type), false);
8271
+ ProtoSize::add_string_field(total_size, 1, this->timer_id, false);
8272
+ ProtoSize::add_string_field(total_size, 1, this->name, false);
8273
+ ProtoSize::add_uint32_field(total_size, 1, this->total_seconds, false);
8274
+ ProtoSize::add_uint32_field(total_size, 1, this->seconds_left, false);
8275
+ ProtoSize::add_bool_field(total_size, 1, this->is_active, false);
8276
+ }
7065
8277
  #ifdef HAS_PROTO_MESSAGE_DUMP
7066
8278
  void VoiceAssistantTimerEventResponse::dump_to(std::string &out) const {
7067
8279
  __attribute__((unused)) char buffer[64];
@@ -7128,6 +8340,12 @@ void VoiceAssistantAnnounceRequest::encode(ProtoWriteBuffer buffer) const {
7128
8340
  buffer.encode_string(3, this->preannounce_media_id);
7129
8341
  buffer.encode_bool(4, this->start_conversation);
7130
8342
  }
8343
+ void VoiceAssistantAnnounceRequest::calculate_size(uint32_t &total_size) const {
8344
+ ProtoSize::add_string_field(total_size, 1, this->media_id, false);
8345
+ ProtoSize::add_string_field(total_size, 1, this->text, false);
8346
+ ProtoSize::add_string_field(total_size, 1, this->preannounce_media_id, false);
8347
+ ProtoSize::add_bool_field(total_size, 1, this->start_conversation, false);
8348
+ }
7131
8349
  #ifdef HAS_PROTO_MESSAGE_DUMP
7132
8350
  void VoiceAssistantAnnounceRequest::dump_to(std::string &out) const {
7133
8351
  __attribute__((unused)) char buffer[64];
@@ -7161,6 +8379,9 @@ bool VoiceAssistantAnnounceFinished::decode_varint(uint32_t field_id, ProtoVarIn
7161
8379
  }
7162
8380
  }
7163
8381
  void VoiceAssistantAnnounceFinished::encode(ProtoWriteBuffer buffer) const { buffer.encode_bool(1, this->success); }
8382
+ void VoiceAssistantAnnounceFinished::calculate_size(uint32_t &total_size) const {
8383
+ ProtoSize::add_bool_field(total_size, 1, this->success, false);
8384
+ }
7164
8385
  #ifdef HAS_PROTO_MESSAGE_DUMP
7165
8386
  void VoiceAssistantAnnounceFinished::dump_to(std::string &out) const {
7166
8387
  __attribute__((unused)) char buffer[64];
@@ -7196,6 +8417,15 @@ void VoiceAssistantWakeWord::encode(ProtoWriteBuffer buffer) const {
7196
8417
  buffer.encode_string(3, it, true);
7197
8418
  }
7198
8419
  }
8420
+ void VoiceAssistantWakeWord::calculate_size(uint32_t &total_size) const {
8421
+ ProtoSize::add_string_field(total_size, 1, this->id, false);
8422
+ ProtoSize::add_string_field(total_size, 1, this->wake_word, false);
8423
+ if (!this->trained_languages.empty()) {
8424
+ for (const auto &it : this->trained_languages) {
8425
+ ProtoSize::add_string_field(total_size, 1, it, true);
8426
+ }
8427
+ }
8428
+ }
7199
8429
  #ifdef HAS_PROTO_MESSAGE_DUMP
7200
8430
  void VoiceAssistantWakeWord::dump_to(std::string &out) const {
7201
8431
  __attribute__((unused)) char buffer[64];
@@ -7217,6 +8447,7 @@ void VoiceAssistantWakeWord::dump_to(std::string &out) const {
7217
8447
  }
7218
8448
  #endif
7219
8449
  void VoiceAssistantConfigurationRequest::encode(ProtoWriteBuffer buffer) const {}
8450
+ void VoiceAssistantConfigurationRequest::calculate_size(uint32_t &total_size) const {}
7220
8451
  #ifdef HAS_PROTO_MESSAGE_DUMP
7221
8452
  void VoiceAssistantConfigurationRequest::dump_to(std::string &out) const {
7222
8453
  out.append("VoiceAssistantConfigurationRequest {}");
@@ -7255,6 +8486,15 @@ void VoiceAssistantConfigurationResponse::encode(ProtoWriteBuffer buffer) const
7255
8486
  }
7256
8487
  buffer.encode_uint32(3, this->max_active_wake_words);
7257
8488
  }
8489
+ void VoiceAssistantConfigurationResponse::calculate_size(uint32_t &total_size) const {
8490
+ ProtoSize::add_repeated_message(total_size, 1, this->available_wake_words);
8491
+ if (!this->active_wake_words.empty()) {
8492
+ for (const auto &it : this->active_wake_words) {
8493
+ ProtoSize::add_string_field(total_size, 1, it, true);
8494
+ }
8495
+ }
8496
+ ProtoSize::add_uint32_field(total_size, 1, this->max_active_wake_words, false);
8497
+ }
7258
8498
  #ifdef HAS_PROTO_MESSAGE_DUMP
7259
8499
  void VoiceAssistantConfigurationResponse::dump_to(std::string &out) const {
7260
8500
  __attribute__((unused)) char buffer[64];
@@ -7293,6 +8533,13 @@ void VoiceAssistantSetConfiguration::encode(ProtoWriteBuffer buffer) const {
7293
8533
  buffer.encode_string(1, it, true);
7294
8534
  }
7295
8535
  }
8536
+ void VoiceAssistantSetConfiguration::calculate_size(uint32_t &total_size) const {
8537
+ if (!this->active_wake_words.empty()) {
8538
+ for (const auto &it : this->active_wake_words) {
8539
+ ProtoSize::add_string_field(total_size, 1, it, true);
8540
+ }
8541
+ }
8542
+ }
7296
8543
  #ifdef HAS_PROTO_MESSAGE_DUMP
7297
8544
  void VoiceAssistantSetConfiguration::dump_to(std::string &out) const {
7298
8545
  __attribute__((unused)) char buffer[64];
@@ -7375,6 +8622,18 @@ void ListEntitiesAlarmControlPanelResponse::encode(ProtoWriteBuffer buffer) cons
7375
8622
  buffer.encode_bool(9, this->requires_code);
7376
8623
  buffer.encode_bool(10, this->requires_code_to_arm);
7377
8624
  }
8625
+ void ListEntitiesAlarmControlPanelResponse::calculate_size(uint32_t &total_size) const {
8626
+ ProtoSize::add_string_field(total_size, 1, this->object_id, false);
8627
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
8628
+ ProtoSize::add_string_field(total_size, 1, this->name, false);
8629
+ ProtoSize::add_string_field(total_size, 1, this->unique_id, false);
8630
+ ProtoSize::add_string_field(total_size, 1, this->icon, false);
8631
+ ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false);
8632
+ ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false);
8633
+ ProtoSize::add_uint32_field(total_size, 1, this->supported_features, false);
8634
+ ProtoSize::add_bool_field(total_size, 1, this->requires_code, false);
8635
+ ProtoSize::add_bool_field(total_size, 1, this->requires_code_to_arm, false);
8636
+ }
7378
8637
  #ifdef HAS_PROTO_MESSAGE_DUMP
7379
8638
  void ListEntitiesAlarmControlPanelResponse::dump_to(std::string &out) const {
7380
8639
  __attribute__((unused)) char buffer[64];
@@ -7447,6 +8706,10 @@ void AlarmControlPanelStateResponse::encode(ProtoWriteBuffer buffer) const {
7447
8706
  buffer.encode_fixed32(1, this->key);
7448
8707
  buffer.encode_enum<enums::AlarmControlPanelState>(2, this->state);
7449
8708
  }
8709
+ void AlarmControlPanelStateResponse::calculate_size(uint32_t &total_size) const {
8710
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
8711
+ ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->state), false);
8712
+ }
7450
8713
  #ifdef HAS_PROTO_MESSAGE_DUMP
7451
8714
  void AlarmControlPanelStateResponse::dump_to(std::string &out) const {
7452
8715
  __attribute__((unused)) char buffer[64];
@@ -7497,6 +8760,11 @@ void AlarmControlPanelCommandRequest::encode(ProtoWriteBuffer buffer) const {
7497
8760
  buffer.encode_enum<enums::AlarmControlPanelStateCommand>(2, this->command);
7498
8761
  buffer.encode_string(3, this->code);
7499
8762
  }
8763
+ void AlarmControlPanelCommandRequest::calculate_size(uint32_t &total_size) const {
8764
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
8765
+ ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->command), false);
8766
+ ProtoSize::add_string_field(total_size, 1, this->code, false);
8767
+ }
7500
8768
  #ifdef HAS_PROTO_MESSAGE_DUMP
7501
8769
  void AlarmControlPanelCommandRequest::dump_to(std::string &out) const {
7502
8770
  __attribute__((unused)) char buffer[64];
@@ -7591,6 +8859,19 @@ void ListEntitiesTextResponse::encode(ProtoWriteBuffer buffer) const {
7591
8859
  buffer.encode_string(10, this->pattern);
7592
8860
  buffer.encode_enum<enums::TextMode>(11, this->mode);
7593
8861
  }
8862
+ void ListEntitiesTextResponse::calculate_size(uint32_t &total_size) const {
8863
+ ProtoSize::add_string_field(total_size, 1, this->object_id, false);
8864
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
8865
+ ProtoSize::add_string_field(total_size, 1, this->name, false);
8866
+ ProtoSize::add_string_field(total_size, 1, this->unique_id, false);
8867
+ ProtoSize::add_string_field(total_size, 1, this->icon, false);
8868
+ ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false);
8869
+ ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false);
8870
+ ProtoSize::add_uint32_field(total_size, 1, this->min_length, false);
8871
+ ProtoSize::add_uint32_field(total_size, 1, this->max_length, false);
8872
+ ProtoSize::add_string_field(total_size, 1, this->pattern, false);
8873
+ ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->mode), false);
8874
+ }
7594
8875
  #ifdef HAS_PROTO_MESSAGE_DUMP
7595
8876
  void ListEntitiesTextResponse::dump_to(std::string &out) const {
7596
8877
  __attribute__((unused)) char buffer[64];
@@ -7679,6 +8960,11 @@ void TextStateResponse::encode(ProtoWriteBuffer buffer) const {
7679
8960
  buffer.encode_string(2, this->state);
7680
8961
  buffer.encode_bool(3, this->missing_state);
7681
8962
  }
8963
+ void TextStateResponse::calculate_size(uint32_t &total_size) const {
8964
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
8965
+ ProtoSize::add_string_field(total_size, 1, this->state, false);
8966
+ ProtoSize::add_bool_field(total_size, 1, this->missing_state, false);
8967
+ }
7682
8968
  #ifdef HAS_PROTO_MESSAGE_DUMP
7683
8969
  void TextStateResponse::dump_to(std::string &out) const {
7684
8970
  __attribute__((unused)) char buffer[64];
@@ -7722,6 +9008,10 @@ void TextCommandRequest::encode(ProtoWriteBuffer buffer) const {
7722
9008
  buffer.encode_fixed32(1, this->key);
7723
9009
  buffer.encode_string(2, this->state);
7724
9010
  }
9011
+ void TextCommandRequest::calculate_size(uint32_t &total_size) const {
9012
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
9013
+ ProtoSize::add_string_field(total_size, 1, this->state, false);
9014
+ }
7725
9015
  #ifdef HAS_PROTO_MESSAGE_DUMP
7726
9016
  void TextCommandRequest::dump_to(std::string &out) const {
7727
9017
  __attribute__((unused)) char buffer[64];
@@ -7792,6 +9082,15 @@ void ListEntitiesDateResponse::encode(ProtoWriteBuffer buffer) const {
7792
9082
  buffer.encode_bool(6, this->disabled_by_default);
7793
9083
  buffer.encode_enum<enums::EntityCategory>(7, this->entity_category);
7794
9084
  }
9085
+ void ListEntitiesDateResponse::calculate_size(uint32_t &total_size) const {
9086
+ ProtoSize::add_string_field(total_size, 1, this->object_id, false);
9087
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
9088
+ ProtoSize::add_string_field(total_size, 1, this->name, false);
9089
+ ProtoSize::add_string_field(total_size, 1, this->unique_id, false);
9090
+ ProtoSize::add_string_field(total_size, 1, this->icon, false);
9091
+ ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false);
9092
+ ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false);
9093
+ }
7795
9094
  #ifdef HAS_PROTO_MESSAGE_DUMP
7796
9095
  void ListEntitiesDateResponse::dump_to(std::string &out) const {
7797
9096
  __attribute__((unused)) char buffer[64];
@@ -7866,6 +9165,13 @@ void DateStateResponse::encode(ProtoWriteBuffer buffer) const {
7866
9165
  buffer.encode_uint32(4, this->month);
7867
9166
  buffer.encode_uint32(5, this->day);
7868
9167
  }
9168
+ void DateStateResponse::calculate_size(uint32_t &total_size) const {
9169
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
9170
+ ProtoSize::add_bool_field(total_size, 1, this->missing_state, false);
9171
+ ProtoSize::add_uint32_field(total_size, 1, this->year, false);
9172
+ ProtoSize::add_uint32_field(total_size, 1, this->month, false);
9173
+ ProtoSize::add_uint32_field(total_size, 1, this->day, false);
9174
+ }
7869
9175
  #ifdef HAS_PROTO_MESSAGE_DUMP
7870
9176
  void DateStateResponse::dump_to(std::string &out) const {
7871
9177
  __attribute__((unused)) char buffer[64];
@@ -7930,6 +9236,12 @@ void DateCommandRequest::encode(ProtoWriteBuffer buffer) const {
7930
9236
  buffer.encode_uint32(3, this->month);
7931
9237
  buffer.encode_uint32(4, this->day);
7932
9238
  }
9239
+ void DateCommandRequest::calculate_size(uint32_t &total_size) const {
9240
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
9241
+ ProtoSize::add_uint32_field(total_size, 1, this->year, false);
9242
+ ProtoSize::add_uint32_field(total_size, 1, this->month, false);
9243
+ ProtoSize::add_uint32_field(total_size, 1, this->day, false);
9244
+ }
7933
9245
  #ifdef HAS_PROTO_MESSAGE_DUMP
7934
9246
  void DateCommandRequest::dump_to(std::string &out) const {
7935
9247
  __attribute__((unused)) char buffer[64];
@@ -8011,6 +9323,15 @@ void ListEntitiesTimeResponse::encode(ProtoWriteBuffer buffer) const {
8011
9323
  buffer.encode_bool(6, this->disabled_by_default);
8012
9324
  buffer.encode_enum<enums::EntityCategory>(7, this->entity_category);
8013
9325
  }
9326
+ void ListEntitiesTimeResponse::calculate_size(uint32_t &total_size) const {
9327
+ ProtoSize::add_string_field(total_size, 1, this->object_id, false);
9328
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
9329
+ ProtoSize::add_string_field(total_size, 1, this->name, false);
9330
+ ProtoSize::add_string_field(total_size, 1, this->unique_id, false);
9331
+ ProtoSize::add_string_field(total_size, 1, this->icon, false);
9332
+ ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false);
9333
+ ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false);
9334
+ }
8014
9335
  #ifdef HAS_PROTO_MESSAGE_DUMP
8015
9336
  void ListEntitiesTimeResponse::dump_to(std::string &out) const {
8016
9337
  __attribute__((unused)) char buffer[64];
@@ -8085,6 +9406,13 @@ void TimeStateResponse::encode(ProtoWriteBuffer buffer) const {
8085
9406
  buffer.encode_uint32(4, this->minute);
8086
9407
  buffer.encode_uint32(5, this->second);
8087
9408
  }
9409
+ void TimeStateResponse::calculate_size(uint32_t &total_size) const {
9410
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
9411
+ ProtoSize::add_bool_field(total_size, 1, this->missing_state, false);
9412
+ ProtoSize::add_uint32_field(total_size, 1, this->hour, false);
9413
+ ProtoSize::add_uint32_field(total_size, 1, this->minute, false);
9414
+ ProtoSize::add_uint32_field(total_size, 1, this->second, false);
9415
+ }
8088
9416
  #ifdef HAS_PROTO_MESSAGE_DUMP
8089
9417
  void TimeStateResponse::dump_to(std::string &out) const {
8090
9418
  __attribute__((unused)) char buffer[64];
@@ -8149,6 +9477,12 @@ void TimeCommandRequest::encode(ProtoWriteBuffer buffer) const {
8149
9477
  buffer.encode_uint32(3, this->minute);
8150
9478
  buffer.encode_uint32(4, this->second);
8151
9479
  }
9480
+ void TimeCommandRequest::calculate_size(uint32_t &total_size) const {
9481
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
9482
+ ProtoSize::add_uint32_field(total_size, 1, this->hour, false);
9483
+ ProtoSize::add_uint32_field(total_size, 1, this->minute, false);
9484
+ ProtoSize::add_uint32_field(total_size, 1, this->second, false);
9485
+ }
8152
9486
  #ifdef HAS_PROTO_MESSAGE_DUMP
8153
9487
  void TimeCommandRequest::dump_to(std::string &out) const {
8154
9488
  __attribute__((unused)) char buffer[64];
@@ -8242,6 +9576,21 @@ void ListEntitiesEventResponse::encode(ProtoWriteBuffer buffer) const {
8242
9576
  buffer.encode_string(9, it, true);
8243
9577
  }
8244
9578
  }
9579
+ void ListEntitiesEventResponse::calculate_size(uint32_t &total_size) const {
9580
+ ProtoSize::add_string_field(total_size, 1, this->object_id, false);
9581
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
9582
+ ProtoSize::add_string_field(total_size, 1, this->name, false);
9583
+ ProtoSize::add_string_field(total_size, 1, this->unique_id, false);
9584
+ ProtoSize::add_string_field(total_size, 1, this->icon, false);
9585
+ ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false);
9586
+ ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false);
9587
+ ProtoSize::add_string_field(total_size, 1, this->device_class, false);
9588
+ if (!this->event_types.empty()) {
9589
+ for (const auto &it : this->event_types) {
9590
+ ProtoSize::add_string_field(total_size, 1, it, true);
9591
+ }
9592
+ }
9593
+ }
8245
9594
  #ifdef HAS_PROTO_MESSAGE_DUMP
8246
9595
  void ListEntitiesEventResponse::dump_to(std::string &out) const {
8247
9596
  __attribute__((unused)) char buffer[64];
@@ -8311,6 +9660,10 @@ void EventResponse::encode(ProtoWriteBuffer buffer) const {
8311
9660
  buffer.encode_fixed32(1, this->key);
8312
9661
  buffer.encode_string(2, this->event_type);
8313
9662
  }
9663
+ void EventResponse::calculate_size(uint32_t &total_size) const {
9664
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
9665
+ ProtoSize::add_string_field(total_size, 1, this->event_type, false);
9666
+ }
8314
9667
  #ifdef HAS_PROTO_MESSAGE_DUMP
8315
9668
  void EventResponse::dump_to(std::string &out) const {
8316
9669
  __attribute__((unused)) char buffer[64];
@@ -8401,6 +9754,19 @@ void ListEntitiesValveResponse::encode(ProtoWriteBuffer buffer) const {
8401
9754
  buffer.encode_bool(10, this->supports_position);
8402
9755
  buffer.encode_bool(11, this->supports_stop);
8403
9756
  }
9757
+ void ListEntitiesValveResponse::calculate_size(uint32_t &total_size) const {
9758
+ ProtoSize::add_string_field(total_size, 1, this->object_id, false);
9759
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
9760
+ ProtoSize::add_string_field(total_size, 1, this->name, false);
9761
+ ProtoSize::add_string_field(total_size, 1, this->unique_id, false);
9762
+ ProtoSize::add_string_field(total_size, 1, this->icon, false);
9763
+ ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false);
9764
+ ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false);
9765
+ ProtoSize::add_string_field(total_size, 1, this->device_class, false);
9766
+ ProtoSize::add_bool_field(total_size, 1, this->assumed_state, false);
9767
+ ProtoSize::add_bool_field(total_size, 1, this->supports_position, false);
9768
+ ProtoSize::add_bool_field(total_size, 1, this->supports_stop, false);
9769
+ }
8404
9770
  #ifdef HAS_PROTO_MESSAGE_DUMP
8405
9771
  void ListEntitiesValveResponse::dump_to(std::string &out) const {
8406
9772
  __attribute__((unused)) char buffer[64];
@@ -8481,6 +9847,11 @@ void ValveStateResponse::encode(ProtoWriteBuffer buffer) const {
8481
9847
  buffer.encode_float(2, this->position);
8482
9848
  buffer.encode_enum<enums::ValveOperation>(3, this->current_operation);
8483
9849
  }
9850
+ void ValveStateResponse::calculate_size(uint32_t &total_size) const {
9851
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
9852
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->position != 0.0f, false);
9853
+ ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->current_operation), false);
9854
+ }
8484
9855
  #ifdef HAS_PROTO_MESSAGE_DUMP
8485
9856
  void ValveStateResponse::dump_to(std::string &out) const {
8486
9857
  __attribute__((unused)) char buffer[64];
@@ -8535,6 +9906,12 @@ void ValveCommandRequest::encode(ProtoWriteBuffer buffer) const {
8535
9906
  buffer.encode_float(3, this->position);
8536
9907
  buffer.encode_bool(4, this->stop);
8537
9908
  }
9909
+ void ValveCommandRequest::calculate_size(uint32_t &total_size) const {
9910
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
9911
+ ProtoSize::add_bool_field(total_size, 1, this->has_position, false);
9912
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->position != 0.0f, false);
9913
+ ProtoSize::add_bool_field(total_size, 1, this->stop, false);
9914
+ }
8538
9915
  #ifdef HAS_PROTO_MESSAGE_DUMP
8539
9916
  void ValveCommandRequest::dump_to(std::string &out) const {
8540
9917
  __attribute__((unused)) char buffer[64];
@@ -8614,6 +9991,15 @@ void ListEntitiesDateTimeResponse::encode(ProtoWriteBuffer buffer) const {
8614
9991
  buffer.encode_bool(6, this->disabled_by_default);
8615
9992
  buffer.encode_enum<enums::EntityCategory>(7, this->entity_category);
8616
9993
  }
9994
+ void ListEntitiesDateTimeResponse::calculate_size(uint32_t &total_size) const {
9995
+ ProtoSize::add_string_field(total_size, 1, this->object_id, false);
9996
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
9997
+ ProtoSize::add_string_field(total_size, 1, this->name, false);
9998
+ ProtoSize::add_string_field(total_size, 1, this->unique_id, false);
9999
+ ProtoSize::add_string_field(total_size, 1, this->icon, false);
10000
+ ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false);
10001
+ ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false);
10002
+ }
8617
10003
  #ifdef HAS_PROTO_MESSAGE_DUMP
8618
10004
  void ListEntitiesDateTimeResponse::dump_to(std::string &out) const {
8619
10005
  __attribute__((unused)) char buffer[64];
@@ -8678,6 +10064,11 @@ void DateTimeStateResponse::encode(ProtoWriteBuffer buffer) const {
8678
10064
  buffer.encode_bool(2, this->missing_state);
8679
10065
  buffer.encode_fixed32(3, this->epoch_seconds);
8680
10066
  }
10067
+ void DateTimeStateResponse::calculate_size(uint32_t &total_size) const {
10068
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
10069
+ ProtoSize::add_bool_field(total_size, 1, this->missing_state, false);
10070
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->epoch_seconds != 0, false);
10071
+ }
8681
10072
  #ifdef HAS_PROTO_MESSAGE_DUMP
8682
10073
  void DateTimeStateResponse::dump_to(std::string &out) const {
8683
10074
  __attribute__((unused)) char buffer[64];
@@ -8716,6 +10107,10 @@ void DateTimeCommandRequest::encode(ProtoWriteBuffer buffer) const {
8716
10107
  buffer.encode_fixed32(1, this->key);
8717
10108
  buffer.encode_fixed32(2, this->epoch_seconds);
8718
10109
  }
10110
+ void DateTimeCommandRequest::calculate_size(uint32_t &total_size) const {
10111
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
10112
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->epoch_seconds != 0, false);
10113
+ }
8719
10114
  #ifdef HAS_PROTO_MESSAGE_DUMP
8720
10115
  void DateTimeCommandRequest::dump_to(std::string &out) const {
8721
10116
  __attribute__((unused)) char buffer[64];
@@ -8792,6 +10187,16 @@ void ListEntitiesUpdateResponse::encode(ProtoWriteBuffer buffer) const {
8792
10187
  buffer.encode_enum<enums::EntityCategory>(7, this->entity_category);
8793
10188
  buffer.encode_string(8, this->device_class);
8794
10189
  }
10190
+ void ListEntitiesUpdateResponse::calculate_size(uint32_t &total_size) const {
10191
+ ProtoSize::add_string_field(total_size, 1, this->object_id, false);
10192
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
10193
+ ProtoSize::add_string_field(total_size, 1, this->name, false);
10194
+ ProtoSize::add_string_field(total_size, 1, this->unique_id, false);
10195
+ ProtoSize::add_string_field(total_size, 1, this->icon, false);
10196
+ ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false);
10197
+ ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false);
10198
+ ProtoSize::add_string_field(total_size, 1, this->device_class, false);
10199
+ }
8795
10200
  #ifdef HAS_PROTO_MESSAGE_DUMP
8796
10201
  void ListEntitiesUpdateResponse::dump_to(std::string &out) const {
8797
10202
  __attribute__((unused)) char buffer[64];
@@ -8901,6 +10306,18 @@ void UpdateStateResponse::encode(ProtoWriteBuffer buffer) const {
8901
10306
  buffer.encode_string(9, this->release_summary);
8902
10307
  buffer.encode_string(10, this->release_url);
8903
10308
  }
10309
+ void UpdateStateResponse::calculate_size(uint32_t &total_size) const {
10310
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
10311
+ ProtoSize::add_bool_field(total_size, 1, this->missing_state, false);
10312
+ ProtoSize::add_bool_field(total_size, 1, this->in_progress, false);
10313
+ ProtoSize::add_bool_field(total_size, 1, this->has_progress, false);
10314
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->progress != 0.0f, false);
10315
+ ProtoSize::add_string_field(total_size, 1, this->current_version, false);
10316
+ ProtoSize::add_string_field(total_size, 1, this->latest_version, false);
10317
+ ProtoSize::add_string_field(total_size, 1, this->title, false);
10318
+ ProtoSize::add_string_field(total_size, 1, this->release_summary, false);
10319
+ ProtoSize::add_string_field(total_size, 1, this->release_url, false);
10320
+ }
8904
10321
  #ifdef HAS_PROTO_MESSAGE_DUMP
8905
10322
  void UpdateStateResponse::dump_to(std::string &out) const {
8906
10323
  __attribute__((unused)) char buffer[64];
@@ -8973,6 +10390,10 @@ void UpdateCommandRequest::encode(ProtoWriteBuffer buffer) const {
8973
10390
  buffer.encode_fixed32(1, this->key);
8974
10391
  buffer.encode_enum<enums::UpdateCommand>(2, this->command);
8975
10392
  }
10393
+ void UpdateCommandRequest::calculate_size(uint32_t &total_size) const {
10394
+ ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
10395
+ ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->command), false);
10396
+ }
8976
10397
  #ifdef HAS_PROTO_MESSAGE_DUMP
8977
10398
  void UpdateCommandRequest::dump_to(std::string &out) const {
8978
10399
  __attribute__((unused)) char buffer[64];