esphome 2025.7.0b1__py3-none-any.whl → 2025.7.0b2__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 (49) hide show
  1. esphome/components/api/__init__.py +19 -5
  2. esphome/components/api/api_connection.cpp +53 -175
  3. esphome/components/api/api_connection.h +28 -25
  4. esphome/components/api/api_frame_helper.cpp +2 -3
  5. esphome/components/api/api_frame_helper.h +7 -9
  6. esphome/components/api/api_pb2.cpp +1862 -5133
  7. esphome/components/api/api_pb2.h +291 -533
  8. esphome/components/api/api_pb2_dump.cpp +99 -0
  9. esphome/components/api/api_pb2_service.cpp +4 -0
  10. esphome/components/api/api_pb2_service.h +6 -0
  11. esphome/components/api/api_server.cpp +2 -9
  12. esphome/components/api/api_server.h +7 -33
  13. esphome/components/api/custom_api_device.h +8 -0
  14. esphome/components/api/list_entities.cpp +2 -0
  15. esphome/components/api/list_entities.h +3 -1
  16. esphome/components/api/proto.h +506 -23
  17. esphome/components/api/user_services.h +2 -0
  18. esphome/components/debug/debug_esp32.cpp +2 -0
  19. esphome/components/esp32/__init__.py +1 -0
  20. esphome/components/esp32_camera/__init__.py +1 -1
  21. esphome/components/esp32_touch/esp32_touch_v1.cpp +12 -10
  22. esphome/components/esp8266/__init__.py +1 -0
  23. esphome/components/host/__init__.py +1 -0
  24. esphome/components/ld2410/ld2410.cpp +12 -28
  25. esphome/components/libretiny/__init__.py +1 -0
  26. esphome/components/mqtt/mqtt_backend_esp32.cpp +6 -2
  27. esphome/components/packet_transport/packet_transport.cpp +3 -0
  28. esphome/components/rp2040/__init__.py +1 -0
  29. esphome/components/sx126x/__init__.py +3 -3
  30. esphome/components/sx127x/__init__.py +2 -2
  31. esphome/components/usb_host/usb_host_client.cpp +10 -10
  32. esphome/components/usb_uart/cp210x.cpp +1 -1
  33. esphome/components/usb_uart/usb_uart.cpp +41 -44
  34. esphome/components/usb_uart/usb_uart.h +4 -3
  35. esphome/const.py +1 -1
  36. esphome/core/component_iterator.cpp +4 -2
  37. esphome/core/component_iterator.h +3 -3
  38. esphome/core/defines.h +1 -1
  39. esphome/core/entity_helpers.py +6 -0
  40. esphome/core/scheduler.cpp +9 -12
  41. esphome/core/scheduler.h +0 -3
  42. esphome/wizard.py +1 -1
  43. {esphome-2025.7.0b1.dist-info → esphome-2025.7.0b2.dist-info}/METADATA +2 -2
  44. {esphome-2025.7.0b1.dist-info → esphome-2025.7.0b2.dist-info}/RECORD +48 -49
  45. esphome/components/api/api_pb2_size.h +0 -359
  46. {esphome-2025.7.0b1.dist-info → esphome-2025.7.0b2.dist-info}/WHEEL +0 -0
  47. {esphome-2025.7.0b1.dist-info → esphome-2025.7.0b2.dist-info}/entry_points.txt +0 -0
  48. {esphome-2025.7.0b1.dist-info → esphome-2025.7.0b2.dist-info}/licenses/LICENSE +0 -0
  49. {esphome-2025.7.0b1.dist-info → esphome-2025.7.0b2.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: esphome
3
- Version: 2025.7.0b1
3
+ Version: 2025.7.0b2
4
4
  Summary: ESPHome is a system to configure your microcontrollers by simple yet powerful configuration files and control them remotely through Home Automation systems.
5
5
  Author-email: The ESPHome Authors <esphome@openhomefoundation.org>
6
6
  License: MIT
@@ -38,7 +38,7 @@ Requires-Dist: platformio==6.1.18
38
38
  Requires-Dist: esptool==4.9.0
39
39
  Requires-Dist: click==8.1.7
40
40
  Requires-Dist: esphome-dashboard==20250514.0
41
- Requires-Dist: aioesphomeapi==34.2.0
41
+ Requires-Dist: aioesphomeapi==34.2.1
42
42
  Requires-Dist: zeroconf==0.147.0
43
43
  Requires-Dist: puremagic==1.30
44
44
  Requires-Dist: ruamel.yaml==0.18.14
@@ -5,7 +5,7 @@ esphome/codegen.py,sha256=H_WB4rj0uEowvlhEb31EjJQwutLQ5CQkJIsNgDK-wx8,1917
5
5
  esphome/config.py,sha256=b-Gh-DEx_pax0ZKqHTKb5gmMIvaQA71bJvE-15AI0JI,42211
6
6
  esphome/config_helpers.py,sha256=BpyuWRxj5edJGIW7VP4S59i4I8g8baSlWpNyu6nB_uM,5413
7
7
  esphome/config_validation.py,sha256=_SMAcS_AhMh0kaLki86hjPZp5b95culJZtQePqoL_fU,63712
8
- esphome/const.py,sha256=n2FvCqAosX76VXB2emXqxR2J7xdBz1Qx3BQCVxSzI6A,43369
8
+ esphome/const.py,sha256=ZZdWJJD7E7BwSpvgVvDerIAGpvGB4G57JSbkZCySH5w,43369
9
9
  esphome/coroutine.py,sha256=HNBqqhaTbpvsOI19bTXltxJCMVtoeqZPe4qTf4CKkAc,9309
10
10
  esphome/cpp_generator.py,sha256=khmyuRIOc-ST9zIZjX7uOWLy9sSJhk4C2KexoBv51uk,31946
11
11
  esphome/cpp_helpers.py,sha256=P9FVGpid75_UcKxIf-sj7GbhWGQNRcBm_2XVF3r7NtU,3998
@@ -27,7 +27,7 @@ esphome/types.py,sha256=hnt4C_y0BR9PiWRluaDom1L_afl3lgMma8AMASbJAbM,394
27
27
  esphome/util.py,sha256=eIXhVyTcsgzUS9AwVmvlDgHDLuKsgFN-mjPO0SL87QQ,9298
28
28
  esphome/voluptuous_schema.py,sha256=tQUOLvVec6v4pxfWpa8CMgXqBqomuqUUYEJqCJOPhNs,9417
29
29
  esphome/vscode.py,sha256=pKBx_9jmQlRJB1xiqjWq2-pFhXae8VNSFGYoqxRBMkw,4279
30
- esphome/wizard.py,sha256=kjl-xZb9fkBFZ0C0FYs3lBKqWk0-q-sQN-zYtzctpeE,15851
30
+ esphome/wizard.py,sha256=kOA1gdjgt1mCg5Le5ISOgrqo1s_craAHSIWxMZpc03U,15859
31
31
  esphome/writer.py,sha256=Btr0GtSpag_rLLD7SCwCswzqKxgq2RDrUEHJEWkMCCY,11718
32
32
  esphome/yaml_util.py,sha256=xATfWU3Q0bhmncp_M2gRJUIdp3giHYXSNfJAVeg7m-4,23158
33
33
  esphome/zeroconf.py,sha256=dy3aWh1Lf4Sh5e7Izlq30FkdzAKWA6IGvZkXuxYrxFE,6511
@@ -182,31 +182,30 @@ esphome/components/apds9960/apds9960.cpp,sha256=L_iAjTdTdlgufwpn_v4CQ-Df3Ya7k-tR
182
182
  esphome/components/apds9960/apds9960.h,sha256=oFrXPQrPDS16gNSVdN1n6SKuvjwc9LdvpKJckr5Tbdc,2136
183
183
  esphome/components/apds9960/binary_sensor.py,sha256=MvCYb6pTgOU48TMm_YhN6uHKkoFKFvhma3lwQQD9xfM,787
184
184
  esphome/components/apds9960/sensor.py,sha256=vUPm5H_IFROftGlMJWfgqSzm0IeLpYh5DvtA_DL1Amk,872
185
- esphome/components/api/__init__.py,sha256=rhhTmopb819qnyWg4zesnb7hkUtNG15Seh0Mt4nBgx0,11706
186
- esphome/components/api/api_connection.cpp,sha256=DP7zG0D_2npyrr3O_Hn4Q7sCmUHyQzNVOQzT5jrlUqY,84606
187
- esphome/components/api/api_connection.h,sha256=dI65OARm0-itKMbyZ33npNV4o_9wlSObh13m1AnIJGs,30175
188
- esphome/components/api/api_frame_helper.cpp,sha256=2tWVqw57QjPoDqI4A0EWR7abFEsxAy9nNSVH80Nmj2Y,38093
189
- esphome/components/api/api_frame_helper.h,sha256=zOfF6qWBGLOsRNho-p9ydudtKKUFFoVNnJeocuxyMQU,10365
185
+ esphome/components/api/__init__.py,sha256=c6z0YUDVDmGpZiiNAsiqiuheib4qv8cw1NfCL9OvVcA,12311
186
+ esphome/components/api/api_connection.cpp,sha256=O-1osGKN7dqC6X179V28lZfp0ipfDW-9FyEDrFai1n8,80703
187
+ esphome/components/api/api_connection.h,sha256=X57XY_kYpEcZdYpx1ShwLte_8jnnXq6me8K0-Y_M-lU,30537
188
+ esphome/components/api/api_frame_helper.cpp,sha256=fAt3UqdHCJSSggcJm1dqBz46PTbJS6lLrhwgXE-pZvw,38065
189
+ esphome/components/api/api_frame_helper.h,sha256=p6af-nRWvSLG4Vimtjzw2BKZJiCts9mknurSYZTeNsM,10293
190
190
  esphome/components/api/api_noise_context.h,sha256=y_3hWMKXtKxyCwZ8cKQjn3gQqenaAX5DhcCFQ6kBiPc,606
191
- esphome/components/api/api_pb2.cpp,sha256=_nO4TENj3baYwQhS_BNxcLASQsOcl0GsQOLfstTJydg,207035
192
- esphome/components/api/api_pb2.h,sha256=2YyjD_dGZ2yp9caG-gNrKqeZRFQ0SRBUI5DQfsf2h7Q,107323
193
- esphome/components/api/api_pb2_dump.cpp,sha256=g2D15WK8fRWAvt-18ATpWuQU6YCmK_WSPwpCZBA5qZA,128917
194
- esphome/components/api/api_pb2_service.cpp,sha256=Q2FnTu8N027phHGUPZWZChhDwWPE55XI_9WGkzVJJ_4,26543
195
- esphome/components/api/api_pb2_service.h,sha256=nC4qLY6oBFKjshRC0sBDxthL-eaGJmCfIBhO4uH9SKI,16428
196
- esphome/components/api/api_pb2_size.h,sha256=7XNXRcssUYhlhbLff2u9OUbv6AvWpMcQel8xLzIfoL0,13302
197
- esphome/components/api/api_server.cpp,sha256=yJKPP0kAYfFk0ycVcwVJMMYz0xBD481PV2jGFLtHHRo,14601
198
- esphome/components/api/api_server.h,sha256=rCmsRSE4tDcfGMHd2dRm4pZ6kIMILEVUpSMkq1X21MQ,7586
191
+ esphome/components/api/api_pb2.cpp,sha256=L-qDcoG-RyHhMCpQzr7LJpIxQAHnpXlAlopp8-tXR5o,114017
192
+ esphome/components/api/api_pb2.h,sha256=efAEytRR7iryZGPFr1AE1RhzZhZvFHx5Wi4QROXVpys,91442
193
+ esphome/components/api/api_pb2_dump.cpp,sha256=7JQpe3fxLUSjiw5yfEnb-rGE8-rQQwtzQQgevEW65zY,131620
194
+ esphome/components/api/api_pb2_service.cpp,sha256=N4nHS9RaXO6V2X3oRe_oHtCcGtv3HinD2sJy2YF_NU8,26605
195
+ esphome/components/api/api_pb2_service.h,sha256=Wl4-5vhqj3zhCQfKJ0vImEuSXRZUkyuu0Fsbeg-0D9E,16521
196
+ esphome/components/api/api_server.cpp,sha256=UeLT60naPcxqmvJlMR6MClnPl1gT1cggyeOR-9jq3_4,14321
197
+ esphome/components/api/api_server.h,sha256=fRTT9rZEIFzD3iI89Z9P7Dniw7lnuOCPk_exYqCsOoI,6513
199
198
  esphome/components/api/client.py,sha256=47VYbSUN7SO3vjRHA4tzLw3Zwr8yhkbfLg9K7ELRDf8,2188
200
- esphome/components/api/custom_api_device.h,sha256=CyFBolpdvgrJ0vrHUwcHzUh5SV4Fh5296ro4w8e19MQ,7454
199
+ esphome/components/api/custom_api_device.h,sha256=HIOBfs2zP5lRIC9ur-Ae9zHkCa5ekV023uIa0oklpdo,7599
201
200
  esphome/components/api/homeassistant_service.h,sha256=_ie-fI8yZ5hJfssBwFcXZz4pLseqTdtJDZ7AQekFLpI,2814
202
- esphome/components/api/list_entities.cpp,sha256=rC7kEE75UdVeuk442s0fX1d4_KjvlGtPZ2zaMuBMNmg,3081
203
- esphome/components/api/list_entities.h,sha256=vJVEUfO-BFmhZm1DR7EYB9l_zK_zy6Knu9j6oKPmvhM,2837
201
+ esphome/components/api/list_entities.cpp,sha256=EMysqDt2yeMDwaiorf0taqF8pXCA0QAcnvviedNbFzI,3112
202
+ esphome/components/api/list_entities.h,sha256=91kBP47ISJS7MQ9tg2kOmaYtLx-pPyquROzzBGkE66s,2898
204
203
  esphome/components/api/proto.cpp,sha256=vrXe3Hd1XWjzWi6osqMICAEEKNNx6A4GAo_KHQ7hRZA,2696
205
- esphome/components/api/proto.h,sha256=fbzZhxAGNvgUnQLt-j0DtLVZBTLXSImFbdsX-F8VsvI,12906
204
+ esphome/components/api/proto.h,sha256=KNwbQ9agx4dEaGK8SJoffAwiqbw9pWYWfDVS-HHyGL8,31310
206
205
  esphome/components/api/subscribe_state.cpp,sha256=gC7H5XLr-Od0V6AGpdn6m_aElD1sI8YqNln7lWA7eT0,1910
207
206
  esphome/components/api/subscribe_state.h,sha256=QvgvpLEw3kjuTytQa02V8bwhfCVxhQSdTbhCaohmxVA,2593
208
207
  esphome/components/api/user_services.cpp,sha256=uFB9ms2RCdTTnPLQ8YSL1hMIjMUTqPaBwHBWECfIpoA,2109
209
- esphome/components/api/user_services.h,sha256=C3S0bBvV1V5fSHKf-UFSB0jlpy1fySCDZ_y9Tvhr4UE,2269
208
+ esphome/components/api/user_services.h,sha256=wfdVEDDwVl2XkIBqLcvJ8DFga_rDotWw4pexbCIIaas,2321
210
209
  esphome/components/as3935/__init__.py,sha256=HzgYbwDVTU-9ziVpmtAkRQoCJhTYwVFNmWnZ6SWzRn0,2274
211
210
  esphome/components/as3935/as3935.cpp,sha256=WrWgbqFYjVUKrrLHuX-1ytfGVA4T2eHtVRCi5laRxHA,12813
212
211
  esphome/components/as3935/as3935.h,sha256=OLsgTb53U4wIkfxI28u15bqSqccR6v7K5ywsLF89vxA,3632
@@ -655,7 +654,7 @@ esphome/components/datetime/time_entity.h,sha256=rNN9V8UH4ervs03lsuvR233dD13LYce
655
654
  esphome/components/debug/__init__.py,sha256=3jG9TN662hFu3_uMsmb8OuaZjpJzMYFin8oqbAo0m_o,2126
656
655
  esphome/components/debug/debug_component.cpp,sha256=KM-ejEa1bDxoSjxUBjA4EOGvuYEgL50gAsOaWbSjGqg,3033
657
656
  esphome/components/debug/debug_component.h,sha256=lae6tHfcs0wWXczaXYRlot1SGC7zTA81PiHRAXUcxQ8,3088
658
- esphome/components/debug/debug_esp32.cpp,sha256=3jUw1gFs-Niwb2bNHhW_roi0DTW0j9k_ETtjQUWWPic,7031
657
+ esphome/components/debug/debug_esp32.cpp,sha256=NMJ6CF9gJ5fk4pCuku-BKMs9WqrLjpkmtE4EIBb_1W8,7113
659
658
  esphome/components/debug/debug_esp8266.cpp,sha256=eTj_cCcsHgG5YgtryxZFmM1bN2mHRXLEC1qPkfBDdDY,3145
660
659
  esphome/components/debug/debug_host.cpp,sha256=DeAkj-QT8OPcQykp1Cl98YtnJ28kVd3TDR4LXgs1x-o,396
661
660
  esphome/components/debug/debug_libretiny.cpp,sha256=18T23svXnWw-__ykQjxoaDQ5jpztW1MHiOWDh_XoTzM,1569
@@ -828,7 +827,7 @@ esphome/components/es8388/select/adc_input_mic_select.cpp,sha256=xBlweJHP_BHSvwP
828
827
  esphome/components/es8388/select/adc_input_mic_select.h,sha256=1Wf54OGjnrj9vFe7WuIU10qraRAJX7HM1qEcCTTSlvc,336
829
828
  esphome/components/es8388/select/dac_output_select.cpp,sha256=FDOC7NHBaR34BqzzsPrmzBIzY_4o_YkF3_wSs_A9LC8,302
830
829
  esphome/components/es8388/select/dac_output_select.h,sha256=u00z0jHqKmqsaKht3b3k7aGtYudU0cCJRTOw1Zh-mbw,334
831
- esphome/components/esp32/__init__.py,sha256=konxIfuiaPDVpHSiZPN49yjflRGMHduqa1tldW3Ct_k,35884
830
+ esphome/components/esp32/__init__.py,sha256=MUdQKB2_en-8LrdI40Gr162DlRP_A24NClorhNBdBr0,35942
832
831
  esphome/components/esp32/boards.py,sha256=RHJK4x6dEz4v3CuFHIPp0gvJmCWAl7hH3Xoy8-pq6wY,55161
833
832
  esphome/components/esp32/const.py,sha256=3sPibOKzbGgtSUIn7PfTQJRyob6x1vUtxagKCGS9CyY,1130
834
833
  esphome/components/esp32/core.cpp,sha256=7zSi6LBjWUV1qMNdCTs3R4LRLkg6Xnl8a7bsTGy-f8Q,2747
@@ -885,7 +884,7 @@ esphome/components/esp32_ble_tracker/__init__.py,sha256=ccak0vxtH0cvun10HRGFJJHo
885
884
  esphome/components/esp32_ble_tracker/automation.h,sha256=0pDA6EX__f14sT0KJwcnqg7UOsueKjjegHPznQj9biw,3795
886
885
  esphome/components/esp32_ble_tracker/esp32_ble_tracker.cpp,sha256=HYiT04Lc7UUf6R8bU4dzXjukHIYXxpUENDF3pbWsyEw,33210
887
886
  esphome/components/esp32_ble_tracker/esp32_ble_tracker.h,sha256=XBjgf-yrkXGxoaQqTeAw70A59y8Th2c-57ctmhiuH18,11028
888
- esphome/components/esp32_camera/__init__.py,sha256=TVVJJpjVqwjCgbVM_U34SHtyZsdRAgsZ_YUbFZA3Jyo,13463
887
+ esphome/components/esp32_camera/__init__.py,sha256=ZGtx71UgtqHIhdZJSKHQqv7zIgtpFu6MFHfzAkf6DWc,13457
889
888
  esphome/components/esp32_camera/esp32_camera.cpp,sha256=LLGw2p5RsbO-lCFBqkZsuzitMex1N3y3bEoZhnMV7k4,17110
890
889
  esphome/components/esp32_camera/esp32_camera.h,sha256=ojiwjGpzUhYQepifWD2PyjByQklFRtQRTJrXFbZfSNM,7903
891
890
  esphome/components/esp32_camera_web_server/__init__.py,sha256=ViM-dcI4ld95yL1a3LuOO4H-eW_1GmcN7fHDlsyu3f8,938
@@ -916,9 +915,9 @@ esphome/components/esp32_touch/__init__.py,sha256=zcxxAkhMPOd--SZyngwDEW-Q9AYcWm
916
915
  esphome/components/esp32_touch/binary_sensor.py,sha256=JV0p5Ovn4E1EVj6L4JEmRJ--L-D7HWGK2PaQLE9hs3E,1165
917
916
  esphome/components/esp32_touch/esp32_touch.h,sha256=Br1-5Lh4U6xmvrM59iuPe5hR6cmO-LO5vSoyc49k9QY,9644
918
917
  esphome/components/esp32_touch/esp32_touch_common.cpp,sha256=engSTGARGHfLIwjceV2xrg0y0yX_gpb8MjoK2zd6KZQ,5703
919
- esphome/components/esp32_touch/esp32_touch_v1.cpp,sha256=6N4TWUKGvBxqaW1yjv0ci1H7c25-G5Ir-YI8fqDt31Y,8278
918
+ esphome/components/esp32_touch/esp32_touch_v1.cpp,sha256=VQdfo4rsDCVZ7kvG7IXFoatg97AM_ZECMNGB55I7xwQ,8266
920
919
  esphome/components/esp32_touch/esp32_touch_v2.cpp,sha256=SZPbpG3fOrJNMkzcJIYFubi4YcTspnVp58iO-_7rJdM,13475
921
- esphome/components/esp8266/__init__.py,sha256=bQ6s4v23sX_b3xD5GjAQZyx4xqGzUJ4tx8N72K3Uz8g,9625
920
+ esphome/components/esp8266/__init__.py,sha256=-2xGbrwE5P4eTmQZRcoKwjBhtCVgnhdh3kEsrqYcGSI,9683
922
921
  esphome/components/esp8266/boards.py,sha256=p2btoDa36gfr9QsCOBZuME7Pi20Xf2LcQ_F-oeMFFA8,8647
923
922
  esphome/components/esp8266/const.py,sha256=bBUPq-_hzl36vVhKwCxCI_2TSNLJZpwbs6MtgHLVATI,380
924
923
  esphome/components/esp8266/core.cpp,sha256=IMhgyjd1a5Jm0j1wsUKcv6eme8A4_IdFdvPjX0QXNzE,2673
@@ -1209,7 +1208,7 @@ esphome/components/honeywellabp2_i2c/__init__.py,sha256=q4EX44dXWVPn_6bcR0pbzsGW
1209
1208
  esphome/components/honeywellabp2_i2c/honeywellabp2.cpp,sha256=MePCvLyyKeMbXryihlXo05l92nmR42RPb3KhrsZ5Mho,3593
1210
1209
  esphome/components/honeywellabp2_i2c/honeywellabp2.h,sha256=dqxZCb2bPsx1GkI78ZptEvDUBuFO0jT3H8EHukh9-ms,2062
1211
1210
  esphome/components/honeywellabp2_i2c/sensor.py,sha256=SgzprhKM9AR6voTktYUqvuFqxhOn9ak5xLeVH-L8vMk,2544
1212
- esphome/components/host/__init__.py,sha256=yEzFiiPzyLFCdpCdZK-ZXZsh11PV-lw5Wx-CQj80uU4,1270
1211
+ esphome/components/host/__init__.py,sha256=vKZJ1cQKjbbUSuXMdEUscOSjSNfiQSzEIfIpb7UrWf8,1328
1213
1212
  esphome/components/host/const.py,sha256=GvsG6HlxHm1Oh5rpiFTswpNIpG0xmfUvSHxtjZwmyuU,91
1214
1213
  esphome/components/host/core.cpp,sha256=_CSOmrSgL-Zo707ff0xVsWnAFBRzjKWwE4EP-0LosZg,1766
1215
1214
  esphome/components/host/gpio.cpp,sha256=OjPFXl9ZDLhsqUEuNvpAvZiiyeNuUyWjbi6DqZM2hFs,1582
@@ -1403,7 +1402,7 @@ esphome/components/lcd_pcf8574/pcf8574_display.h,sha256=QH4tY-ZqGblbOmXTcQ3LvM-w
1403
1402
  esphome/components/ld2410/__init__.py,sha256=Ic9CV8t6qFpe5_VDXinO-lrK_9kjzmtaD7IruLan4T4,3540
1404
1403
  esphome/components/ld2410/automation.h,sha256=ly1lq06Vc7XtfD9IgZwWY0wqiKlAVa9qCQsYn5cFh0s,587
1405
1404
  esphome/components/ld2410/binary_sensor.py,sha256=XKy8DlgmA0OMsTEzSX68pzYAPYknOA8RYHbE-fFb6lM,2248
1406
- esphome/components/ld2410/ld2410.cpp,sha256=jMjDyLn7vVAoLBdnl1lsm57EfN6mMDFTGnUIrOXz-vc,30936
1405
+ esphome/components/ld2410/ld2410.cpp,sha256=AldMsq2_iJ5NZh6TwBkX59wXb233l5R1SEUWtv3ZXxw,30300
1407
1406
  esphome/components/ld2410/ld2410.h,sha256=6-24T7yE69Bp23nlve7E9srvSjEvEUudFvkzmDZLni0,4167
1408
1407
  esphome/components/ld2410/sensor.py,sha256=P1LCSK-otvDuIQJ8yhxSQIxY_Zb8iDKRuK796MrKgwA,4242
1409
1408
  esphome/components/ld2410/text_sensor.py,sha256=vvkzr0HfErYORkU3u1gTpdEiXu5IKFIxDTm6gUe-zlA,1153
@@ -1484,7 +1483,7 @@ esphome/components/ledc/__init__.py,sha256=PTP_5q_K_2dNnUdkolkVd5komlEbJdS4lolCp
1484
1483
  esphome/components/ledc/ledc_output.cpp,sha256=zJNvN-b8S4repjC2WCcJviXQLdgO5ISJy9QcYq29XI0,7926
1485
1484
  esphome/components/ledc/ledc_output.h,sha256=hok37ypQ7BjJkJc22_z8p9qwkH4K1e_xRASNgMBZFyE,1663
1486
1485
  esphome/components/ledc/output.py,sha256=wZ_1alEsSESanCb3NjkDP8LTKTyWXNTXY8S0wq5KkTM,2725
1487
- esphome/components/libretiny/__init__.py,sha256=e1iDVvmiqt1TtuNZ6hCRfZ6MTWibAtlRZKd5OJYKux0,11573
1486
+ esphome/components/libretiny/__init__.py,sha256=Q6eT1pDL5bmWf7QB-a2HWb-WhbQ7tW0z0CSzb9Cjp2k,11629
1488
1487
  esphome/components/libretiny/const.py,sha256=WCN4FZoUtktRgWBijFNJ0Mr4QPahdKAnZa0A1dtYOOU,2106
1489
1488
  esphome/components/libretiny/core.cpp,sha256=Jaq_VlJpwc9iTXiH8b-2PFnNZupnJjJUQNqqHYUiues,991
1490
1489
  esphome/components/libretiny/core.h,sha256=bsl2xiT0QgansYipejruyDLMagECncUMq-ghejC6aB4,175
@@ -1950,7 +1949,7 @@ esphome/components/mqtt/custom_mqtt_device.h,sha256=4vsEvV0E_K8qd91f_l-6uh80T0-w
1950
1949
  esphome/components/mqtt/mqtt_alarm_control_panel.cpp,sha256=UgJwyMp4eLl5w3XVsf0r-yPiM56dTTckGNkx1gM-uvg,4618
1951
1950
  esphome/components/mqtt/mqtt_alarm_control_panel.h,sha256=dVadCXurMrLTR_nRTTSH0Nw5158tkwtu-gHXU0jH2Ls,875
1952
1951
  esphome/components/mqtt/mqtt_backend.h,sha256=GR1t5zKWbpub9t3W_7mVbEgHG9HtaDTPDTZBFpJoa1I,2855
1953
- esphome/components/mqtt/mqtt_backend_esp32.cpp,sha256=zrnGP6YKxBAhvWcxwlsvy8T7gnklBv2Ybw9oeu6hwwc,10416
1952
+ esphome/components/mqtt/mqtt_backend_esp32.cpp,sha256=moYkKcQlLs7iWai-4zSwfi1cxeAZ49J1AzX7zEsgV3A,10708
1954
1953
  esphome/components/mqtt/mqtt_backend_esp32.h,sha256=LcF1lIn5JjeN0NXnWcbPIeOmKxcgTrwyUxgs6XebOX8,9173
1955
1954
  esphome/components/mqtt/mqtt_backend_esp8266.h,sha256=vgp9J3GrrCvwMeE0faw17LYIM2B6zS9XS-84mlYSlQE,3275
1956
1955
  esphome/components/mqtt/mqtt_backend_libretiny.h,sha256=gyEaZF8gxgdderLTRGzwlxALYBXMXkfKJFbArDNb7F0,3292
@@ -2190,7 +2189,7 @@ esphome/components/output/switch/output_switch.h,sha256=irORSQtpjDivfCCaBQCHMek1
2190
2189
  esphome/components/packages/__init__.py,sha256=jUmmK0jWh36i87-YMOsjzPLygJdoJNlmXYwKoNjOjOM,6415
2191
2190
  esphome/components/packet_transport/__init__.py,sha256=HO_mUUQe0LQWepajoGIVGUHbcIbN3m-ZaFlA6HXII0c,6359
2192
2191
  esphome/components/packet_transport/binary_sensor.py,sha256=vysjJ9KDTzDssdNOlOT_tNVLT3jv5a_GRw1H5czPBLY,2329
2193
- esphome/components/packet_transport/packet_transport.cpp,sha256=vaWcs8--Gv-umrg4OA4JmJ4-lNu4iS4gwNjctBoIZMw,17310
2192
+ esphome/components/packet_transport/packet_transport.cpp,sha256=orygb4kg5L15h6p3i5mLQXCyKje19yDTBb3BMdML61Q,17360
2194
2193
  esphome/components/packet_transport/packet_transport.h,sha256=8REDLYgpT3tjQyvpfz3eb_WKUJN9MXqN3x9Rdt7ndOk,5029
2195
2194
  esphome/components/packet_transport/sensor.py,sha256=YOqWXwfd-E2VyHuMSE3o2ZEGjJ_d6Vn5yf4sptAS-CY,578
2196
2195
  esphome/components/partition/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -2511,7 +2510,7 @@ esphome/components/rotary_encoder/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeR
2511
2510
  esphome/components/rotary_encoder/rotary_encoder.cpp,sha256=cs7GPg3aik11ustZvJPN8GiHODvdhdvETZb5jjorTr4,10687
2512
2511
  esphome/components/rotary_encoder/rotary_encoder.h,sha256=oeCmz0ctT3CxP-16g3cie9kekgM79omeLQmunbCHRW0,4653
2513
2512
  esphome/components/rotary_encoder/sensor.py,sha256=GFnAMS8bZjY9LaqZwQOU1JIDdTdYEzItxFWXgWZP6iM,5231
2514
- esphome/components/rp2040/__init__.py,sha256=KZ2ZubHizSd04Mwa-XG0dhRC5GylshjVYv9vmcSEx4I,8459
2513
+ esphome/components/rp2040/__init__.py,sha256=b3Kit3lGqdk48GC1B07LPsgK3BrOCEjS5Woq_Aeb1c8,8517
2515
2514
  esphome/components/rp2040/boards.py,sha256=O0LRt2Bhi5yVvW11iPLOTPkW3P_2WlTonQZERaNzea4,445
2516
2515
  esphome/components/rp2040/build_pio.py.script,sha256=aNtrSnjYcLY6t0NYBGszhwMPISVNrNUg6nJtyBdfyh4,1218
2517
2516
  esphome/components/rp2040/const.py,sha256=1x4XQlMfgQux1bllBAhz9ym-aUeFglxtPnQbpG3vUYQ,147
@@ -2969,7 +2968,7 @@ esphome/components/switch/switch.h,sha256=lLrzKALopIjcH0Zq7vjjwCjrKeQsiuLoKLtBQl
2969
2968
  esphome/components/switch/binary_sensor/__init__.py,sha256=vSm7ahCF2DzXvYzbdfgAMZzcOimrO-ivfLkLf_q4kMo,760
2970
2969
  esphome/components/switch/binary_sensor/switch_binary_sensor.cpp,sha256=ZPwaqXQTS_PIdBahVr_YMToaxckCMzDJAd7PqIIApls,470
2971
2970
  esphome/components/switch/binary_sensor/switch_binary_sensor.h,sha256=xTqZLNBeZl6oah0rzOiuBfeeLTUnl-hSMzLALWhuOog,462
2972
- esphome/components/sx126x/__init__.py,sha256=QpvKZS0jNeSJqXZUcUYV0g00y3hV35wIIpVW281mRSI,11963
2971
+ esphome/components/sx126x/__init__.py,sha256=ESYxzsog9kId6zUOE6AVohHp2UzQNM8gCB-ZnOwlDYA,11941
2973
2972
  esphome/components/sx126x/automation.h,sha256=fgt45VPE4CbumQ7Cj8fsd5oKZSxDazoZROo4_sij-x0,1824
2974
2973
  esphome/components/sx126x/sx126x.cpp,sha256=e3YKvAXV8_7S5Qoo7IO-eI8OWDZ6wQuY4SpikZXgL50,16720
2975
2974
  esphome/components/sx126x/sx126x.h,sha256=-jHgmn1dNUwwGf1eGrU19Z3BxwpFX49JxoVxSUlMQjM,5312
@@ -2977,7 +2976,7 @@ esphome/components/sx126x/sx126x_reg.h,sha256=GSWkorZRYDeqMO8oTIozvfL2WLYAz66y3o
2977
2976
  esphome/components/sx126x/packet_transport/__init__.py,sha256=pQohjHA2lZTqq3ziua_W1_DVkIY6ldh1WVzh80c8zvA,716
2978
2977
  esphome/components/sx126x/packet_transport/sx126x_transport.cpp,sha256=5TBsftQSup0or1nVu5O_di08BOCx7yI0o0i30cT8RiA,697
2979
2978
  esphome/components/sx126x/packet_transport/sx126x_transport.h,sha256=P9rUlpZta5J0G_dcUU6YArz39dTHGuljk2k8uqHeRPY,833
2980
- esphome/components/sx127x/__init__.py,sha256=Mh_tBQXd9Gotkv0wxzGI78xYit-Zn_iZunmkZn9pIlE,12460
2979
+ esphome/components/sx127x/__init__.py,sha256=L-p5AW4FkA1xG6aSVEc3fDQo8pNur0j-QaEh7iwCBDg,12458
2981
2980
  esphome/components/sx127x/automation.h,sha256=MrU0gzxLiAh8Z81IByoBaDyIXkK4B3P0ctc_Mri-zjE,1814
2982
2981
  esphome/components/sx127x/sx127x.cpp,sha256=jTjDETDnosa-jRkz92IES_fQqTV0nvbeje-mu5zYGBM,17692
2983
2982
  esphome/components/sx127x/sx127x.h,sha256=CeonOXY3iEOHIRTw2VWh0jRZjvUb7C9OjdOnz5Fv8AA,4878
@@ -3333,13 +3332,13 @@ esphome/components/uptime/text_sensor/uptime_text_sensor.cpp,sha256=9kXOUyFFojTm
3333
3332
  esphome/components/uptime/text_sensor/uptime_text_sensor.h,sha256=hKsnhovbSiYZEsMFHP1A7t-02Lml_CA0qzNICSmfdy0,1493
3334
3333
  esphome/components/usb_host/__init__.py,sha256=Ch57YBggSFDrVtzNQeLl6gG0NJuWLXQLqmKAESIfc-Y,2142
3335
3334
  esphome/components/usb_host/usb_host.h,sha256=Bi1Y0ZQd_ecbEhIXdnfgO7fPEoWXxjN-hZCvTErkpdk,3426
3336
- esphome/components/usb_host/usb_host_client.cpp,sha256=XQpYQ2ZNPWOxeMOWT9RcwsRo-rvPZ3q-sLpZyeBMiJY,14631
3335
+ esphome/components/usb_host/usb_host_client.cpp,sha256=bh9CCTb9qG_5Cpks4iOwDprjGNzNonWF1hcyBrXURWQ,14645
3337
3336
  esphome/components/usb_host/usb_host_component.cpp,sha256=NmiqSWOdOg2ZgGEGV5MR8wA7GtEz2n9glR-r1INNdsM,954
3338
3337
  esphome/components/usb_uart/__init__.py,sha256=hj_dUGWhiwrlhZaiMrY4j8IX_Kn3EIk3JfCCrths7so,4951
3339
3338
  esphome/components/usb_uart/ch34x.cpp,sha256=Frz9ZsQqCJGdU8gwl7VNoNHDAgoh5ufHX43oQpNg17o,2321
3340
- esphome/components/usb_uart/cp210x.cpp,sha256=9b-XyggbRGYxDGFdNWIZQzGBRqzyK1Zi7NXTu0NmcaM,6007
3341
- esphome/components/usb_uart/usb_uart.cpp,sha256=szMt5to1nOkuu9eRhqyu57xngSzHKDDpWLaxSCMa-9o,12586
3342
- esphome/components/usb_uart/usb_uart.h,sha256=bPT_PzRfV6WIlSCqeZq7lHXzpMqFIcOIzgeGSqfknZU,4936
3339
+ esphome/components/usb_uart/cp210x.cpp,sha256=8h_-Rr0Hy7BBisGhbOulTaJUYO8_HlMZBVUj35UPqk8,6006
3340
+ esphome/components/usb_uart/usb_uart.cpp,sha256=XFQIkGDEvZmLExVAEcydQi1Sk0SluhOxQiWSOtjrS18,12863
3341
+ esphome/components/usb_uart/usb_uart.h,sha256=z6I-t409XJcVSsvWgGk_HvscM8nsmZM6593XP-qYyUE,4977
3343
3342
  esphome/components/valve/__init__.py,sha256=Zh88-A_iUBTEaQECCk2zeTUa9wqQYYDSW_PEuZYgehs,8232
3344
3343
  esphome/components/valve/automation.h,sha256=KyWITRr3fHrl0YYuY_DDSrp93fCI1dHX3at1sfnWZIk,2716
3345
3344
  esphome/components/valve/valve.cpp,sha256=uE562HP1awwV1rQ8PDZ9p22n2rq2D11hVdpKFUu9LRw,5446
@@ -3603,18 +3602,18 @@ esphome/core/color.cpp,sha256=gcFk-FTJzvrePzqgA5gvsXv8iWct0ykdVGx_ivrilR0,254
3603
3602
  esphome/core/color.h,sha256=K2iTTKgOgXcCm61S1f2P_k7YheKP654gUubWq5X0FhE,6647
3604
3603
  esphome/core/component.cpp,sha256=-25rWUKjBdhkf7mbkhDyJql7JesZKr4DrfBOCEh3tSQ,16802
3605
3604
  esphome/core/component.h,sha256=Z1TYaQDGkoddm75zaPTQc_C0STpCCl200oDZsoc6yAk,17985
3606
- esphome/core/component_iterator.cpp,sha256=T9dEbhKSbuRDwxC1XkHGEYiydCBOowhigTt5BE8fYxI,11072
3607
- esphome/core/component_iterator.h,sha256=mObFL2UMnvWOrvVqj8M6NcGUUGFKVRNrfGCd0SGYo0k,3764
3605
+ esphome/core/component_iterator.cpp,sha256=VD_bSv474jQlKctKIzYSPUK8zpm01PJ1Fymix1c92Jg,11121
3606
+ esphome/core/component_iterator.h,sha256=-j9hGIY8mCmgq2nLuoG_IFY0lSoHkImXMEVtUKYpngA,3791
3608
3607
  esphome/core/config.py,sha256=l2z33FfZoBsg06RQajomXbepXUZD1oXwEnTv_yy1Sds,19628
3609
3608
  esphome/core/controller.cpp,sha256=nRJZK4B5WWad98tGGEESSGcKWcpWhExaUOIXO3Iu_xQ,4602
3610
3609
  esphome/core/controller.h,sha256=UCvtMbw21KvAQHaO_fgDRr1OjcXEYzEC8JupPmHrNic,3708
3611
3610
  esphome/core/datatypes.h,sha256=TNuXjWQIK7KjDwMAccMFws2SimaUlsgim96SI0cCdCY,2110
3612
- esphome/core/defines.h,sha256=fz1NUEAENinKU91G4jYEwQa9vAMyrI_mf99xUUvJNZY,5865
3611
+ esphome/core/defines.h,sha256=p58MqkO1WCVCpy9qe5O-GC1LncWZA74QHHAPce63y2E,5860
3613
3612
  esphome/core/device.h,sha256=mYTwRg92-BU8uTTzmrufH-KkHCMLKsKWnvM-mjzw6I0,531
3614
3613
  esphome/core/doxygen.h,sha256=9fAJ2T-1z96-NYnj63vQhsnKthHBrh3EqBnY0h3ZN-A,439
3615
3614
  esphome/core/entity_base.cpp,sha256=4JMAGN8w3bMW-kTchQxlbA-zS43NOdYhT1Fo0Celx78,2453
3616
3615
  esphome/core/entity_base.h,sha256=bzNEdGDbJsO0ijowJHmLMLeCN3mY1hqzWK4dF39bpik,6429
3617
- esphome/core/entity_helpers.py,sha256=zJ50lXSva4CheQzteppLNDNI5cCNZRV_ha4OpKfiFQs,7877
3616
+ esphome/core/entity_helpers.py,sha256=03-t7OcXa8L-_634OAEU9s-opgjoIKqC9acXHoXR6lA,8169
3618
3617
  esphome/core/event_pool.h,sha256=TjA2sl_s5ScKC9d_5nssvImbPkpJJUWo5DDZwCaZ0QU,2457
3619
3618
  esphome/core/gpio.h,sha256=kLkCnPxu4_1CsLR4BI_Baj1lDGoRIh8uubbwsIkJPIA,2575
3620
3619
  esphome/core/hal.h,sha256=Le0-vtdDylYCaE9i4yvrv5-Y5PB5xoL3PM2FfMJsIeA,970
@@ -3629,8 +3628,8 @@ esphome/core/optional.h,sha256=uKMzglliXSA5eC3ujwrADmyt8m7X4WkBQcOL6p3ET7E,7144
3629
3628
  esphome/core/preferences.h,sha256=RxgWuAi-uo6SZiK8UKX4KTwVfIMnaaLvrZP2rqTn_mE,1959
3630
3629
  esphome/core/ring_buffer.cpp,sha256=6vOoKNjO4dSLYfqJYM8AXclpKgQOH6C79CqocwTSv-k,3526
3631
3630
  esphome/core/ring_buffer.h,sha256=4SeN2DYZLCHrLIjSPDsiAynIjwOoItiRUDO-u1wjq-o,2997
3632
- esphome/core/scheduler.cpp,sha256=l7TEzGyuLRaBb4NREf8nf87pLxWO770XJvxyjnKUgIQ,20026
3633
- esphome/core/scheduler.h,sha256=6v06KrEfrrVvwGVO_jRqluiRlusnVNiawN_AlfHFlS4,8353
3631
+ esphome/core/scheduler.cpp,sha256=EujNgcC6CgG_IGydPyylRB3qC4Q34cgcn7eIfqD1Zx0,19968
3632
+ esphome/core/scheduler.h,sha256=Im_s45ic3Km2ejByqVfeTSMYWJDu6oAf3zVvn1EM_iw,8193
3634
3633
  esphome/core/string_ref.cpp,sha256=of1TYMY6t3t4HjjPLSiItuPSa62AMG0lK_CU2HS1RvM,242
3635
3634
  esphome/core/string_ref.h,sha256=Rd8HVBiUZrPA3TkPCwuAxGw91VX-e3Fky812OCNhNvA,5227
3636
3635
  esphome/core/time.cpp,sha256=ML3sAvlSgDaUkhbPmBkUkSFhGM78j0d7cL8CHAIgfow,7667
@@ -3656,9 +3655,9 @@ esphome/dashboard/util/itertools.py,sha256=8eLrWEWmICLtXNxkKdYPQV0c_N4GEz8m9Npnb
3656
3655
  esphome/dashboard/util/password.py,sha256=cQz3b9B-ijTe7zS6BeCW0hc3pWv6JjC78jmnycYYAh8,321
3657
3656
  esphome/dashboard/util/subprocess.py,sha256=T8EW6dbU4LPd2DG1dRrdh8li71tt6J1isn411poMhkk,1022
3658
3657
  esphome/dashboard/util/text.py,sha256=wwFtORlvHjsYkqb68IT-772LHAhWxT4OtnkIcPICQB0,317
3659
- esphome-2025.7.0b1.dist-info/licenses/LICENSE,sha256=HzEjkBInJe44L4WvAOPfhPJJDNj6YbnqFyvGWRzArGM,36664
3660
- esphome-2025.7.0b1.dist-info/METADATA,sha256=fAut5STUB7sfV50G_scormbtSvn6xk1ivwOULXfI5bk,3707
3661
- esphome-2025.7.0b1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
3662
- esphome-2025.7.0b1.dist-info/entry_points.txt,sha256=mIxVNuWtbYzeEcaWCl-AQ-97aBOWbnYBAK8nbF6P4M0,50
3663
- esphome-2025.7.0b1.dist-info/top_level.txt,sha256=0GSXEW3cnITpgG3qnsSMz0qoqJHAFyfw7Y8MVtEf1Yk,8
3664
- esphome-2025.7.0b1.dist-info/RECORD,,
3658
+ esphome-2025.7.0b2.dist-info/licenses/LICENSE,sha256=HzEjkBInJe44L4WvAOPfhPJJDNj6YbnqFyvGWRzArGM,36664
3659
+ esphome-2025.7.0b2.dist-info/METADATA,sha256=BlTTcBCTTdohaEPcEGQoGolJbebFFYm2EJncogIWCLw,3707
3660
+ esphome-2025.7.0b2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
3661
+ esphome-2025.7.0b2.dist-info/entry_points.txt,sha256=mIxVNuWtbYzeEcaWCl-AQ-97aBOWbnYBAK8nbF6P4M0,50
3662
+ esphome-2025.7.0b2.dist-info/top_level.txt,sha256=0GSXEW3cnITpgG3qnsSMz0qoqJHAFyfw7Y8MVtEf1Yk,8
3663
+ esphome-2025.7.0b2.dist-info/RECORD,,
@@ -1,359 +0,0 @@
1
- #pragma once
2
-
3
- #include "proto.h"
4
- #include <cstdint>
5
- #include <string>
6
-
7
- namespace esphome {
8
- namespace api {
9
-
10
- class ProtoSize {
11
- public:
12
- /**
13
- * @brief ProtoSize class for Protocol Buffer serialization size calculation
14
- *
15
- * This class provides static methods to calculate the exact byte counts needed
16
- * for encoding various Protocol Buffer field types. All methods are designed to be
17
- * efficient for the common case where many fields have default values.
18
- *
19
- * Implements Protocol Buffer encoding size calculation according to:
20
- * https://protobuf.dev/programming-guides/encoding/
21
- *
22
- * Key features:
23
- * - Early-return optimization for zero/default values
24
- * - Direct total_size updates to avoid unnecessary additions
25
- * - Specialized handling for different field types according to protobuf spec
26
- * - Templated helpers for repeated fields and messages
27
- */
28
-
29
- /**
30
- * @brief Calculates the size in bytes needed to encode a uint32_t value as a varint
31
- *
32
- * @param value The uint32_t value to calculate size for
33
- * @return The number of bytes needed to encode the value
34
- */
35
- static inline uint32_t varint(uint32_t value) {
36
- // Optimized varint size calculation using leading zeros
37
- // Each 7 bits requires one byte in the varint encoding
38
- if (value < 128)
39
- return 1; // 7 bits, common case for small values
40
-
41
- // For larger values, count bytes needed based on the position of the highest bit set
42
- if (value < 16384) {
43
- return 2; // 14 bits
44
- } else if (value < 2097152) {
45
- return 3; // 21 bits
46
- } else if (value < 268435456) {
47
- return 4; // 28 bits
48
- } else {
49
- return 5; // 32 bits (maximum for uint32_t)
50
- }
51
- }
52
-
53
- /**
54
- * @brief Calculates the size in bytes needed to encode a uint64_t value as a varint
55
- *
56
- * @param value The uint64_t value to calculate size for
57
- * @return The number of bytes needed to encode the value
58
- */
59
- static inline uint32_t varint(uint64_t value) {
60
- // Handle common case of values fitting in uint32_t (vast majority of use cases)
61
- if (value <= UINT32_MAX) {
62
- return varint(static_cast<uint32_t>(value));
63
- }
64
-
65
- // For larger values, determine size based on highest bit position
66
- if (value < (1ULL << 35)) {
67
- return 5; // 35 bits
68
- } else if (value < (1ULL << 42)) {
69
- return 6; // 42 bits
70
- } else if (value < (1ULL << 49)) {
71
- return 7; // 49 bits
72
- } else if (value < (1ULL << 56)) {
73
- return 8; // 56 bits
74
- } else if (value < (1ULL << 63)) {
75
- return 9; // 63 bits
76
- } else {
77
- return 10; // 64 bits (maximum for uint64_t)
78
- }
79
- }
80
-
81
- /**
82
- * @brief Calculates the size in bytes needed to encode an int32_t value as a varint
83
- *
84
- * Special handling is needed for negative values, which are sign-extended to 64 bits
85
- * in Protocol Buffers, resulting in a 10-byte varint.
86
- *
87
- * @param value The int32_t value to calculate size for
88
- * @return The number of bytes needed to encode the value
89
- */
90
- static inline uint32_t varint(int32_t value) {
91
- // Negative values are sign-extended to 64 bits in protocol buffers,
92
- // which always results in a 10-byte varint for negative int32
93
- if (value < 0) {
94
- return 10; // Negative int32 is always 10 bytes long
95
- }
96
- // For non-negative values, use the uint32_t implementation
97
- return varint(static_cast<uint32_t>(value));
98
- }
99
-
100
- /**
101
- * @brief Calculates the size in bytes needed to encode an int64_t value as a varint
102
- *
103
- * @param value The int64_t value to calculate size for
104
- * @return The number of bytes needed to encode the value
105
- */
106
- static inline uint32_t varint(int64_t value) {
107
- // For int64_t, we convert to uint64_t and calculate the size
108
- // This works because the bit pattern determines the encoding size,
109
- // and we've handled negative int32 values as a special case above
110
- return varint(static_cast<uint64_t>(value));
111
- }
112
-
113
- /**
114
- * @brief Calculates the size in bytes needed to encode a field ID and wire type
115
- *
116
- * @param field_id The field identifier
117
- * @param type The wire type value (from the WireType enum in the protobuf spec)
118
- * @return The number of bytes needed to encode the field ID and wire type
119
- */
120
- static inline uint32_t field(uint32_t field_id, uint32_t type) {
121
- uint32_t tag = (field_id << 3) | (type & 0b111);
122
- return varint(tag);
123
- }
124
-
125
- /**
126
- * @brief Common parameters for all add_*_field methods
127
- *
128
- * All add_*_field methods follow these common patterns:
129
- *
130
- * @param total_size Reference to the total message size to update
131
- * @param field_id_size Pre-calculated size of the field ID in bytes
132
- * @param value The value to calculate size for (type varies)
133
- * @param force Whether to calculate size even if the value is default/zero/empty
134
- *
135
- * Each method follows this implementation pattern:
136
- * 1. Skip calculation if value is default (0, false, empty) and not forced
137
- * 2. Calculate the size based on the field's encoding rules
138
- * 3. Add the field_id_size + calculated value size to total_size
139
- */
140
-
141
- /**
142
- * @brief Calculates and adds the size of an int32 field to the total message size
143
- */
144
- static inline void add_int32_field(uint32_t &total_size, uint32_t field_id_size, int32_t value, bool force = false) {
145
- // Skip calculation if value is zero and not forced
146
- if (value == 0 && !force) {
147
- return; // No need to update total_size
148
- }
149
-
150
- // Calculate and directly add to total_size
151
- if (value < 0) {
152
- // Negative values are encoded as 10-byte varints in protobuf
153
- total_size += field_id_size + 10;
154
- } else {
155
- // For non-negative values, use the standard varint size
156
- total_size += field_id_size + varint(static_cast<uint32_t>(value));
157
- }
158
- }
159
-
160
- /**
161
- * @brief Calculates and adds the size of a uint32 field to the total message size
162
- */
163
- static inline void add_uint32_field(uint32_t &total_size, uint32_t field_id_size, uint32_t value,
164
- bool force = false) {
165
- // Skip calculation if value is zero and not forced
166
- if (value == 0 && !force) {
167
- return; // No need to update total_size
168
- }
169
-
170
- // Calculate and directly add to total_size
171
- total_size += field_id_size + varint(value);
172
- }
173
-
174
- /**
175
- * @brief Calculates and adds the size of a boolean field to the total message size
176
- */
177
- static inline void add_bool_field(uint32_t &total_size, uint32_t field_id_size, bool value, bool force = false) {
178
- // Skip calculation if value is false and not forced
179
- if (!value && !force) {
180
- return; // No need to update total_size
181
- }
182
-
183
- // Boolean fields always use 1 byte when true
184
- total_size += field_id_size + 1;
185
- }
186
-
187
- /**
188
- * @brief Calculates and adds the size of a fixed field to the total message size
189
- *
190
- * Fixed fields always take exactly N bytes (4 for fixed32/float, 8 for fixed64/double).
191
- *
192
- * @tparam NumBytes The number of bytes for this fixed field (4 or 8)
193
- * @param is_nonzero Whether the value is non-zero
194
- */
195
- template<uint32_t NumBytes>
196
- static inline void add_fixed_field(uint32_t &total_size, uint32_t field_id_size, bool is_nonzero,
197
- bool force = false) {
198
- // Skip calculation if value is zero and not forced
199
- if (!is_nonzero && !force) {
200
- return; // No need to update total_size
201
- }
202
-
203
- // Fixed fields always take exactly NumBytes
204
- total_size += field_id_size + NumBytes;
205
- }
206
-
207
- /**
208
- * @brief Calculates and adds the size of an enum field to the total message size
209
- *
210
- * Enum fields are encoded as uint32 varints.
211
- */
212
- static inline void add_enum_field(uint32_t &total_size, uint32_t field_id_size, uint32_t value, bool force = false) {
213
- // Skip calculation if value is zero and not forced
214
- if (value == 0 && !force) {
215
- return; // No need to update total_size
216
- }
217
-
218
- // Enums are encoded as uint32
219
- total_size += field_id_size + varint(value);
220
- }
221
-
222
- /**
223
- * @brief Calculates and adds the size of a sint32 field to the total message size
224
- *
225
- * Sint32 fields use ZigZag encoding, which is more efficient for negative values.
226
- */
227
- static inline void add_sint32_field(uint32_t &total_size, uint32_t field_id_size, int32_t value, bool force = false) {
228
- // Skip calculation if value is zero and not forced
229
- if (value == 0 && !force) {
230
- return; // No need to update total_size
231
- }
232
-
233
- // ZigZag encoding for sint32: (n << 1) ^ (n >> 31)
234
- uint32_t zigzag = (static_cast<uint32_t>(value) << 1) ^ (static_cast<uint32_t>(value >> 31));
235
- total_size += field_id_size + varint(zigzag);
236
- }
237
-
238
- /**
239
- * @brief Calculates and adds the size of an int64 field to the total message size
240
- */
241
- static inline void add_int64_field(uint32_t &total_size, uint32_t field_id_size, int64_t value, bool force = false) {
242
- // Skip calculation if value is zero and not forced
243
- if (value == 0 && !force) {
244
- return; // No need to update total_size
245
- }
246
-
247
- // Calculate and directly add to total_size
248
- total_size += field_id_size + varint(value);
249
- }
250
-
251
- /**
252
- * @brief Calculates and adds the size of a uint64 field to the total message size
253
- */
254
- static inline void add_uint64_field(uint32_t &total_size, uint32_t field_id_size, uint64_t value,
255
- bool force = false) {
256
- // Skip calculation if value is zero and not forced
257
- if (value == 0 && !force) {
258
- return; // No need to update total_size
259
- }
260
-
261
- // Calculate and directly add to total_size
262
- total_size += field_id_size + varint(value);
263
- }
264
-
265
- /**
266
- * @brief Calculates and adds the size of a sint64 field to the total message size
267
- *
268
- * Sint64 fields use ZigZag encoding, which is more efficient for negative values.
269
- */
270
- static inline void add_sint64_field(uint32_t &total_size, uint32_t field_id_size, int64_t value, bool force = false) {
271
- // Skip calculation if value is zero and not forced
272
- if (value == 0 && !force) {
273
- return; // No need to update total_size
274
- }
275
-
276
- // ZigZag encoding for sint64: (n << 1) ^ (n >> 63)
277
- uint64_t zigzag = (static_cast<uint64_t>(value) << 1) ^ (static_cast<uint64_t>(value >> 63));
278
- total_size += field_id_size + varint(zigzag);
279
- }
280
-
281
- /**
282
- * @brief Calculates and adds the size of a string/bytes field to the total message size
283
- */
284
- static inline void add_string_field(uint32_t &total_size, uint32_t field_id_size, const std::string &str,
285
- bool force = false) {
286
- // Skip calculation if string is empty and not forced
287
- if (str.empty() && !force) {
288
- return; // No need to update total_size
289
- }
290
-
291
- // Calculate and directly add to total_size
292
- const uint32_t str_size = static_cast<uint32_t>(str.size());
293
- total_size += field_id_size + varint(str_size) + str_size;
294
- }
295
-
296
- /**
297
- * @brief Calculates and adds the size of a nested message field to the total message size
298
- *
299
- * This helper function directly updates the total_size reference if the nested size
300
- * is greater than zero or force is true.
301
- *
302
- * @param nested_size The pre-calculated size of the nested message
303
- */
304
- static inline void add_message_field(uint32_t &total_size, uint32_t field_id_size, uint32_t nested_size,
305
- bool force = false) {
306
- // Skip calculation if nested message is empty and not forced
307
- if (nested_size == 0 && !force) {
308
- return; // No need to update total_size
309
- }
310
-
311
- // Calculate and directly add to total_size
312
- // Field ID + length varint + nested message content
313
- total_size += field_id_size + varint(nested_size) + nested_size;
314
- }
315
-
316
- /**
317
- * @brief Calculates and adds the size of a nested message field to the total message size
318
- *
319
- * This version takes a ProtoMessage object, calculates its size internally,
320
- * and updates the total_size reference. This eliminates the need for a temporary variable
321
- * at the call site.
322
- *
323
- * @param message The nested message object
324
- */
325
- static inline void add_message_object(uint32_t &total_size, uint32_t field_id_size, const ProtoMessage &message,
326
- bool force = false) {
327
- uint32_t nested_size = 0;
328
- message.calculate_size(nested_size);
329
-
330
- // Use the base implementation with the calculated nested_size
331
- add_message_field(total_size, field_id_size, nested_size, force);
332
- }
333
-
334
- /**
335
- * @brief Calculates and adds the sizes of all messages in a repeated field to the total message size
336
- *
337
- * This helper processes a vector of message objects, calculating the size for each message
338
- * and adding it to the total size.
339
- *
340
- * @tparam MessageType The type of the nested messages in the vector
341
- * @param messages Vector of message objects
342
- */
343
- template<typename MessageType>
344
- static inline void add_repeated_message(uint32_t &total_size, uint32_t field_id_size,
345
- const std::vector<MessageType> &messages) {
346
- // Skip if the vector is empty
347
- if (messages.empty()) {
348
- return;
349
- }
350
-
351
- // For repeated fields, always use force=true
352
- for (const auto &message : messages) {
353
- add_message_object(total_size, field_id_size, message, true);
354
- }
355
- }
356
- };
357
-
358
- } // namespace api
359
- } // namespace esphome