esphome 2025.7.4__py3-none-any.whl → 2025.8.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- esphome/__main__.py +190 -83
- esphome/automation.py +2 -4
- esphome/build_gen/__init__.py +0 -0
- esphome/build_gen/platformio.py +102 -0
- esphome/components/a4988/a4988.cpp +0 -1
- esphome/components/absolute_humidity/absolute_humidity.cpp +0 -2
- esphome/components/absolute_humidity/sensor.py +2 -2
- esphome/components/adc/__init__.py +123 -85
- esphome/components/adc/adc_sensor.h +98 -35
- esphome/components/adc/adc_sensor_common.cpp +10 -4
- esphome/components/adc/adc_sensor_esp32.cpp +291 -123
- esphome/components/adc/adc_sensor_esp8266.cpp +1 -4
- esphome/components/adc/adc_sensor_libretiny.cpp +1 -2
- esphome/components/adc/adc_sensor_rp2040.cpp +1 -2
- esphome/components/adc/adc_sensor_zephyr.cpp +207 -0
- esphome/components/adc/sensor.py +61 -27
- esphome/components/adc128s102/adc128s102.cpp +1 -4
- esphome/components/ade7880/sensor.py +75 -49
- esphome/components/ads1115/ads1115.cpp +0 -1
- esphome/components/ads1118/ads1118.cpp +0 -1
- esphome/components/ags10/ags10.cpp +0 -4
- esphome/components/aht10/aht10.cpp +0 -4
- esphome/components/aic3204/aic3204.cpp +0 -2
- esphome/components/airthings_wave_plus/__init__.py +1 -1
- esphome/components/airthings_wave_plus/airthings_wave_plus.cpp +22 -4
- esphome/components/airthings_wave_plus/airthings_wave_plus.h +10 -1
- esphome/components/airthings_wave_plus/sensor.py +55 -28
- esphome/components/alarm_control_panel/__init__.py +4 -9
- esphome/components/am2315c/am2315c.cpp +0 -2
- esphome/components/am2320/am2320.cpp +0 -1
- esphome/components/animation/__init__.py +14 -11
- esphome/components/apds9306/apds9306.cpp +0 -4
- esphome/components/apds9960/apds9960.cpp +0 -1
- esphome/components/api/__init__.py +29 -4
- esphome/components/api/api_connection.cpp +378 -401
- esphome/components/api/api_connection.h +112 -56
- esphome/components/api/api_frame_helper.cpp +69 -896
- esphome/components/api/api_frame_helper.h +31 -126
- esphome/components/api/api_frame_helper_noise.cpp +583 -0
- esphome/components/api/api_frame_helper_noise.h +68 -0
- esphome/components/api/api_frame_helper_plaintext.cpp +290 -0
- esphome/components/api/api_frame_helper_plaintext.h +53 -0
- esphome/components/api/api_noise_context.h +2 -4
- esphome/components/api/api_pb2.cpp +1601 -1808
- esphome/components/api/api_pb2.h +367 -323
- esphome/components/api/api_pb2_dump.cpp +1137 -3466
- esphome/components/api/api_pb2_includes.h +34 -0
- esphome/components/api/api_pb2_service.cpp +94 -105
- esphome/components/api/api_pb2_service.h +27 -16
- esphome/components/api/api_server.cpp +18 -17
- esphome/components/api/api_server.h +8 -5
- esphome/components/api/client.py +16 -8
- esphome/components/api/custom_api_device.h +68 -14
- esphome/components/api/homeassistant_service.h +24 -19
- esphome/components/api/list_entities.cpp +3 -5
- esphome/components/api/list_entities.h +2 -4
- esphome/components/api/proto.cpp +3 -5
- esphome/components/api/proto.h +239 -274
- esphome/components/api/subscribe_state.cpp +2 -4
- esphome/components/api/subscribe_state.h +2 -4
- esphome/components/api/user_services.cpp +2 -4
- esphome/components/api/user_services.h +8 -8
- esphome/components/as3935/as3935.cpp +0 -2
- esphome/components/as3935_spi/as3935_spi.cpp +0 -2
- esphome/components/as5600/__init__.py +1 -1
- esphome/components/as5600/as5600.cpp +0 -2
- esphome/components/as5600/sensor/__init__.py +0 -1
- esphome/components/as7341/as7341.cpp +0 -1
- esphome/components/async_tcp/__init__.py +1 -1
- esphome/components/at581x/at581x.cpp +1 -1
- esphome/components/atm90e26/atm90e26.cpp +0 -1
- esphome/components/atm90e32/atm90e32.cpp +475 -116
- esphome/components/atm90e32/atm90e32.h +43 -5
- esphome/components/audio/audio.h +2 -2
- esphome/components/axs15231/touchscreen/axs15231_touchscreen.cpp +0 -2
- esphome/components/beken_spi_led_strip/led_strip.cpp +0 -2
- esphome/components/bh1750/bh1750.cpp +0 -1
- esphome/components/binary_sensor/__init__.py +14 -12
- esphome/components/ble_client/__init__.py +4 -7
- esphome/components/bluetooth_proxy/__init__.py +40 -3
- esphome/components/bluetooth_proxy/bluetooth_connection.cpp +392 -81
- esphome/components/bluetooth_proxy/bluetooth_connection.h +16 -5
- esphome/components/bluetooth_proxy/bluetooth_proxy.cpp +102 -311
- esphome/components/bluetooth_proxy/bluetooth_proxy.h +30 -14
- esphome/components/bme280_base/bme280_base.cpp +15 -16
- esphome/components/bme680/bme680.cpp +2 -3
- esphome/components/bme680_bsec/bme680_bsec.cpp +0 -2
- esphome/components/bme68x_bsec2/bme68x_bsec2.cpp +0 -2
- esphome/components/bmi160/bmi160.cpp +0 -1
- esphome/components/bmp085/bmp085.cpp +0 -1
- esphome/components/bmp280_base/bmp280_base.cpp +13 -14
- esphome/components/bmp3xx_base/bmp3xx_base.cpp +0 -1
- esphome/components/bmp581/bmp581.cpp +0 -2
- esphome/components/bp1658cj/bp1658cj.cpp +0 -1
- esphome/components/bp5758d/bp5758d.cpp +0 -1
- esphome/components/button/__init__.py +0 -1
- esphome/components/canbus/__init__.py +2 -3
- esphome/components/canbus/canbus.cpp +0 -1
- esphome/components/cap1188/cap1188.cpp +0 -2
- esphome/components/captive_portal/__init__.py +1 -1
- esphome/components/cd74hc4067/cd74hc4067.cpp +0 -2
- esphome/components/ch422g/ch422g.cpp +0 -1
- esphome/components/chsc6x/chsc6x_touchscreen.cpp +0 -3
- esphome/components/climate/__init__.py +0 -1
- esphome/components/climate/climate_traits.h +24 -0
- esphome/components/cm1106/cm1106.cpp +0 -1
- esphome/components/const/__init__.py +6 -0
- esphome/components/cover/__init__.py +0 -1
- esphome/components/cover/cover.cpp +9 -13
- esphome/components/cs5460a/cs5460a.cpp +0 -2
- esphome/components/cse7761/cse7761.cpp +0 -1
- esphome/components/cst226/touchscreen/cst226_touchscreen.cpp +0 -2
- esphome/components/cst816/touchscreen/cst816_touchscreen.cpp +0 -2
- esphome/components/dac7678/dac7678_output.cpp +0 -2
- esphome/components/dallas_temp/dallas_temp.cpp +0 -1
- esphome/components/datetime/__init__.py +0 -2
- esphome/components/debug/__init__.py +15 -1
- esphome/components/debug/debug_zephyr.cpp +281 -0
- esphome/components/debug/sensor.py +2 -1
- esphome/components/deep_sleep/deep_sleep_component.cpp +0 -1
- esphome/components/deep_sleep/deep_sleep_esp32.cpp +20 -1
- esphome/components/dfrobot_sen0395/__init__.py +1 -2
- esphome/components/dht/dht.cpp +0 -1
- esphome/components/dht12/dht12.cpp +0 -1
- esphome/components/display/__init__.py +16 -3
- esphome/components/display_menu_base/__init__.py +1 -1
- esphome/components/dps310/dps310.cpp +0 -2
- esphome/components/ds1307/ds1307.cpp +0 -1
- esphome/components/ds2484/ds2484.cpp +0 -1
- esphome/components/duty_cycle/duty_cycle_sensor.cpp +0 -1
- esphome/components/ee895/ee895.cpp +0 -1
- esphome/components/ektf2232/touchscreen/ektf2232.cpp +0 -1
- esphome/components/emc2101/emc2101.cpp +0 -2
- esphome/components/ens160_base/ens160_base.cpp +0 -2
- esphome/components/ens210/ens210.cpp +0 -1
- esphome/components/es7210/es7210.cpp +0 -2
- esphome/components/es7243e/es7243e.cpp +0 -2
- esphome/components/es8156/es8156.cpp +0 -2
- esphome/components/es8311/es8311.cpp +0 -2
- esphome/components/es8388/es8388.cpp +0 -2
- esphome/components/esp32/__init__.py +203 -60
- esphome/components/esp32/boards.py +17 -0
- esphome/components/esp32/gpio.cpp +0 -1
- esphome/components/esp32/gpio.py +1 -2
- esphome/components/esp32/gpio_esp32_h2.py +2 -7
- esphome/components/esp32/gpio_esp32_p4.py +2 -7
- esphome/components/esp32/post_build.py.script +112 -61
- esphome/components/esp32_ble/__init__.py +41 -2
- esphome/components/esp32_ble/ble.cpp +14 -10
- esphome/components/esp32_ble/ble.h +18 -18
- esphome/components/esp32_ble/ble_advertising.cpp +5 -5
- esphome/components/esp32_ble/ble_advertising.h +7 -5
- esphome/components/esp32_ble/ble_event.h +139 -73
- esphome/components/esp32_ble/ble_scan_result.h +2 -4
- esphome/components/esp32_ble/ble_uuid.cpp +5 -5
- esphome/components/esp32_ble/ble_uuid.h +6 -5
- esphome/components/esp32_ble_beacon/__init__.py +4 -0
- esphome/components/esp32_ble_client/__init__.py +1 -1
- esphome/components/esp32_ble_client/ble_characteristic.cpp +4 -4
- esphome/components/esp32_ble_client/ble_characteristic.h +6 -4
- esphome/components/esp32_ble_client/ble_client_base.cpp +155 -104
- esphome/components/esp32_ble_client/ble_client_base.h +17 -6
- esphome/components/esp32_ble_client/ble_descriptor.h +6 -4
- esphome/components/esp32_ble_client/ble_service.cpp +4 -4
- esphome/components/esp32_ble_client/ble_service.h +6 -4
- esphome/components/esp32_ble_server/__init__.py +15 -12
- esphome/components/esp32_ble_tracker/__init__.py +79 -11
- esphome/components/esp32_ble_tracker/automation.h +4 -4
- esphome/components/esp32_ble_tracker/esp32_ble_tracker.cpp +264 -261
- esphome/components/esp32_ble_tracker/esp32_ble_tracker.h +103 -37
- esphome/components/esp32_camera/__init__.py +13 -1
- esphome/components/esp32_camera/esp32_camera.cpp +7 -2
- esphome/components/esp32_camera/esp32_camera.h +1 -0
- esphome/components/esp32_dac/esp32_dac.cpp +3 -19
- esphome/components/esp32_dac/esp32_dac.h +4 -8
- esphome/components/esp32_rmt_led_strip/led_strip.cpp +1 -6
- esphome/components/esp32_rmt_led_strip/light.py +1 -1
- esphome/components/esp32_touch/__init__.py +2 -3
- esphome/components/esp32_touch/esp32_touch.h +9 -6
- esphome/components/esp32_touch/esp32_touch_common.cpp +2 -0
- esphome/components/esp32_touch/esp32_touch_v1.cpp +7 -9
- esphome/components/esp32_touch/esp32_touch_v2.cpp +10 -6
- esphome/components/esp8266/__init__.py +3 -1
- esphome/components/esp8266_pwm/esp8266_pwm.cpp +0 -1
- esphome/components/esphome/ota/__init__.py +1 -2
- esphome/components/esphome/ota/ota_esphome.cpp +150 -77
- esphome/components/esphome/ota/ota_esphome.h +8 -1
- esphome/components/espnow/__init__.py +309 -0
- esphome/components/espnow/automation.h +175 -0
- esphome/components/espnow/espnow_component.cpp +468 -0
- esphome/components/espnow/espnow_component.h +183 -0
- esphome/components/espnow/espnow_err.h +19 -0
- esphome/components/espnow/espnow_packet.h +166 -0
- esphome/components/ethernet/__init__.py +7 -1
- esphome/components/ethernet/esp_eth_phy_jl1101.c +5 -0
- esphome/components/ethernet/ethernet_component.cpp +0 -1
- esphome/components/ethernet/ethernet_component.h +4 -0
- esphome/components/ethernet_info/ethernet_info_text_sensor.h +0 -3
- esphome/components/event/__init__.py +0 -1
- esphome/components/factory_reset/__init__.py +92 -0
- esphome/components/factory_reset/factory_reset.cpp +76 -0
- esphome/components/factory_reset/factory_reset.h +43 -0
- esphome/components/fan/__init__.py +0 -1
- esphome/components/fan/fan_traits.h +16 -0
- esphome/components/fastled_base/fastled_light.cpp +0 -1
- esphome/components/fastled_spi/light.py +1 -3
- esphome/components/fingerprint_grow/fingerprint_grow.cpp +0 -2
- esphome/components/font/__init__.py +9 -1
- esphome/components/fs3000/fs3000.cpp +0 -2
- esphome/components/ft5x06/touchscreen/ft5x06_touchscreen.cpp +0 -2
- esphome/components/ft63x6/ft63x6.cpp +0 -1
- esphome/components/gdk101/gdk101.cpp +0 -1
- esphome/components/gl_r01_i2c/gl_r01_i2c.cpp +0 -1
- esphome/components/gl_r01_i2c/sensor.py +1 -1
- esphome/components/gpio/one_wire/gpio_one_wire.cpp +0 -1
- esphome/components/gpio/switch/gpio_switch.cpp +0 -2
- esphome/components/gpio_expander/cached_gpio.h +24 -15
- esphome/components/gps/__init__.py +6 -2
- esphome/components/gps/gps.cpp +50 -49
- esphome/components/gps/gps.h +4 -8
- esphome/components/gps/time/gps_time.cpp +3 -9
- esphome/components/gps/time/gps_time.h +4 -7
- esphome/components/graph/__init__.py +1 -1
- esphome/components/grove_gas_mc_v2/grove_gas_mc_v2.cpp +0 -1
- esphome/components/grove_tb6612fng/grove_tb6612fng.cpp +0 -1
- esphome/components/gt911/touchscreen/gt911_touchscreen.cpp +21 -12
- esphome/components/gt911/touchscreen/gt911_touchscreen.h +26 -2
- esphome/components/haier/climate.py +5 -10
- esphome/components/haier/haier_base.cpp +0 -1
- esphome/components/hbridge/switch/hbridge_switch.cpp +0 -2
- esphome/components/hdc1080/hdc1080.cpp +0 -2
- esphome/components/heatpumpir/climate.py +2 -2
- esphome/components/hlw8012/hlw8012.cpp +0 -1
- esphome/components/hm3301/hm3301.cpp +0 -1
- esphome/components/hmc5883l/hmc5883l.cpp +0 -1
- esphome/components/homeassistant/__init__.py +1 -0
- esphome/components/homeassistant/number/__init__.py +1 -0
- esphome/components/homeassistant/number/homeassistant_number.cpp +11 -7
- esphome/components/homeassistant/switch/__init__.py +1 -0
- esphome/components/homeassistant/switch/homeassistant_switch.cpp +9 -5
- esphome/components/honeywellabp/honeywellabp.cpp +1 -4
- esphome/components/host/__init__.py +2 -0
- esphome/components/hte501/hte501.cpp +0 -1
- esphome/components/http_request/__init__.py +2 -3
- esphome/components/http_request/http_request_idf.cpp +2 -2
- esphome/components/htu21d/htu21d.cpp +0 -2
- esphome/components/htu31d/htu31d.cpp +0 -2
- esphome/components/hx711/hx711.cpp +0 -1
- esphome/components/hydreon_rgxx/hydreon_rgxx.cpp +0 -1
- esphome/components/hydreon_rgxx/sensor.py +4 -5
- esphome/components/i2c/i2c_bus.h +1 -1
- esphome/components/i2c/i2c_bus_arduino.cpp +1 -2
- esphome/components/i2c/i2c_bus_esp_idf.cpp +192 -17
- esphome/components/i2c/i2c_bus_esp_idf.h +11 -1
- esphome/components/i2s_audio/__init__.py +6 -5
- esphome/components/i2s_audio/i2s_audio.cpp +0 -2
- esphome/components/i2s_audio/media_player/i2s_audio_media_player.cpp +1 -4
- esphome/components/i2s_audio/microphone/__init__.py +4 -6
- esphome/components/i2s_audio/microphone/i2s_audio_microphone.cpp +46 -19
- esphome/components/i2s_audio/microphone/i2s_audio_microphone.h +4 -3
- esphome/components/i2s_audio/speaker/i2s_audio_speaker.cpp +273 -269
- esphome/components/i2s_audio/speaker/i2s_audio_speaker.h +19 -34
- esphome/components/ili9xxx/display.py +4 -3
- esphome/components/ili9xxx/ili9xxx_display.cpp +0 -2
- esphome/components/image/__init__.py +123 -92
- esphome/components/improv_serial/__init__.py +7 -8
- esphome/components/ina219/ina219.cpp +0 -1
- esphome/components/ina226/ina226.cpp +0 -2
- esphome/components/ina260/ina260.cpp +0 -2
- esphome/components/ina2xx_base/__init__.py +2 -5
- esphome/components/ina2xx_base/ina2xx_base.cpp +0 -2
- esphome/components/ina3221/ina3221.cpp +0 -1
- esphome/components/internal_temperature/internal_temperature.cpp +0 -2
- esphome/components/interval/interval.h +5 -9
- esphome/components/json/__init__.py +1 -1
- esphome/components/kmeteriso/kmeteriso.cpp +0 -2
- esphome/components/lc709203f/lc709203f.cpp +0 -2
- esphome/components/lcd_gpio/display.py +1 -3
- esphome/components/lcd_gpio/gpio_lcd_display.cpp +0 -1
- esphome/components/lcd_pcf8574/pcf8574_display.cpp +0 -1
- esphome/components/ld2410/__init__.py +4 -6
- esphome/components/ld2410/binary_sensor.py +4 -0
- esphome/components/ld2410/ld2410.cpp +56 -100
- esphome/components/ld2410/ld2410.h +17 -15
- esphome/components/ld2410/sensor.py +24 -10
- esphome/components/ld2412/__init__.py +46 -0
- esphome/components/ld2412/binary_sensor.py +70 -0
- esphome/components/ld2412/button/__init__.py +74 -0
- esphome/components/ld2412/button/factory_reset_button.cpp +9 -0
- esphome/components/ld2412/button/factory_reset_button.h +18 -0
- esphome/components/ld2412/button/query_button.cpp +9 -0
- esphome/components/ld2412/button/query_button.h +18 -0
- esphome/components/ld2412/button/restart_button.cpp +9 -0
- esphome/components/ld2412/button/restart_button.h +18 -0
- esphome/components/ld2412/button/start_dynamic_background_correction_button.cpp +11 -0
- esphome/components/ld2412/button/start_dynamic_background_correction_button.h +18 -0
- esphome/components/ld2412/ld2412.cpp +861 -0
- esphome/components/ld2412/ld2412.h +141 -0
- esphome/components/ld2412/number/__init__.py +126 -0
- esphome/components/ld2412/number/gate_threshold_number.cpp +14 -0
- esphome/components/ld2412/number/gate_threshold_number.h +19 -0
- esphome/components/ld2412/number/light_threshold_number.cpp +12 -0
- esphome/components/ld2412/number/light_threshold_number.h +18 -0
- esphome/components/ld2412/number/max_distance_timeout_number.cpp +12 -0
- esphome/components/ld2412/number/max_distance_timeout_number.h +18 -0
- esphome/components/ld2412/select/__init__.py +82 -0
- esphome/components/ld2412/select/baud_rate_select.cpp +12 -0
- esphome/components/ld2412/select/baud_rate_select.h +18 -0
- esphome/components/ld2412/select/distance_resolution_select.cpp +12 -0
- esphome/components/ld2412/select/distance_resolution_select.h +18 -0
- esphome/components/ld2412/select/light_out_control_select.cpp +12 -0
- esphome/components/ld2412/select/light_out_control_select.h +18 -0
- esphome/components/ld2412/sensor.py +124 -0
- esphome/components/ld2412/switch/__init__.py +45 -0
- esphome/components/ld2412/switch/bluetooth_switch.cpp +12 -0
- esphome/components/ld2412/switch/bluetooth_switch.h +18 -0
- esphome/components/ld2412/switch/engineering_mode_switch.cpp +12 -0
- esphome/components/ld2412/switch/engineering_mode_switch.h +18 -0
- esphome/components/ld2412/text_sensor.py +34 -0
- esphome/components/ld2420/ld2420.cpp +0 -1
- esphome/components/ld2450/__init__.py +3 -4
- esphome/components/ld2450/binary_sensor.py +3 -0
- esphome/components/ld2450/ld2450.cpp +77 -165
- esphome/components/ld2450/ld2450.h +26 -54
- esphome/components/ld2450/sensor.py +120 -6
- esphome/components/ld2450/text_sensor.py +5 -4
- esphome/components/ld24xx/__init__.py +1 -0
- esphome/components/ld24xx/ld24xx.h +65 -0
- esphome/components/ledc/ledc_output.cpp +0 -1
- esphome/components/libretiny/__init__.py +2 -0
- esphome/components/light/__init__.py +0 -1
- esphome/components/light/effects.py +70 -45
- esphome/components/light/light_call.cpp +101 -66
- esphome/components/light/light_color_values.h +16 -11
- esphome/components/light/light_json_schema.cpp +46 -44
- esphome/components/light/light_state.cpp +8 -11
- esphome/components/light/light_traits.h +17 -0
- esphome/components/lightwaverf/lightwaverf.cpp +0 -2
- esphome/components/lilygo_t5_47/touchscreen/lilygo_t5_47_touchscreen.cpp +0 -1
- esphome/components/lock/__init__.py +0 -1
- esphome/components/logger/__init__.py +31 -9
- esphome/components/logger/logger.cpp +12 -7
- esphome/components/logger/logger.h +25 -14
- esphome/components/logger/logger_esp32.cpp +2 -7
- esphome/components/logger/logger_esp8266.cpp +2 -4
- esphome/components/logger/logger_host.cpp +2 -4
- esphome/components/logger/logger_libretiny.cpp +2 -4
- esphome/components/logger/logger_rp2040.cpp +2 -4
- esphome/components/logger/logger_zephyr.cpp +86 -0
- esphome/components/logger/select/logger_level_select.cpp +2 -4
- esphome/components/logger/select/logger_level_select.h +2 -4
- esphome/components/logger/task_log_buffer.cpp +2 -4
- esphome/components/logger/task_log_buffer.h +2 -4
- esphome/components/lps22/sensor.py +5 -5
- esphome/components/ltr390/ltr390.cpp +0 -2
- esphome/components/ltr501/ltr501.cpp +0 -1
- esphome/components/ltr_als_ps/ltr_als_ps.cpp +0 -1
- esphome/components/lvgl/__init__.py +14 -13
- esphome/components/lvgl/automation.py +2 -4
- esphome/components/lvgl/defines.py +0 -2
- esphome/components/lvgl/helpers.py +1 -1
- esphome/components/lvgl/lv_validation.py +7 -4
- esphome/components/lvgl/lvgl_esphome.cpp +2 -3
- esphome/components/lvgl/styles.py +2 -2
- esphome/components/lvgl/types.py +1 -1
- esphome/components/lvgl/widgets/__init__.py +2 -2
- esphome/components/lvgl/widgets/arc.py +14 -11
- esphome/components/lvgl/widgets/buttonmatrix.py +1 -1
- esphome/components/lvgl/widgets/qrcode.py +7 -7
- esphome/components/lvgl/widgets/spinner.py +6 -6
- esphome/components/lvgl/widgets/switch.py +2 -2
- esphome/components/lvgl/widgets/tabview.py +3 -3
- esphome/components/lvgl/widgets/tileview.py +15 -7
- esphome/components/m5stack_8angle/m5stack_8angle.cpp +0 -1
- esphome/components/matrix_keypad/__init__.py +4 -3
- esphome/components/max17043/max17043.cpp +0 -2
- esphome/components/max31855/max31855.cpp +1 -4
- esphome/components/max31856/max31856.cpp +0 -4
- esphome/components/max31865/max31865.cpp +0 -1
- esphome/components/max44009/max44009.cpp +0 -1
- esphome/components/max6675/max6675.cpp +1 -4
- esphome/components/max6956/max6956.cpp +0 -1
- esphome/components/max7219/max7219.cpp +0 -1
- esphome/components/max7219digit/display.py +1 -1
- esphome/components/max7219digit/max7219digit.cpp +0 -1
- esphome/components/max9611/max9611.cpp +0 -1
- esphome/components/mcp23008/__init__.py +1 -1
- esphome/components/mcp23008/mcp23008.cpp +0 -1
- esphome/components/mcp23016/mcp23016.cpp +0 -1
- esphome/components/mcp23017/__init__.py +1 -1
- esphome/components/mcp23017/mcp23017.cpp +0 -1
- esphome/components/mcp23s08/__init__.py +1 -1
- esphome/components/mcp23s08/mcp23s08.cpp +0 -1
- esphome/components/mcp23s17/__init__.py +1 -1
- esphome/components/mcp23s17/mcp23s17.cpp +0 -1
- esphome/components/mcp23x08_base/__init__.py +2 -0
- esphome/components/mcp23x08_base/mcp23x08_base.cpp +9 -7
- esphome/components/mcp23x08_base/mcp23x08_base.h +9 -4
- esphome/components/mcp23x17_base/__init__.py +2 -0
- esphome/components/mcp23x17_base/mcp23x17_base.cpp +20 -7
- esphome/components/mcp23x17_base/mcp23x17_base.h +9 -4
- esphome/components/mcp23xxx_base/__init__.py +11 -5
- esphome/components/mcp23xxx_base/mcp23xxx_base.cpp +15 -12
- esphome/components/mcp23xxx_base/mcp23xxx_base.h +8 -7
- esphome/components/mcp3008/mcp3008.cpp +1 -4
- esphome/components/mcp3204/mcp3204.cpp +1 -4
- esphome/components/mcp4461/mcp4461.cpp +0 -1
- esphome/components/mcp4725/mcp4725.cpp +0 -1
- esphome/components/mcp4728/mcp4728.cpp +0 -1
- esphome/components/mcp9600/mcp9600.cpp +0 -2
- esphome/components/mcp9808/mcp9808.cpp +0 -2
- esphome/components/mdns/__init__.py +3 -0
- esphome/components/mdns/mdns_component.cpp +2 -0
- esphome/components/mdns/mdns_component.h +4 -0
- esphome/components/media_player/__init__.py +40 -0
- esphome/components/media_player/automation.h +16 -0
- esphome/components/media_player/media_player.cpp +13 -0
- esphome/components/media_player/media_player.h +50 -3
- esphome/components/micro_wake_word/micro_wake_word.cpp +0 -3
- esphome/components/mics_4514/mics_4514.cpp +1 -6
- esphome/components/midea/ir_transmitter.h +4 -4
- esphome/components/mipi/__init__.py +416 -0
- esphome/components/mipi_dsi/__init__.py +5 -0
- esphome/components/mipi_dsi/display.py +233 -0
- esphome/components/mipi_dsi/mipi_dsi.cpp +379 -0
- esphome/components/mipi_dsi/mipi_dsi.h +123 -0
- esphome/components/mipi_dsi/models/__init__.py +0 -0
- esphome/components/mipi_dsi/models/guition.py +38 -0
- esphome/components/mipi_dsi/models/m5stack.py +57 -0
- esphome/components/mipi_dsi/models/waveshare.py +105 -0
- esphome/components/mipi_rgb/models/lilygo.py +0 -0
- esphome/components/mipi_spi/__init__.py +0 -9
- esphome/components/mipi_spi/display.py +220 -256
- esphome/components/mipi_spi/mipi_spi.cpp +1 -485
- esphome/components/mipi_spi/mipi_spi.h +556 -108
- esphome/components/mipi_spi/models/__init__.py +0 -65
- esphome/components/mipi_spi/models/adafruit.py +30 -0
- esphome/components/mipi_spi/models/amoled.py +41 -5
- esphome/components/mipi_spi/models/ili.py +5 -5
- esphome/components/mipi_spi/models/jc.py +1 -3
- esphome/components/mipi_spi/models/lilygo.py +1 -1
- esphome/components/mipi_spi/models/waveshare.py +16 -1
- esphome/components/mixer/speaker/__init__.py +4 -5
- esphome/components/mlx90393/sensor.py +7 -5
- esphome/components/mlx90393/sensor_mlx90393.cpp +0 -1
- esphome/components/mlx90614/mlx90614.cpp +0 -1
- esphome/components/mmc5603/mmc5603.cpp +0 -1
- esphome/components/mmc5983/mmc5983.cpp +0 -2
- esphome/components/mpl3115a2/mpl3115a2.cpp +0 -2
- esphome/components/mpr121/__init__.py +7 -6
- esphome/components/mpr121/mpr121.cpp +0 -1
- esphome/components/mpu6050/mpu6050.cpp +0 -1
- esphome/components/mpu6886/mpu6886.cpp +0 -1
- esphome/components/mqtt/__init__.py +1 -2
- esphome/components/mqtt/mqtt_button.cpp +1 -1
- esphome/components/mqtt/mqtt_client.cpp +0 -1
- esphome/components/mqtt/mqtt_component.cpp +8 -14
- esphome/components/mqtt/mqtt_component.h +0 -7
- esphome/components/mqtt/mqtt_sensor.cpp +0 -1
- esphome/components/mqtt/mqtt_sensor.h +0 -1
- esphome/components/mqtt/mqtt_text_sensor.cpp +0 -1
- esphome/components/mqtt/mqtt_text_sensor.h +0 -1
- esphome/components/ms5611/ms5611.cpp +0 -1
- esphome/components/ms8607/ms8607.cpp +0 -1
- esphome/components/msa3xx/msa3xx.cpp +0 -2
- esphome/components/my9231/my9231.cpp +0 -2
- esphome/components/nau7802/nau7802.cpp +0 -1
- esphome/components/neopixelbus/light.py +3 -0
- esphome/components/network/util.cpp +29 -0
- esphome/components/nextion/nextion.cpp +2 -2
- esphome/components/nfc/binary_sensor/{binary_sensor.cpp → nfc_binary_sensor.cpp} +1 -1
- esphome/components/npi19/npi19.cpp +0 -2
- esphome/components/nrf52/__init__.py +223 -0
- esphome/components/nrf52/boards.py +34 -0
- esphome/components/nrf52/const.py +18 -0
- esphome/components/nrf52/gpio.py +79 -0
- esphome/components/number/__init__.py +2 -1
- esphome/components/one_wire/__init__.py +1 -2
- esphome/components/one_wire/one_wire.cpp +0 -2
- esphome/components/one_wire/one_wire.h +0 -2
- esphome/components/opentherm/hub.cpp +0 -1
- esphome/components/opentherm/number/__init__.py +2 -2
- esphome/components/openthread/__init__.py +2 -3
- esphome/components/openthread/openthread.cpp +30 -13
- esphome/components/openthread/openthread.h +3 -0
- esphome/components/openthread/openthread_esp.cpp +3 -1
- esphome/components/opt3001/sensor.py +2 -6
- esphome/components/output/__init__.py +38 -0
- esphome/components/output/automation.h +24 -0
- esphome/components/output/switch/output_switch.cpp +0 -2
- esphome/components/packages/__init__.py +1 -2
- esphome/components/packet_transport/__init__.py +4 -3
- esphome/components/pca6416a/pca6416a.cpp +0 -1
- esphome/components/pca9554/pca9554.cpp +0 -1
- esphome/components/pca9685/pca9685_output.cpp +0 -2
- esphome/components/pcf85063/pcf85063.cpp +0 -1
- esphome/components/pcf8563/pcf8563.cpp +0 -1
- esphome/components/pcf8574/pcf8574.cpp +0 -1
- esphome/components/pi4ioe5v6408/pi4ioe5v6408.cpp +0 -1
- esphome/components/pipsolar/pipsolar.cpp +54 -42
- esphome/components/pipsolar/pipsolar.h +5 -4
- esphome/components/pipsolar/sensor/__init__.py +1 -1
- esphome/components/pm2005/pm2005.cpp +0 -1
- esphome/components/pmsa003i/pmsa003i.cpp +0 -2
- esphome/components/pmwcs3/sensor.py +1 -2
- esphome/components/pn532/pn532.cpp +0 -2
- esphome/components/pn532_spi/pn532_spi.cpp +0 -2
- esphome/components/power_supply/power_supply.cpp +7 -10
- esphome/components/power_supply/power_supply.h +1 -1
- esphome/components/psram/__init__.py +6 -1
- esphome/components/pulse_counter/pulse_counter_sensor.cpp +0 -1
- esphome/components/pulse_counter/sensor.py +9 -6
- esphome/components/pylontech/pylontech.cpp +0 -1
- esphome/components/qmc5883l/qmc5883l.cpp +0 -1
- esphome/components/qmp6988/qmp6988.cpp +0 -2
- esphome/components/qspi_dbi/display.py +2 -3
- esphome/components/qspi_dbi/qspi_dbi.cpp +0 -2
- esphome/components/qwiic_pir/binary_sensor.py +2 -3
- esphome/components/qwiic_pir/qwiic_pir.cpp +0 -2
- esphome/components/rc522/rc522.cpp +9 -31
- esphome/components/rc522_spi/rc522_spi.cpp +0 -1
- esphome/components/remote_base/__init__.py +5 -6
- esphome/components/remote_receiver/remote_receiver_esp32.cpp +0 -1
- esphome/components/remote_receiver/remote_receiver_esp8266.cpp +0 -1
- esphome/components/remote_receiver/remote_receiver_libretiny.cpp +0 -1
- esphome/components/remote_transmitter/__init__.py +26 -0
- esphome/components/remote_transmitter/automation.h +18 -0
- esphome/components/remote_transmitter/remote_transmitter.h +2 -1
- esphome/components/remote_transmitter/remote_transmitter_esp32.cpp +0 -1
- esphome/components/remote_transmitter/remote_transmitter_esp8266.cpp +2 -0
- esphome/components/remote_transmitter/remote_transmitter_libretiny.cpp +2 -0
- esphome/components/resampler/speaker/__init__.py +4 -5
- esphome/components/rf_bridge/__init__.py +4 -8
- esphome/components/rotary_encoder/rotary_encoder.cpp +0 -2
- esphome/components/rp2040/__init__.py +3 -1
- esphome/components/rp2040_pio_led_strip/led_strip.cpp +0 -2
- esphome/components/rp2040_pio_led_strip/light.py +1 -2
- esphome/components/rp2040_pwm/rp2040_pwm.cpp +1 -5
- esphome/components/rpi_dpi_rgb/display.py +13 -15
- esphome/components/rpi_dpi_rgb/rpi_dpi_rgb.cpp +0 -3
- esphome/components/runtime_stats/__init__.py +34 -0
- esphome/components/runtime_stats/runtime_stats.cpp +102 -0
- esphome/components/runtime_stats/runtime_stats.h +132 -0
- esphome/components/scd30/scd30.cpp +0 -2
- esphome/components/scd30/sensor.py +1 -2
- esphome/components/scd4x/scd4x.cpp +0 -1
- esphome/components/scd4x/sensor.py +1 -3
- esphome/components/sdl/display.py +3 -1
- esphome/components/sdl/sdl_esphome.cpp +0 -2
- esphome/components/sdp3x/sdp3x.cpp +0 -2
- esphome/components/seeed_mr24hpc1/seeed_mr24hpc1.cpp +0 -2
- esphome/components/seeed_mr60fda2/seeed_mr60fda2.cpp +0 -3
- esphome/components/select/__init__.py +2 -3
- esphome/components/select/select_traits.cpp +1 -1
- esphome/components/select/select_traits.h +1 -1
- esphome/components/sen0321/sen0321.cpp +0 -1
- esphome/components/sen5x/sen5x.cpp +0 -2
- esphome/components/senseair/senseair.cpp +7 -3
- esphome/components/senseair/senseair.h +11 -0
- esphome/components/sensor/__init__.py +36 -4
- esphome/components/sensor/filter.cpp +49 -10
- esphome/components/sensor/filter.h +22 -7
- esphome/components/sensor/sensor.cpp +0 -1
- esphome/components/sensor/sensor.h +0 -9
- esphome/components/sfa30/sfa30.cpp +0 -4
- esphome/components/sgp30/sgp30.cpp +0 -2
- esphome/components/sgp4x/sensor.py +1 -1
- esphome/components/sgp4x/sgp4x.cpp +0 -2
- esphome/components/shelly_dimmer/shelly_dimmer.cpp +0 -2
- esphome/components/sht3xd/sht3xd.cpp +0 -2
- esphome/components/sht4x/sht4x.cpp +0 -2
- esphome/components/shtcx/shtcx.cpp +0 -1
- esphome/components/sim800l/__init__.py +2 -4
- esphome/components/sm16716/sm16716.cpp +0 -1
- esphome/components/sm2135/sm2135.cpp +0 -1
- esphome/components/sm2235/sm2235.cpp +0 -1
- esphome/components/sm2335/sm2335.cpp +0 -1
- esphome/components/sn74hc165/sn74hc165.cpp +0 -1
- esphome/components/sn74hc595/sn74hc595.cpp +0 -1
- esphome/components/sntp/sntp_component.cpp +0 -1
- esphome/components/sound_level/sensor.py +1 -1
- esphome/components/speaker/media_player/__init__.py +21 -33
- esphome/components/speaker/media_player/audio_pipeline.cpp +4 -7
- esphome/components/spi/__init__.py +29 -13
- esphome/components/spi/spi.cpp +0 -2
- esphome/components/spi_device/spi_device.cpp +1 -4
- esphome/components/sprinkler/__init__.py +4 -4
- esphome/components/sps30/sps30.cpp +0 -1
- esphome/components/ssd1306_base/__init__.py +11 -11
- esphome/components/ssd1306_base/ssd1306_base.cpp +1 -1
- esphome/components/ssd1306_i2c/ssd1306_i2c.cpp +0 -1
- esphome/components/ssd1306_spi/ssd1306_spi.cpp +0 -1
- esphome/components/ssd1322_spi/ssd1322_spi.cpp +0 -1
- esphome/components/ssd1325_spi/ssd1325_spi.cpp +0 -1
- esphome/components/ssd1327_i2c/ssd1327_i2c.cpp +0 -1
- esphome/components/ssd1327_spi/ssd1327_spi.cpp +0 -1
- esphome/components/ssd1331_spi/ssd1331_spi.cpp +0 -1
- esphome/components/ssd1351_spi/ssd1351_spi.cpp +0 -1
- esphome/components/st7567_i2c/st7567_i2c.cpp +0 -1
- esphome/components/st7567_spi/st7567_spi.cpp +0 -1
- esphome/components/st7701s/display.py +10 -14
- esphome/components/st7701s/st7701s.cpp +0 -3
- esphome/components/st7735/st7735.cpp +0 -1
- esphome/components/st7789v/st7789v.cpp +0 -1
- esphome/components/st7920/st7920.cpp +0 -1
- esphome/components/status_led/light/status_led_light.cpp +0 -2
- esphome/components/status_led/status_led.cpp +0 -1
- esphome/components/stepper/__init__.py +2 -4
- esphome/components/sts3x/sts3x.cpp +0 -1
- esphome/components/substitutions/__init__.py +10 -16
- esphome/components/substitutions/jinja.py +24 -1
- esphome/components/sun/__init__.py +2 -3
- esphome/components/switch/__init__.py +31 -1
- esphome/components/switch/automation.h +24 -0
- esphome/components/switch/switch.cpp +8 -0
- esphome/components/switch/switch.h +8 -0
- esphome/components/sx126x/sx126x.cpp +0 -2
- esphome/components/sx127x/sx127x.cpp +0 -2
- esphome/components/sx1509/__init__.py +7 -5
- esphome/components/sx1509/output/sx1509_float_output.cpp +1 -1
- esphome/components/sx1509/sx1509.cpp +0 -2
- esphome/components/syslog/esphome_syslog.cpp +1 -1
- esphome/components/tc74/tc74.cpp +0 -1
- esphome/components/tca9548a/tca9548a.cpp +0 -1
- esphome/components/tca9555/tca9555.cpp +0 -1
- esphome/components/tcs34725/tcs34725.cpp +0 -1
- esphome/components/tee501/tee501.cpp +0 -1
- esphome/components/tem3200/tem3200.cpp +0 -2
- esphome/components/template/alarm_control_panel/template_alarm_control_panel.cpp +0 -1
- esphome/components/template/cover/template_cover.cpp +0 -1
- esphome/components/template/select/template_select.cpp +0 -1
- esphome/components/template/text/template_text.cpp +0 -2
- esphome/components/template/valve/template_valve.cpp +0 -1
- esphome/components/text/__init__.py +0 -1
- esphome/components/text/text_traits.h +2 -0
- esphome/components/text_sensor/__init__.py +2 -1
- esphome/components/text_sensor/text_sensor.cpp +0 -2
- esphome/components/text_sensor/text_sensor.h +0 -8
- esphome/components/thermostat/climate.py +4 -4
- esphome/components/time/__init__.py +7 -4
- esphome/components/time/real_time_clock.cpp +16 -3
- esphome/components/tlc59208f/tlc59208f_output.cpp +0 -2
- esphome/components/tlc5947/tlc5947.cpp +0 -2
- esphome/components/tlc5971/tlc5971.cpp +0 -2
- esphome/components/tm1621/tm1621.cpp +0 -2
- esphome/components/tm1637/tm1637.cpp +0 -2
- esphome/components/tm1638/tm1638.cpp +0 -2
- esphome/components/tm1651/__init__.py +45 -48
- esphome/components/tm1651/tm1651.cpp +213 -47
- esphome/components/tm1651/tm1651.h +37 -32
- esphome/components/tmp117/tmp117.cpp +0 -2
- esphome/components/tsl2561/tsl2561.cpp +0 -1
- esphome/components/tsl2591/tsl2591.cpp +0 -1
- esphome/components/tt21100/touchscreen/tt21100.cpp +0 -2
- esphome/components/ttp229_bsf/ttp229_bsf.cpp +0 -1
- esphome/components/ttp229_lsf/ttp229_lsf.cpp +0 -1
- esphome/components/tuya/climate/__init__.py +9 -10
- esphome/components/tuya/number/__init__.py +8 -6
- esphome/components/tx20/tx20.cpp +0 -1
- esphome/components/uart/uart_component_esp32_arduino.cpp +0 -1
- esphome/components/uart/uart_component_esp8266.cpp +0 -1
- esphome/components/uart/uart_component_esp_idf.cpp +0 -2
- esphome/components/uart/uart_component_libretiny.cpp +0 -2
- esphome/components/uart/uart_component_rp2040.cpp +0 -2
- esphome/components/udp/__init__.py +1 -1
- esphome/components/ufire_ec/sensor.py +1 -2
- esphome/components/ufire_ec/ufire_ec.cpp +0 -2
- esphome/components/ufire_ise/sensor.py +1 -2
- esphome/components/ufire_ise/ufire_ise.cpp +0 -2
- esphome/components/ultrasonic/ultrasonic_sensor.cpp +0 -1
- esphome/components/update/__init__.py +0 -1
- esphome/components/uptime/sensor/uptime_seconds_sensor.cpp +0 -1
- esphome/components/uptime/sensor/uptime_seconds_sensor.h +0 -2
- esphome/components/usb_host/usb_host_client.cpp +0 -1
- esphome/components/usb_host/usb_host_component.cpp +0 -1
- esphome/components/valve/__init__.py +0 -1
- esphome/components/veml3235/veml3235.cpp +0 -3
- esphome/components/veml7700/veml7700.cpp +0 -2
- esphome/components/version/version_text_sensor.cpp +0 -1
- esphome/components/version/version_text_sensor.h +0 -1
- esphome/components/vl53l0x/vl53l0x_sensor.cpp +0 -4
- esphome/components/voice_assistant/voice_assistant.cpp +9 -8
- esphome/components/web_server/__init__.py +13 -0
- esphome/components/web_server/web_server.cpp +188 -353
- esphome/components/web_server/web_server.h +61 -1
- esphome/components/web_server_base/__init__.py +1 -1
- esphome/components/web_server_base/web_server_base.cpp +2 -0
- esphome/components/web_server_base/web_server_base.h +6 -0
- esphome/components/web_server_idf/web_server_idf.cpp +10 -8
- esphome/components/web_server_idf/web_server_idf.h +2 -0
- esphome/components/weikai_i2c/weikai_i2c.cpp +1 -2
- esphome/components/weikai_spi/weikai_spi.cpp +1 -1
- esphome/components/wifi/__init__.py +17 -43
- esphome/components/wifi/wifi_component.cpp +100 -36
- esphome/components/wifi/wifi_component.h +5 -1
- esphome/components/wifi/wifi_component_esp32_arduino.cpp +30 -0
- esphome/components/wifi/wifi_component_esp_idf.cpp +30 -0
- esphome/components/wifi_info/wifi_info_text_sensor.h +0 -6
- esphome/components/wifi_signal/wifi_signal_sensor.h +0 -1
- esphome/components/wireguard/wireguard.cpp +0 -2
- esphome/components/x9c/x9c.cpp +0 -2
- esphome/components/xgzp68xx/xgzp68xx.cpp +0 -1
- esphome/components/xl9535/xl9535.cpp +0 -2
- esphome/components/zephyr/__init__.py +252 -0
- esphome/components/zephyr/const.py +16 -0
- esphome/components/zephyr/core.cpp +90 -0
- esphome/components/zephyr/gpio.cpp +120 -0
- esphome/components/zephyr/gpio.h +38 -0
- esphome/components/zephyr/pre_build.py.script +4 -0
- esphome/components/zephyr/preferences.cpp +156 -0
- esphome/components/zephyr/preferences.h +13 -0
- esphome/config.py +38 -16
- esphome/config_helpers.py +1 -2
- esphome/config_validation.py +12 -16
- esphome/const.py +26 -1
- esphome/core/__init__.py +92 -51
- esphome/core/application.cpp +75 -21
- esphome/core/application.h +106 -171
- esphome/core/color.h +10 -0
- esphome/core/component.cpp +41 -25
- esphome/core/component.h +9 -6
- esphome/core/component_iterator.cpp +61 -261
- esphome/core/component_iterator.h +15 -0
- esphome/core/config.py +26 -11
- esphome/core/defines.h +40 -2
- esphome/core/entity_base.h +18 -0
- esphome/core/entity_helpers.py +45 -10
- esphome/core/helpers.cpp +8 -15
- esphome/core/helpers.h +60 -6
- esphome/core/lock_free_queue.h +1 -1
- esphome/core/scheduler.cpp +311 -77
- esphome/core/scheduler.h +141 -28
- esphome/cpp_generator.py +2 -6
- esphome/cpp_helpers.py +1 -1
- esphome/dashboard/dashboard.py +2 -3
- esphome/dashboard/dns.py +2 -8
- esphome/dashboard/web_server.py +34 -19
- esphome/espota2.py +1 -4
- esphome/git.py +3 -1
- esphome/helpers.py +23 -4
- esphome/log.py +3 -1
- esphome/mqtt.py +3 -5
- esphome/platformio_api.py +7 -4
- esphome/types.py +12 -0
- esphome/util.py +20 -8
- esphome/voluptuous_schema.py +4 -3
- esphome/vscode.py +1 -2
- esphome/wizard.py +1 -4
- esphome/writer.py +16 -108
- esphome/yaml_util.py +7 -5
- {esphome-2025.7.4.dist-info → esphome-2025.8.0.dist-info}/METADATA +13 -14
- {esphome-2025.7.4.dist-info → esphome-2025.8.0.dist-info}/RECORD +757 -677
- esphome/components/mipi_spi/models/commands.py +0 -82
- /esphome/components/nfc/binary_sensor/{binary_sensor.h → nfc_binary_sensor.h} +0 -0
- {esphome-2025.7.4.dist-info → esphome-2025.8.0.dist-info}/WHEEL +0 -0
- {esphome-2025.7.4.dist-info → esphome-2025.8.0.dist-info}/entry_points.txt +0 -0
- {esphome-2025.7.4.dist-info → esphome-2025.8.0.dist-info}/licenses/LICENSE +0 -0
- {esphome-2025.7.4.dist-info → esphome-2025.8.0.dist-info}/top_level.txt +0 -0
|
@@ -3,488 +3,495 @@
|
|
|
3
3
|
#include "api_pb2.h"
|
|
4
4
|
#include "esphome/core/log.h"
|
|
5
5
|
#include "esphome/core/helpers.h"
|
|
6
|
+
#include <cstring>
|
|
6
7
|
|
|
7
|
-
namespace esphome {
|
|
8
|
-
namespace api {
|
|
8
|
+
namespace esphome::api {
|
|
9
9
|
|
|
10
10
|
bool HelloRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
|
11
11
|
switch (field_id) {
|
|
12
|
-
case 2:
|
|
12
|
+
case 2:
|
|
13
13
|
this->api_version_major = value.as_uint32();
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
case 3: {
|
|
14
|
+
break;
|
|
15
|
+
case 3:
|
|
17
16
|
this->api_version_minor = value.as_uint32();
|
|
18
|
-
|
|
19
|
-
}
|
|
17
|
+
break;
|
|
20
18
|
default:
|
|
21
19
|
return false;
|
|
22
20
|
}
|
|
21
|
+
return true;
|
|
23
22
|
}
|
|
24
23
|
bool HelloRequest::decode_length(uint32_t field_id, ProtoLengthDelimited value) {
|
|
25
24
|
switch (field_id) {
|
|
26
|
-
case 1:
|
|
25
|
+
case 1:
|
|
27
26
|
this->client_info = value.as_string();
|
|
28
|
-
|
|
29
|
-
}
|
|
27
|
+
break;
|
|
30
28
|
default:
|
|
31
29
|
return false;
|
|
32
30
|
}
|
|
31
|
+
return true;
|
|
33
32
|
}
|
|
34
33
|
void HelloResponse::encode(ProtoWriteBuffer buffer) const {
|
|
35
34
|
buffer.encode_uint32(1, this->api_version_major);
|
|
36
35
|
buffer.encode_uint32(2, this->api_version_minor);
|
|
37
|
-
buffer.encode_string(3, this->
|
|
38
|
-
buffer.encode_string(4, this->
|
|
36
|
+
buffer.encode_string(3, this->server_info_ref_);
|
|
37
|
+
buffer.encode_string(4, this->name_ref_);
|
|
39
38
|
}
|
|
40
|
-
void HelloResponse::calculate_size(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
39
|
+
void HelloResponse::calculate_size(ProtoSize &size) const {
|
|
40
|
+
size.add_uint32(1, this->api_version_major);
|
|
41
|
+
size.add_uint32(1, this->api_version_minor);
|
|
42
|
+
size.add_length(1, this->server_info_ref_.size());
|
|
43
|
+
size.add_length(1, this->name_ref_.size());
|
|
45
44
|
}
|
|
46
45
|
bool ConnectRequest::decode_length(uint32_t field_id, ProtoLengthDelimited value) {
|
|
47
46
|
switch (field_id) {
|
|
48
|
-
case 1:
|
|
47
|
+
case 1:
|
|
49
48
|
this->password = value.as_string();
|
|
50
|
-
|
|
51
|
-
}
|
|
49
|
+
break;
|
|
52
50
|
default:
|
|
53
51
|
return false;
|
|
54
52
|
}
|
|
53
|
+
return true;
|
|
55
54
|
}
|
|
56
55
|
void ConnectResponse::encode(ProtoWriteBuffer buffer) const { buffer.encode_bool(1, this->invalid_password); }
|
|
57
|
-
void ConnectResponse::calculate_size(
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
bool AreaInfo::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
|
61
|
-
switch (field_id) {
|
|
62
|
-
case 1: {
|
|
63
|
-
this->area_id = value.as_uint32();
|
|
64
|
-
return true;
|
|
65
|
-
}
|
|
66
|
-
default:
|
|
67
|
-
return false;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
bool AreaInfo::decode_length(uint32_t field_id, ProtoLengthDelimited value) {
|
|
71
|
-
switch (field_id) {
|
|
72
|
-
case 2: {
|
|
73
|
-
this->name = value.as_string();
|
|
74
|
-
return true;
|
|
75
|
-
}
|
|
76
|
-
default:
|
|
77
|
-
return false;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
56
|
+
void ConnectResponse::calculate_size(ProtoSize &size) const { size.add_bool(1, this->invalid_password); }
|
|
57
|
+
#ifdef USE_AREAS
|
|
80
58
|
void AreaInfo::encode(ProtoWriteBuffer buffer) const {
|
|
81
59
|
buffer.encode_uint32(1, this->area_id);
|
|
82
|
-
buffer.encode_string(2, this->
|
|
60
|
+
buffer.encode_string(2, this->name_ref_);
|
|
83
61
|
}
|
|
84
|
-
void AreaInfo::calculate_size(
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
bool DeviceInfo::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
|
89
|
-
switch (field_id) {
|
|
90
|
-
case 1: {
|
|
91
|
-
this->device_id = value.as_uint32();
|
|
92
|
-
return true;
|
|
93
|
-
}
|
|
94
|
-
case 3: {
|
|
95
|
-
this->area_id = value.as_uint32();
|
|
96
|
-
return true;
|
|
97
|
-
}
|
|
98
|
-
default:
|
|
99
|
-
return false;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
bool DeviceInfo::decode_length(uint32_t field_id, ProtoLengthDelimited value) {
|
|
103
|
-
switch (field_id) {
|
|
104
|
-
case 2: {
|
|
105
|
-
this->name = value.as_string();
|
|
106
|
-
return true;
|
|
107
|
-
}
|
|
108
|
-
default:
|
|
109
|
-
return false;
|
|
110
|
-
}
|
|
62
|
+
void AreaInfo::calculate_size(ProtoSize &size) const {
|
|
63
|
+
size.add_uint32(1, this->area_id);
|
|
64
|
+
size.add_length(1, this->name_ref_.size());
|
|
111
65
|
}
|
|
66
|
+
#endif
|
|
67
|
+
#ifdef USE_DEVICES
|
|
112
68
|
void DeviceInfo::encode(ProtoWriteBuffer buffer) const {
|
|
113
69
|
buffer.encode_uint32(1, this->device_id);
|
|
114
|
-
buffer.encode_string(2, this->
|
|
70
|
+
buffer.encode_string(2, this->name_ref_);
|
|
115
71
|
buffer.encode_uint32(3, this->area_id);
|
|
116
72
|
}
|
|
117
|
-
void DeviceInfo::calculate_size(
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
73
|
+
void DeviceInfo::calculate_size(ProtoSize &size) const {
|
|
74
|
+
size.add_uint32(1, this->device_id);
|
|
75
|
+
size.add_length(1, this->name_ref_.size());
|
|
76
|
+
size.add_uint32(1, this->area_id);
|
|
121
77
|
}
|
|
78
|
+
#endif
|
|
122
79
|
void DeviceInfoResponse::encode(ProtoWriteBuffer buffer) const {
|
|
80
|
+
#ifdef USE_API_PASSWORD
|
|
123
81
|
buffer.encode_bool(1, this->uses_password);
|
|
124
|
-
|
|
125
|
-
buffer.encode_string(
|
|
126
|
-
buffer.encode_string(
|
|
127
|
-
buffer.encode_string(
|
|
128
|
-
buffer.encode_string(
|
|
82
|
+
#endif
|
|
83
|
+
buffer.encode_string(2, this->name_ref_);
|
|
84
|
+
buffer.encode_string(3, this->mac_address_ref_);
|
|
85
|
+
buffer.encode_string(4, this->esphome_version_ref_);
|
|
86
|
+
buffer.encode_string(5, this->compilation_time_ref_);
|
|
87
|
+
buffer.encode_string(6, this->model_ref_);
|
|
88
|
+
#ifdef USE_DEEP_SLEEP
|
|
129
89
|
buffer.encode_bool(7, this->has_deep_sleep);
|
|
130
|
-
|
|
131
|
-
|
|
90
|
+
#endif
|
|
91
|
+
#ifdef ESPHOME_PROJECT_NAME
|
|
92
|
+
buffer.encode_string(8, this->project_name_ref_);
|
|
93
|
+
#endif
|
|
94
|
+
#ifdef ESPHOME_PROJECT_NAME
|
|
95
|
+
buffer.encode_string(9, this->project_version_ref_);
|
|
96
|
+
#endif
|
|
97
|
+
#ifdef USE_WEBSERVER
|
|
132
98
|
buffer.encode_uint32(10, this->webserver_port);
|
|
133
|
-
|
|
99
|
+
#endif
|
|
100
|
+
#ifdef USE_BLUETOOTH_PROXY
|
|
134
101
|
buffer.encode_uint32(15, this->bluetooth_proxy_feature_flags);
|
|
135
|
-
|
|
136
|
-
buffer.encode_string(
|
|
137
|
-
buffer.
|
|
102
|
+
#endif
|
|
103
|
+
buffer.encode_string(12, this->manufacturer_ref_);
|
|
104
|
+
buffer.encode_string(13, this->friendly_name_ref_);
|
|
105
|
+
#ifdef USE_VOICE_ASSISTANT
|
|
138
106
|
buffer.encode_uint32(17, this->voice_assistant_feature_flags);
|
|
139
|
-
|
|
140
|
-
|
|
107
|
+
#endif
|
|
108
|
+
#ifdef USE_AREAS
|
|
109
|
+
buffer.encode_string(16, this->suggested_area_ref_);
|
|
110
|
+
#endif
|
|
111
|
+
#ifdef USE_BLUETOOTH_PROXY
|
|
112
|
+
buffer.encode_string(18, this->bluetooth_mac_address_ref_);
|
|
113
|
+
#endif
|
|
114
|
+
#ifdef USE_API_NOISE
|
|
141
115
|
buffer.encode_bool(19, this->api_encryption_supported);
|
|
142
|
-
|
|
116
|
+
#endif
|
|
117
|
+
#ifdef USE_DEVICES
|
|
118
|
+
for (const auto &it : this->devices) {
|
|
143
119
|
buffer.encode_message(20, it, true);
|
|
144
120
|
}
|
|
145
|
-
|
|
121
|
+
#endif
|
|
122
|
+
#ifdef USE_AREAS
|
|
123
|
+
for (const auto &it : this->areas) {
|
|
146
124
|
buffer.encode_message(21, it, true);
|
|
147
125
|
}
|
|
126
|
+
#endif
|
|
127
|
+
#ifdef USE_AREAS
|
|
148
128
|
buffer.encode_message(22, this->area);
|
|
129
|
+
#endif
|
|
149
130
|
}
|
|
150
|
-
void DeviceInfoResponse::calculate_size(
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
131
|
+
void DeviceInfoResponse::calculate_size(ProtoSize &size) const {
|
|
132
|
+
#ifdef USE_API_PASSWORD
|
|
133
|
+
size.add_bool(1, this->uses_password);
|
|
134
|
+
#endif
|
|
135
|
+
size.add_length(1, this->name_ref_.size());
|
|
136
|
+
size.add_length(1, this->mac_address_ref_.size());
|
|
137
|
+
size.add_length(1, this->esphome_version_ref_.size());
|
|
138
|
+
size.add_length(1, this->compilation_time_ref_.size());
|
|
139
|
+
size.add_length(1, this->model_ref_.size());
|
|
140
|
+
#ifdef USE_DEEP_SLEEP
|
|
141
|
+
size.add_bool(1, this->has_deep_sleep);
|
|
142
|
+
#endif
|
|
143
|
+
#ifdef ESPHOME_PROJECT_NAME
|
|
144
|
+
size.add_length(1, this->project_name_ref_.size());
|
|
145
|
+
#endif
|
|
146
|
+
#ifdef ESPHOME_PROJECT_NAME
|
|
147
|
+
size.add_length(1, this->project_version_ref_.size());
|
|
148
|
+
#endif
|
|
149
|
+
#ifdef USE_WEBSERVER
|
|
150
|
+
size.add_uint32(1, this->webserver_port);
|
|
151
|
+
#endif
|
|
152
|
+
#ifdef USE_BLUETOOTH_PROXY
|
|
153
|
+
size.add_uint32(1, this->bluetooth_proxy_feature_flags);
|
|
154
|
+
#endif
|
|
155
|
+
size.add_length(1, this->manufacturer_ref_.size());
|
|
156
|
+
size.add_length(1, this->friendly_name_ref_.size());
|
|
157
|
+
#ifdef USE_VOICE_ASSISTANT
|
|
158
|
+
size.add_uint32(2, this->voice_assistant_feature_flags);
|
|
159
|
+
#endif
|
|
160
|
+
#ifdef USE_AREAS
|
|
161
|
+
size.add_length(2, this->suggested_area_ref_.size());
|
|
162
|
+
#endif
|
|
163
|
+
#ifdef USE_BLUETOOTH_PROXY
|
|
164
|
+
size.add_length(2, this->bluetooth_mac_address_ref_.size());
|
|
165
|
+
#endif
|
|
166
|
+
#ifdef USE_API_NOISE
|
|
167
|
+
size.add_bool(2, this->api_encryption_supported);
|
|
168
|
+
#endif
|
|
169
|
+
#ifdef USE_DEVICES
|
|
170
|
+
for (const auto &it : this->devices) {
|
|
171
|
+
size.add_message_object_force(2, it);
|
|
172
|
+
}
|
|
173
|
+
#endif
|
|
174
|
+
#ifdef USE_AREAS
|
|
175
|
+
for (const auto &it : this->areas) {
|
|
176
|
+
size.add_message_object_force(2, it);
|
|
177
|
+
}
|
|
178
|
+
#endif
|
|
179
|
+
#ifdef USE_AREAS
|
|
180
|
+
size.add_message_object(2, this->area);
|
|
181
|
+
#endif
|
|
173
182
|
}
|
|
174
183
|
#ifdef USE_BINARY_SENSOR
|
|
175
184
|
void ListEntitiesBinarySensorResponse::encode(ProtoWriteBuffer buffer) const {
|
|
176
|
-
buffer.encode_string(1, this->
|
|
185
|
+
buffer.encode_string(1, this->object_id_ref_);
|
|
177
186
|
buffer.encode_fixed32(2, this->key);
|
|
178
|
-
buffer.encode_string(3, this->
|
|
179
|
-
buffer.encode_string(
|
|
180
|
-
buffer.encode_string(5, this->device_class);
|
|
187
|
+
buffer.encode_string(3, this->name_ref_);
|
|
188
|
+
buffer.encode_string(5, this->device_class_ref_);
|
|
181
189
|
buffer.encode_bool(6, this->is_status_binary_sensor);
|
|
182
190
|
buffer.encode_bool(7, this->disabled_by_default);
|
|
183
|
-
|
|
191
|
+
#ifdef USE_ENTITY_ICON
|
|
192
|
+
buffer.encode_string(8, this->icon_ref_);
|
|
193
|
+
#endif
|
|
184
194
|
buffer.encode_uint32(9, static_cast<uint32_t>(this->entity_category));
|
|
195
|
+
#ifdef USE_DEVICES
|
|
185
196
|
buffer.encode_uint32(10, this->device_id);
|
|
197
|
+
#endif
|
|
186
198
|
}
|
|
187
|
-
void ListEntitiesBinarySensorResponse::calculate_size(
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
199
|
+
void ListEntitiesBinarySensorResponse::calculate_size(ProtoSize &size) const {
|
|
200
|
+
size.add_length(1, this->object_id_ref_.size());
|
|
201
|
+
size.add_fixed32(1, this->key);
|
|
202
|
+
size.add_length(1, this->name_ref_.size());
|
|
203
|
+
size.add_length(1, this->device_class_ref_.size());
|
|
204
|
+
size.add_bool(1, this->is_status_binary_sensor);
|
|
205
|
+
size.add_bool(1, this->disabled_by_default);
|
|
206
|
+
#ifdef USE_ENTITY_ICON
|
|
207
|
+
size.add_length(1, this->icon_ref_.size());
|
|
208
|
+
#endif
|
|
209
|
+
size.add_uint32(1, static_cast<uint32_t>(this->entity_category));
|
|
210
|
+
#ifdef USE_DEVICES
|
|
211
|
+
size.add_uint32(1, this->device_id);
|
|
212
|
+
#endif
|
|
198
213
|
}
|
|
199
214
|
void BinarySensorStateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
200
215
|
buffer.encode_fixed32(1, this->key);
|
|
201
216
|
buffer.encode_bool(2, this->state);
|
|
202
217
|
buffer.encode_bool(3, this->missing_state);
|
|
218
|
+
#ifdef USE_DEVICES
|
|
203
219
|
buffer.encode_uint32(4, this->device_id);
|
|
220
|
+
#endif
|
|
204
221
|
}
|
|
205
|
-
void BinarySensorStateResponse::calculate_size(
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
222
|
+
void BinarySensorStateResponse::calculate_size(ProtoSize &size) const {
|
|
223
|
+
size.add_fixed32(1, this->key);
|
|
224
|
+
size.add_bool(1, this->state);
|
|
225
|
+
size.add_bool(1, this->missing_state);
|
|
226
|
+
#ifdef USE_DEVICES
|
|
227
|
+
size.add_uint32(1, this->device_id);
|
|
228
|
+
#endif
|
|
210
229
|
}
|
|
211
230
|
#endif
|
|
212
231
|
#ifdef USE_COVER
|
|
213
232
|
void ListEntitiesCoverResponse::encode(ProtoWriteBuffer buffer) const {
|
|
214
|
-
buffer.encode_string(1, this->
|
|
233
|
+
buffer.encode_string(1, this->object_id_ref_);
|
|
215
234
|
buffer.encode_fixed32(2, this->key);
|
|
216
|
-
buffer.encode_string(3, this->
|
|
217
|
-
buffer.encode_string(4, this->unique_id);
|
|
235
|
+
buffer.encode_string(3, this->name_ref_);
|
|
218
236
|
buffer.encode_bool(5, this->assumed_state);
|
|
219
237
|
buffer.encode_bool(6, this->supports_position);
|
|
220
238
|
buffer.encode_bool(7, this->supports_tilt);
|
|
221
|
-
buffer.encode_string(8, this->
|
|
239
|
+
buffer.encode_string(8, this->device_class_ref_);
|
|
222
240
|
buffer.encode_bool(9, this->disabled_by_default);
|
|
223
|
-
|
|
241
|
+
#ifdef USE_ENTITY_ICON
|
|
242
|
+
buffer.encode_string(10, this->icon_ref_);
|
|
243
|
+
#endif
|
|
224
244
|
buffer.encode_uint32(11, static_cast<uint32_t>(this->entity_category));
|
|
225
245
|
buffer.encode_bool(12, this->supports_stop);
|
|
246
|
+
#ifdef USE_DEVICES
|
|
226
247
|
buffer.encode_uint32(13, this->device_id);
|
|
248
|
+
#endif
|
|
227
249
|
}
|
|
228
|
-
void ListEntitiesCoverResponse::calculate_size(
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
250
|
+
void ListEntitiesCoverResponse::calculate_size(ProtoSize &size) const {
|
|
251
|
+
size.add_length(1, this->object_id_ref_.size());
|
|
252
|
+
size.add_fixed32(1, this->key);
|
|
253
|
+
size.add_length(1, this->name_ref_.size());
|
|
254
|
+
size.add_bool(1, this->assumed_state);
|
|
255
|
+
size.add_bool(1, this->supports_position);
|
|
256
|
+
size.add_bool(1, this->supports_tilt);
|
|
257
|
+
size.add_length(1, this->device_class_ref_.size());
|
|
258
|
+
size.add_bool(1, this->disabled_by_default);
|
|
259
|
+
#ifdef USE_ENTITY_ICON
|
|
260
|
+
size.add_length(1, this->icon_ref_.size());
|
|
261
|
+
#endif
|
|
262
|
+
size.add_uint32(1, static_cast<uint32_t>(this->entity_category));
|
|
263
|
+
size.add_bool(1, this->supports_stop);
|
|
264
|
+
#ifdef USE_DEVICES
|
|
265
|
+
size.add_uint32(1, this->device_id);
|
|
266
|
+
#endif
|
|
242
267
|
}
|
|
243
268
|
void CoverStateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
244
269
|
buffer.encode_fixed32(1, this->key);
|
|
245
|
-
buffer.encode_uint32(2, static_cast<uint32_t>(this->legacy_state));
|
|
246
270
|
buffer.encode_float(3, this->position);
|
|
247
271
|
buffer.encode_float(4, this->tilt);
|
|
248
272
|
buffer.encode_uint32(5, static_cast<uint32_t>(this->current_operation));
|
|
273
|
+
#ifdef USE_DEVICES
|
|
249
274
|
buffer.encode_uint32(6, this->device_id);
|
|
275
|
+
#endif
|
|
250
276
|
}
|
|
251
|
-
void CoverStateResponse::calculate_size(
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
277
|
+
void CoverStateResponse::calculate_size(ProtoSize &size) const {
|
|
278
|
+
size.add_fixed32(1, this->key);
|
|
279
|
+
size.add_float(1, this->position);
|
|
280
|
+
size.add_float(1, this->tilt);
|
|
281
|
+
size.add_uint32(1, static_cast<uint32_t>(this->current_operation));
|
|
282
|
+
#ifdef USE_DEVICES
|
|
283
|
+
size.add_uint32(1, this->device_id);
|
|
284
|
+
#endif
|
|
258
285
|
}
|
|
259
286
|
bool CoverCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
|
260
287
|
switch (field_id) {
|
|
261
|
-
case
|
|
262
|
-
this->has_legacy_command = value.as_bool();
|
|
263
|
-
return true;
|
|
264
|
-
}
|
|
265
|
-
case 3: {
|
|
266
|
-
this->legacy_command = static_cast<enums::LegacyCoverCommand>(value.as_uint32());
|
|
267
|
-
return true;
|
|
268
|
-
}
|
|
269
|
-
case 4: {
|
|
288
|
+
case 4:
|
|
270
289
|
this->has_position = value.as_bool();
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
case 6: {
|
|
290
|
+
break;
|
|
291
|
+
case 6:
|
|
274
292
|
this->has_tilt = value.as_bool();
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
case 8: {
|
|
293
|
+
break;
|
|
294
|
+
case 8:
|
|
278
295
|
this->stop = value.as_bool();
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
case 9:
|
|
296
|
+
break;
|
|
297
|
+
#ifdef USE_DEVICES
|
|
298
|
+
case 9:
|
|
282
299
|
this->device_id = value.as_uint32();
|
|
283
|
-
|
|
284
|
-
|
|
300
|
+
break;
|
|
301
|
+
#endif
|
|
285
302
|
default:
|
|
286
303
|
return false;
|
|
287
304
|
}
|
|
305
|
+
return true;
|
|
288
306
|
}
|
|
289
307
|
bool CoverCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
|
|
290
308
|
switch (field_id) {
|
|
291
|
-
case 1:
|
|
309
|
+
case 1:
|
|
292
310
|
this->key = value.as_fixed32();
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
case 5: {
|
|
311
|
+
break;
|
|
312
|
+
case 5:
|
|
296
313
|
this->position = value.as_float();
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
case 7: {
|
|
314
|
+
break;
|
|
315
|
+
case 7:
|
|
300
316
|
this->tilt = value.as_float();
|
|
301
|
-
|
|
302
|
-
}
|
|
317
|
+
break;
|
|
303
318
|
default:
|
|
304
319
|
return false;
|
|
305
320
|
}
|
|
321
|
+
return true;
|
|
306
322
|
}
|
|
307
323
|
#endif
|
|
308
324
|
#ifdef USE_FAN
|
|
309
325
|
void ListEntitiesFanResponse::encode(ProtoWriteBuffer buffer) const {
|
|
310
|
-
buffer.encode_string(1, this->
|
|
326
|
+
buffer.encode_string(1, this->object_id_ref_);
|
|
311
327
|
buffer.encode_fixed32(2, this->key);
|
|
312
|
-
buffer.encode_string(3, this->
|
|
313
|
-
buffer.encode_string(4, this->unique_id);
|
|
328
|
+
buffer.encode_string(3, this->name_ref_);
|
|
314
329
|
buffer.encode_bool(5, this->supports_oscillation);
|
|
315
330
|
buffer.encode_bool(6, this->supports_speed);
|
|
316
331
|
buffer.encode_bool(7, this->supports_direction);
|
|
317
332
|
buffer.encode_int32(8, this->supported_speed_count);
|
|
318
333
|
buffer.encode_bool(9, this->disabled_by_default);
|
|
319
|
-
|
|
334
|
+
#ifdef USE_ENTITY_ICON
|
|
335
|
+
buffer.encode_string(10, this->icon_ref_);
|
|
336
|
+
#endif
|
|
320
337
|
buffer.encode_uint32(11, static_cast<uint32_t>(this->entity_category));
|
|
321
|
-
for (auto &it : this->supported_preset_modes) {
|
|
338
|
+
for (const auto &it : *this->supported_preset_modes) {
|
|
322
339
|
buffer.encode_string(12, it, true);
|
|
323
340
|
}
|
|
341
|
+
#ifdef USE_DEVICES
|
|
324
342
|
buffer.encode_uint32(13, this->device_id);
|
|
343
|
+
#endif
|
|
325
344
|
}
|
|
326
|
-
void ListEntitiesFanResponse::calculate_size(
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
345
|
+
void ListEntitiesFanResponse::calculate_size(ProtoSize &size) const {
|
|
346
|
+
size.add_length(1, this->object_id_ref_.size());
|
|
347
|
+
size.add_fixed32(1, this->key);
|
|
348
|
+
size.add_length(1, this->name_ref_.size());
|
|
349
|
+
size.add_bool(1, this->supports_oscillation);
|
|
350
|
+
size.add_bool(1, this->supports_speed);
|
|
351
|
+
size.add_bool(1, this->supports_direction);
|
|
352
|
+
size.add_int32(1, this->supported_speed_count);
|
|
353
|
+
size.add_bool(1, this->disabled_by_default);
|
|
354
|
+
#ifdef USE_ENTITY_ICON
|
|
355
|
+
size.add_length(1, this->icon_ref_.size());
|
|
356
|
+
#endif
|
|
357
|
+
size.add_uint32(1, static_cast<uint32_t>(this->entity_category));
|
|
358
|
+
if (!this->supported_preset_modes->empty()) {
|
|
359
|
+
for (const auto &it : *this->supported_preset_modes) {
|
|
360
|
+
size.add_length_force(1, it.size());
|
|
341
361
|
}
|
|
342
362
|
}
|
|
343
|
-
|
|
363
|
+
#ifdef USE_DEVICES
|
|
364
|
+
size.add_uint32(1, this->device_id);
|
|
365
|
+
#endif
|
|
344
366
|
}
|
|
345
367
|
void FanStateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
346
368
|
buffer.encode_fixed32(1, this->key);
|
|
347
369
|
buffer.encode_bool(2, this->state);
|
|
348
370
|
buffer.encode_bool(3, this->oscillating);
|
|
349
|
-
buffer.encode_uint32(4, static_cast<uint32_t>(this->speed));
|
|
350
371
|
buffer.encode_uint32(5, static_cast<uint32_t>(this->direction));
|
|
351
372
|
buffer.encode_int32(6, this->speed_level);
|
|
352
|
-
buffer.encode_string(7, this->
|
|
373
|
+
buffer.encode_string(7, this->preset_mode_ref_);
|
|
374
|
+
#ifdef USE_DEVICES
|
|
353
375
|
buffer.encode_uint32(8, this->device_id);
|
|
376
|
+
#endif
|
|
354
377
|
}
|
|
355
|
-
void FanStateResponse::calculate_size(
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
378
|
+
void FanStateResponse::calculate_size(ProtoSize &size) const {
|
|
379
|
+
size.add_fixed32(1, this->key);
|
|
380
|
+
size.add_bool(1, this->state);
|
|
381
|
+
size.add_bool(1, this->oscillating);
|
|
382
|
+
size.add_uint32(1, static_cast<uint32_t>(this->direction));
|
|
383
|
+
size.add_int32(1, this->speed_level);
|
|
384
|
+
size.add_length(1, this->preset_mode_ref_.size());
|
|
385
|
+
#ifdef USE_DEVICES
|
|
386
|
+
size.add_uint32(1, this->device_id);
|
|
387
|
+
#endif
|
|
364
388
|
}
|
|
365
389
|
bool FanCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
|
366
390
|
switch (field_id) {
|
|
367
|
-
case 2:
|
|
391
|
+
case 2:
|
|
368
392
|
this->has_state = value.as_bool();
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
case 3: {
|
|
393
|
+
break;
|
|
394
|
+
case 3:
|
|
372
395
|
this->state = value.as_bool();
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
case 4: {
|
|
376
|
-
this->has_speed = value.as_bool();
|
|
377
|
-
return true;
|
|
378
|
-
}
|
|
379
|
-
case 5: {
|
|
380
|
-
this->speed = static_cast<enums::FanSpeed>(value.as_uint32());
|
|
381
|
-
return true;
|
|
382
|
-
}
|
|
383
|
-
case 6: {
|
|
396
|
+
break;
|
|
397
|
+
case 6:
|
|
384
398
|
this->has_oscillating = value.as_bool();
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
case 7: {
|
|
399
|
+
break;
|
|
400
|
+
case 7:
|
|
388
401
|
this->oscillating = value.as_bool();
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
case 8: {
|
|
402
|
+
break;
|
|
403
|
+
case 8:
|
|
392
404
|
this->has_direction = value.as_bool();
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
case 9: {
|
|
405
|
+
break;
|
|
406
|
+
case 9:
|
|
396
407
|
this->direction = static_cast<enums::FanDirection>(value.as_uint32());
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
case 10: {
|
|
408
|
+
break;
|
|
409
|
+
case 10:
|
|
400
410
|
this->has_speed_level = value.as_bool();
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
case 11: {
|
|
411
|
+
break;
|
|
412
|
+
case 11:
|
|
404
413
|
this->speed_level = value.as_int32();
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
case 12: {
|
|
414
|
+
break;
|
|
415
|
+
case 12:
|
|
408
416
|
this->has_preset_mode = value.as_bool();
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
case 14:
|
|
417
|
+
break;
|
|
418
|
+
#ifdef USE_DEVICES
|
|
419
|
+
case 14:
|
|
412
420
|
this->device_id = value.as_uint32();
|
|
413
|
-
|
|
414
|
-
|
|
421
|
+
break;
|
|
422
|
+
#endif
|
|
415
423
|
default:
|
|
416
424
|
return false;
|
|
417
425
|
}
|
|
426
|
+
return true;
|
|
418
427
|
}
|
|
419
428
|
bool FanCommandRequest::decode_length(uint32_t field_id, ProtoLengthDelimited value) {
|
|
420
429
|
switch (field_id) {
|
|
421
|
-
case 13:
|
|
430
|
+
case 13:
|
|
422
431
|
this->preset_mode = value.as_string();
|
|
423
|
-
|
|
424
|
-
}
|
|
432
|
+
break;
|
|
425
433
|
default:
|
|
426
434
|
return false;
|
|
427
435
|
}
|
|
436
|
+
return true;
|
|
428
437
|
}
|
|
429
438
|
bool FanCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
|
|
430
439
|
switch (field_id) {
|
|
431
|
-
case 1:
|
|
440
|
+
case 1:
|
|
432
441
|
this->key = value.as_fixed32();
|
|
433
|
-
|
|
434
|
-
}
|
|
442
|
+
break;
|
|
435
443
|
default:
|
|
436
444
|
return false;
|
|
437
445
|
}
|
|
446
|
+
return true;
|
|
438
447
|
}
|
|
439
448
|
#endif
|
|
440
449
|
#ifdef USE_LIGHT
|
|
441
450
|
void ListEntitiesLightResponse::encode(ProtoWriteBuffer buffer) const {
|
|
442
|
-
buffer.encode_string(1, this->
|
|
451
|
+
buffer.encode_string(1, this->object_id_ref_);
|
|
443
452
|
buffer.encode_fixed32(2, this->key);
|
|
444
|
-
buffer.encode_string(3, this->
|
|
445
|
-
|
|
446
|
-
for (auto &it : this->supported_color_modes) {
|
|
453
|
+
buffer.encode_string(3, this->name_ref_);
|
|
454
|
+
for (const auto &it : *this->supported_color_modes) {
|
|
447
455
|
buffer.encode_uint32(12, static_cast<uint32_t>(it), true);
|
|
448
456
|
}
|
|
449
|
-
buffer.encode_bool(5, this->legacy_supports_brightness);
|
|
450
|
-
buffer.encode_bool(6, this->legacy_supports_rgb);
|
|
451
|
-
buffer.encode_bool(7, this->legacy_supports_white_value);
|
|
452
|
-
buffer.encode_bool(8, this->legacy_supports_color_temperature);
|
|
453
457
|
buffer.encode_float(9, this->min_mireds);
|
|
454
458
|
buffer.encode_float(10, this->max_mireds);
|
|
455
459
|
for (auto &it : this->effects) {
|
|
456
460
|
buffer.encode_string(11, it, true);
|
|
457
461
|
}
|
|
458
462
|
buffer.encode_bool(13, this->disabled_by_default);
|
|
459
|
-
|
|
463
|
+
#ifdef USE_ENTITY_ICON
|
|
464
|
+
buffer.encode_string(14, this->icon_ref_);
|
|
465
|
+
#endif
|
|
460
466
|
buffer.encode_uint32(15, static_cast<uint32_t>(this->entity_category));
|
|
467
|
+
#ifdef USE_DEVICES
|
|
461
468
|
buffer.encode_uint32(16, this->device_id);
|
|
469
|
+
#endif
|
|
462
470
|
}
|
|
463
|
-
void ListEntitiesLightResponse::calculate_size(
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
ProtoSize::add_enum_field_repeated(total_size, 1, static_cast<uint32_t>(it));
|
|
471
|
+
void ListEntitiesLightResponse::calculate_size(ProtoSize &size) const {
|
|
472
|
+
size.add_length(1, this->object_id_ref_.size());
|
|
473
|
+
size.add_fixed32(1, this->key);
|
|
474
|
+
size.add_length(1, this->name_ref_.size());
|
|
475
|
+
if (!this->supported_color_modes->empty()) {
|
|
476
|
+
for (const auto &it : *this->supported_color_modes) {
|
|
477
|
+
size.add_uint32_force(1, static_cast<uint32_t>(it));
|
|
471
478
|
}
|
|
472
479
|
}
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
ProtoSize::add_bool_field(total_size, 1, this->legacy_supports_white_value);
|
|
476
|
-
ProtoSize::add_bool_field(total_size, 1, this->legacy_supports_color_temperature);
|
|
477
|
-
ProtoSize::add_fixed_field<4>(total_size, 1, this->min_mireds != 0.0f);
|
|
478
|
-
ProtoSize::add_fixed_field<4>(total_size, 1, this->max_mireds != 0.0f);
|
|
480
|
+
size.add_float(1, this->min_mireds);
|
|
481
|
+
size.add_float(1, this->max_mireds);
|
|
479
482
|
if (!this->effects.empty()) {
|
|
480
483
|
for (const auto &it : this->effects) {
|
|
481
|
-
|
|
484
|
+
size.add_length_force(1, it.size());
|
|
482
485
|
}
|
|
483
486
|
}
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
487
|
+
size.add_bool(1, this->disabled_by_default);
|
|
488
|
+
#ifdef USE_ENTITY_ICON
|
|
489
|
+
size.add_length(1, this->icon_ref_.size());
|
|
490
|
+
#endif
|
|
491
|
+
size.add_uint32(1, static_cast<uint32_t>(this->entity_category));
|
|
492
|
+
#ifdef USE_DEVICES
|
|
493
|
+
size.add_uint32(2, this->device_id);
|
|
494
|
+
#endif
|
|
488
495
|
}
|
|
489
496
|
void LightStateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
490
497
|
buffer.encode_fixed32(1, this->key);
|
|
@@ -499,362 +506,354 @@ void LightStateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
499
506
|
buffer.encode_float(8, this->color_temperature);
|
|
500
507
|
buffer.encode_float(12, this->cold_white);
|
|
501
508
|
buffer.encode_float(13, this->warm_white);
|
|
502
|
-
buffer.encode_string(9, this->
|
|
509
|
+
buffer.encode_string(9, this->effect_ref_);
|
|
510
|
+
#ifdef USE_DEVICES
|
|
503
511
|
buffer.encode_uint32(14, this->device_id);
|
|
512
|
+
#endif
|
|
504
513
|
}
|
|
505
|
-
void LightStateResponse::calculate_size(
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
514
|
+
void LightStateResponse::calculate_size(ProtoSize &size) const {
|
|
515
|
+
size.add_fixed32(1, this->key);
|
|
516
|
+
size.add_bool(1, this->state);
|
|
517
|
+
size.add_float(1, this->brightness);
|
|
518
|
+
size.add_uint32(1, static_cast<uint32_t>(this->color_mode));
|
|
519
|
+
size.add_float(1, this->color_brightness);
|
|
520
|
+
size.add_float(1, this->red);
|
|
521
|
+
size.add_float(1, this->green);
|
|
522
|
+
size.add_float(1, this->blue);
|
|
523
|
+
size.add_float(1, this->white);
|
|
524
|
+
size.add_float(1, this->color_temperature);
|
|
525
|
+
size.add_float(1, this->cold_white);
|
|
526
|
+
size.add_float(1, this->warm_white);
|
|
527
|
+
size.add_length(1, this->effect_ref_.size());
|
|
528
|
+
#ifdef USE_DEVICES
|
|
529
|
+
size.add_uint32(1, this->device_id);
|
|
530
|
+
#endif
|
|
520
531
|
}
|
|
521
532
|
bool LightCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
|
522
533
|
switch (field_id) {
|
|
523
|
-
case 2:
|
|
534
|
+
case 2:
|
|
524
535
|
this->has_state = value.as_bool();
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
case 3: {
|
|
536
|
+
break;
|
|
537
|
+
case 3:
|
|
528
538
|
this->state = value.as_bool();
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
case 4: {
|
|
539
|
+
break;
|
|
540
|
+
case 4:
|
|
532
541
|
this->has_brightness = value.as_bool();
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
case 22: {
|
|
542
|
+
break;
|
|
543
|
+
case 22:
|
|
536
544
|
this->has_color_mode = value.as_bool();
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
case 23: {
|
|
545
|
+
break;
|
|
546
|
+
case 23:
|
|
540
547
|
this->color_mode = static_cast<enums::ColorMode>(value.as_uint32());
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
case 20: {
|
|
548
|
+
break;
|
|
549
|
+
case 20:
|
|
544
550
|
this->has_color_brightness = value.as_bool();
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
case 6: {
|
|
551
|
+
break;
|
|
552
|
+
case 6:
|
|
548
553
|
this->has_rgb = value.as_bool();
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
case 10: {
|
|
554
|
+
break;
|
|
555
|
+
case 10:
|
|
552
556
|
this->has_white = value.as_bool();
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
case 12: {
|
|
557
|
+
break;
|
|
558
|
+
case 12:
|
|
556
559
|
this->has_color_temperature = value.as_bool();
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
case 24: {
|
|
560
|
+
break;
|
|
561
|
+
case 24:
|
|
560
562
|
this->has_cold_white = value.as_bool();
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
case 26: {
|
|
563
|
+
break;
|
|
564
|
+
case 26:
|
|
564
565
|
this->has_warm_white = value.as_bool();
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
case 14: {
|
|
566
|
+
break;
|
|
567
|
+
case 14:
|
|
568
568
|
this->has_transition_length = value.as_bool();
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
case 15: {
|
|
569
|
+
break;
|
|
570
|
+
case 15:
|
|
572
571
|
this->transition_length = value.as_uint32();
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
case 16: {
|
|
572
|
+
break;
|
|
573
|
+
case 16:
|
|
576
574
|
this->has_flash_length = value.as_bool();
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
case 17: {
|
|
575
|
+
break;
|
|
576
|
+
case 17:
|
|
580
577
|
this->flash_length = value.as_uint32();
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
case 18: {
|
|
578
|
+
break;
|
|
579
|
+
case 18:
|
|
584
580
|
this->has_effect = value.as_bool();
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
case 28:
|
|
581
|
+
break;
|
|
582
|
+
#ifdef USE_DEVICES
|
|
583
|
+
case 28:
|
|
588
584
|
this->device_id = value.as_uint32();
|
|
589
|
-
|
|
590
|
-
|
|
585
|
+
break;
|
|
586
|
+
#endif
|
|
591
587
|
default:
|
|
592
588
|
return false;
|
|
593
589
|
}
|
|
590
|
+
return true;
|
|
594
591
|
}
|
|
595
592
|
bool LightCommandRequest::decode_length(uint32_t field_id, ProtoLengthDelimited value) {
|
|
596
593
|
switch (field_id) {
|
|
597
|
-
case 19:
|
|
594
|
+
case 19:
|
|
598
595
|
this->effect = value.as_string();
|
|
599
|
-
|
|
600
|
-
}
|
|
596
|
+
break;
|
|
601
597
|
default:
|
|
602
598
|
return false;
|
|
603
599
|
}
|
|
600
|
+
return true;
|
|
604
601
|
}
|
|
605
602
|
bool LightCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
|
|
606
603
|
switch (field_id) {
|
|
607
|
-
case 1:
|
|
604
|
+
case 1:
|
|
608
605
|
this->key = value.as_fixed32();
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
case 5: {
|
|
606
|
+
break;
|
|
607
|
+
case 5:
|
|
612
608
|
this->brightness = value.as_float();
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
case 21: {
|
|
609
|
+
break;
|
|
610
|
+
case 21:
|
|
616
611
|
this->color_brightness = value.as_float();
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
case 7: {
|
|
612
|
+
break;
|
|
613
|
+
case 7:
|
|
620
614
|
this->red = value.as_float();
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
case 8: {
|
|
615
|
+
break;
|
|
616
|
+
case 8:
|
|
624
617
|
this->green = value.as_float();
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
case 9: {
|
|
618
|
+
break;
|
|
619
|
+
case 9:
|
|
628
620
|
this->blue = value.as_float();
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
case 11: {
|
|
621
|
+
break;
|
|
622
|
+
case 11:
|
|
632
623
|
this->white = value.as_float();
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
case 13: {
|
|
624
|
+
break;
|
|
625
|
+
case 13:
|
|
636
626
|
this->color_temperature = value.as_float();
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
case 25: {
|
|
627
|
+
break;
|
|
628
|
+
case 25:
|
|
640
629
|
this->cold_white = value.as_float();
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
case 27: {
|
|
630
|
+
break;
|
|
631
|
+
case 27:
|
|
644
632
|
this->warm_white = value.as_float();
|
|
645
|
-
|
|
646
|
-
}
|
|
633
|
+
break;
|
|
647
634
|
default:
|
|
648
635
|
return false;
|
|
649
636
|
}
|
|
637
|
+
return true;
|
|
650
638
|
}
|
|
651
639
|
#endif
|
|
652
640
|
#ifdef USE_SENSOR
|
|
653
641
|
void ListEntitiesSensorResponse::encode(ProtoWriteBuffer buffer) const {
|
|
654
|
-
buffer.encode_string(1, this->
|
|
642
|
+
buffer.encode_string(1, this->object_id_ref_);
|
|
655
643
|
buffer.encode_fixed32(2, this->key);
|
|
656
|
-
buffer.encode_string(3, this->
|
|
657
|
-
|
|
658
|
-
buffer.encode_string(5, this->
|
|
659
|
-
|
|
644
|
+
buffer.encode_string(3, this->name_ref_);
|
|
645
|
+
#ifdef USE_ENTITY_ICON
|
|
646
|
+
buffer.encode_string(5, this->icon_ref_);
|
|
647
|
+
#endif
|
|
648
|
+
buffer.encode_string(6, this->unit_of_measurement_ref_);
|
|
660
649
|
buffer.encode_int32(7, this->accuracy_decimals);
|
|
661
650
|
buffer.encode_bool(8, this->force_update);
|
|
662
|
-
buffer.encode_string(9, this->
|
|
651
|
+
buffer.encode_string(9, this->device_class_ref_);
|
|
663
652
|
buffer.encode_uint32(10, static_cast<uint32_t>(this->state_class));
|
|
664
|
-
buffer.encode_uint32(11, static_cast<uint32_t>(this->legacy_last_reset_type));
|
|
665
653
|
buffer.encode_bool(12, this->disabled_by_default);
|
|
666
654
|
buffer.encode_uint32(13, static_cast<uint32_t>(this->entity_category));
|
|
655
|
+
#ifdef USE_DEVICES
|
|
667
656
|
buffer.encode_uint32(14, this->device_id);
|
|
657
|
+
#endif
|
|
668
658
|
}
|
|
669
|
-
void ListEntitiesSensorResponse::calculate_size(
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
659
|
+
void ListEntitiesSensorResponse::calculate_size(ProtoSize &size) const {
|
|
660
|
+
size.add_length(1, this->object_id_ref_.size());
|
|
661
|
+
size.add_fixed32(1, this->key);
|
|
662
|
+
size.add_length(1, this->name_ref_.size());
|
|
663
|
+
#ifdef USE_ENTITY_ICON
|
|
664
|
+
size.add_length(1, this->icon_ref_.size());
|
|
665
|
+
#endif
|
|
666
|
+
size.add_length(1, this->unit_of_measurement_ref_.size());
|
|
667
|
+
size.add_int32(1, this->accuracy_decimals);
|
|
668
|
+
size.add_bool(1, this->force_update);
|
|
669
|
+
size.add_length(1, this->device_class_ref_.size());
|
|
670
|
+
size.add_uint32(1, static_cast<uint32_t>(this->state_class));
|
|
671
|
+
size.add_bool(1, this->disabled_by_default);
|
|
672
|
+
size.add_uint32(1, static_cast<uint32_t>(this->entity_category));
|
|
673
|
+
#ifdef USE_DEVICES
|
|
674
|
+
size.add_uint32(1, this->device_id);
|
|
675
|
+
#endif
|
|
684
676
|
}
|
|
685
677
|
void SensorStateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
686
678
|
buffer.encode_fixed32(1, this->key);
|
|
687
679
|
buffer.encode_float(2, this->state);
|
|
688
680
|
buffer.encode_bool(3, this->missing_state);
|
|
681
|
+
#ifdef USE_DEVICES
|
|
689
682
|
buffer.encode_uint32(4, this->device_id);
|
|
683
|
+
#endif
|
|
690
684
|
}
|
|
691
|
-
void SensorStateResponse::calculate_size(
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
685
|
+
void SensorStateResponse::calculate_size(ProtoSize &size) const {
|
|
686
|
+
size.add_fixed32(1, this->key);
|
|
687
|
+
size.add_float(1, this->state);
|
|
688
|
+
size.add_bool(1, this->missing_state);
|
|
689
|
+
#ifdef USE_DEVICES
|
|
690
|
+
size.add_uint32(1, this->device_id);
|
|
691
|
+
#endif
|
|
696
692
|
}
|
|
697
693
|
#endif
|
|
698
694
|
#ifdef USE_SWITCH
|
|
699
695
|
void ListEntitiesSwitchResponse::encode(ProtoWriteBuffer buffer) const {
|
|
700
|
-
buffer.encode_string(1, this->
|
|
696
|
+
buffer.encode_string(1, this->object_id_ref_);
|
|
701
697
|
buffer.encode_fixed32(2, this->key);
|
|
702
|
-
buffer.encode_string(3, this->
|
|
703
|
-
|
|
704
|
-
buffer.encode_string(5, this->
|
|
698
|
+
buffer.encode_string(3, this->name_ref_);
|
|
699
|
+
#ifdef USE_ENTITY_ICON
|
|
700
|
+
buffer.encode_string(5, this->icon_ref_);
|
|
701
|
+
#endif
|
|
705
702
|
buffer.encode_bool(6, this->assumed_state);
|
|
706
703
|
buffer.encode_bool(7, this->disabled_by_default);
|
|
707
704
|
buffer.encode_uint32(8, static_cast<uint32_t>(this->entity_category));
|
|
708
|
-
buffer.encode_string(9, this->
|
|
705
|
+
buffer.encode_string(9, this->device_class_ref_);
|
|
706
|
+
#ifdef USE_DEVICES
|
|
709
707
|
buffer.encode_uint32(10, this->device_id);
|
|
708
|
+
#endif
|
|
710
709
|
}
|
|
711
|
-
void ListEntitiesSwitchResponse::calculate_size(
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
710
|
+
void ListEntitiesSwitchResponse::calculate_size(ProtoSize &size) const {
|
|
711
|
+
size.add_length(1, this->object_id_ref_.size());
|
|
712
|
+
size.add_fixed32(1, this->key);
|
|
713
|
+
size.add_length(1, this->name_ref_.size());
|
|
714
|
+
#ifdef USE_ENTITY_ICON
|
|
715
|
+
size.add_length(1, this->icon_ref_.size());
|
|
716
|
+
#endif
|
|
717
|
+
size.add_bool(1, this->assumed_state);
|
|
718
|
+
size.add_bool(1, this->disabled_by_default);
|
|
719
|
+
size.add_uint32(1, static_cast<uint32_t>(this->entity_category));
|
|
720
|
+
size.add_length(1, this->device_class_ref_.size());
|
|
721
|
+
#ifdef USE_DEVICES
|
|
722
|
+
size.add_uint32(1, this->device_id);
|
|
723
|
+
#endif
|
|
722
724
|
}
|
|
723
725
|
void SwitchStateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
724
726
|
buffer.encode_fixed32(1, this->key);
|
|
725
727
|
buffer.encode_bool(2, this->state);
|
|
728
|
+
#ifdef USE_DEVICES
|
|
726
729
|
buffer.encode_uint32(3, this->device_id);
|
|
730
|
+
#endif
|
|
727
731
|
}
|
|
728
|
-
void SwitchStateResponse::calculate_size(
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
+
void SwitchStateResponse::calculate_size(ProtoSize &size) const {
|
|
733
|
+
size.add_fixed32(1, this->key);
|
|
734
|
+
size.add_bool(1, this->state);
|
|
735
|
+
#ifdef USE_DEVICES
|
|
736
|
+
size.add_uint32(1, this->device_id);
|
|
737
|
+
#endif
|
|
732
738
|
}
|
|
733
739
|
bool SwitchCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
|
734
740
|
switch (field_id) {
|
|
735
|
-
case 2:
|
|
741
|
+
case 2:
|
|
736
742
|
this->state = value.as_bool();
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
case 3:
|
|
743
|
+
break;
|
|
744
|
+
#ifdef USE_DEVICES
|
|
745
|
+
case 3:
|
|
740
746
|
this->device_id = value.as_uint32();
|
|
741
|
-
|
|
742
|
-
|
|
747
|
+
break;
|
|
748
|
+
#endif
|
|
743
749
|
default:
|
|
744
750
|
return false;
|
|
745
751
|
}
|
|
752
|
+
return true;
|
|
746
753
|
}
|
|
747
754
|
bool SwitchCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
|
|
748
755
|
switch (field_id) {
|
|
749
|
-
case 1:
|
|
756
|
+
case 1:
|
|
750
757
|
this->key = value.as_fixed32();
|
|
751
|
-
|
|
752
|
-
}
|
|
758
|
+
break;
|
|
753
759
|
default:
|
|
754
760
|
return false;
|
|
755
761
|
}
|
|
762
|
+
return true;
|
|
756
763
|
}
|
|
757
764
|
#endif
|
|
758
765
|
#ifdef USE_TEXT_SENSOR
|
|
759
766
|
void ListEntitiesTextSensorResponse::encode(ProtoWriteBuffer buffer) const {
|
|
760
|
-
buffer.encode_string(1, this->
|
|
767
|
+
buffer.encode_string(1, this->object_id_ref_);
|
|
761
768
|
buffer.encode_fixed32(2, this->key);
|
|
762
|
-
buffer.encode_string(3, this->
|
|
763
|
-
|
|
764
|
-
buffer.encode_string(5, this->
|
|
769
|
+
buffer.encode_string(3, this->name_ref_);
|
|
770
|
+
#ifdef USE_ENTITY_ICON
|
|
771
|
+
buffer.encode_string(5, this->icon_ref_);
|
|
772
|
+
#endif
|
|
765
773
|
buffer.encode_bool(6, this->disabled_by_default);
|
|
766
774
|
buffer.encode_uint32(7, static_cast<uint32_t>(this->entity_category));
|
|
767
|
-
buffer.encode_string(8, this->
|
|
775
|
+
buffer.encode_string(8, this->device_class_ref_);
|
|
776
|
+
#ifdef USE_DEVICES
|
|
768
777
|
buffer.encode_uint32(9, this->device_id);
|
|
778
|
+
#endif
|
|
769
779
|
}
|
|
770
|
-
void ListEntitiesTextSensorResponse::calculate_size(
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
+
void ListEntitiesTextSensorResponse::calculate_size(ProtoSize &size) const {
|
|
781
|
+
size.add_length(1, this->object_id_ref_.size());
|
|
782
|
+
size.add_fixed32(1, this->key);
|
|
783
|
+
size.add_length(1, this->name_ref_.size());
|
|
784
|
+
#ifdef USE_ENTITY_ICON
|
|
785
|
+
size.add_length(1, this->icon_ref_.size());
|
|
786
|
+
#endif
|
|
787
|
+
size.add_bool(1, this->disabled_by_default);
|
|
788
|
+
size.add_uint32(1, static_cast<uint32_t>(this->entity_category));
|
|
789
|
+
size.add_length(1, this->device_class_ref_.size());
|
|
790
|
+
#ifdef USE_DEVICES
|
|
791
|
+
size.add_uint32(1, this->device_id);
|
|
792
|
+
#endif
|
|
780
793
|
}
|
|
781
794
|
void TextSensorStateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
782
795
|
buffer.encode_fixed32(1, this->key);
|
|
783
|
-
buffer.encode_string(2, this->
|
|
796
|
+
buffer.encode_string(2, this->state_ref_);
|
|
784
797
|
buffer.encode_bool(3, this->missing_state);
|
|
798
|
+
#ifdef USE_DEVICES
|
|
785
799
|
buffer.encode_uint32(4, this->device_id);
|
|
800
|
+
#endif
|
|
786
801
|
}
|
|
787
|
-
void TextSensorStateResponse::calculate_size(
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
802
|
+
void TextSensorStateResponse::calculate_size(ProtoSize &size) const {
|
|
803
|
+
size.add_fixed32(1, this->key);
|
|
804
|
+
size.add_length(1, this->state_ref_.size());
|
|
805
|
+
size.add_bool(1, this->missing_state);
|
|
806
|
+
#ifdef USE_DEVICES
|
|
807
|
+
size.add_uint32(1, this->device_id);
|
|
808
|
+
#endif
|
|
792
809
|
}
|
|
793
810
|
#endif
|
|
794
811
|
bool SubscribeLogsRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
|
795
812
|
switch (field_id) {
|
|
796
|
-
case 1:
|
|
813
|
+
case 1:
|
|
797
814
|
this->level = static_cast<enums::LogLevel>(value.as_uint32());
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
case 2: {
|
|
815
|
+
break;
|
|
816
|
+
case 2:
|
|
801
817
|
this->dump_config = value.as_bool();
|
|
802
|
-
|
|
803
|
-
}
|
|
818
|
+
break;
|
|
804
819
|
default:
|
|
805
820
|
return false;
|
|
806
821
|
}
|
|
822
|
+
return true;
|
|
807
823
|
}
|
|
808
824
|
void SubscribeLogsResponse::encode(ProtoWriteBuffer buffer) const {
|
|
809
825
|
buffer.encode_uint32(1, static_cast<uint32_t>(this->level));
|
|
810
|
-
buffer.encode_bytes(3,
|
|
811
|
-
buffer.encode_bool(4, this->send_failed);
|
|
826
|
+
buffer.encode_bytes(3, this->message_ptr_, this->message_len_);
|
|
812
827
|
}
|
|
813
|
-
void SubscribeLogsResponse::calculate_size(
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
ProtoSize::add_bool_field(total_size, 1, this->send_failed);
|
|
828
|
+
void SubscribeLogsResponse::calculate_size(ProtoSize &size) const {
|
|
829
|
+
size.add_uint32(1, static_cast<uint32_t>(this->level));
|
|
830
|
+
size.add_length(1, this->message_len_);
|
|
817
831
|
}
|
|
818
832
|
#ifdef USE_API_NOISE
|
|
819
833
|
bool NoiseEncryptionSetKeyRequest::decode_length(uint32_t field_id, ProtoLengthDelimited value) {
|
|
820
834
|
switch (field_id) {
|
|
821
|
-
case 1:
|
|
835
|
+
case 1:
|
|
822
836
|
this->key = value.as_string();
|
|
823
|
-
|
|
824
|
-
}
|
|
837
|
+
break;
|
|
825
838
|
default:
|
|
826
839
|
return false;
|
|
827
840
|
}
|
|
841
|
+
return true;
|
|
828
842
|
}
|
|
829
843
|
void NoiseEncryptionSetKeyResponse::encode(ProtoWriteBuffer buffer) const { buffer.encode_bool(1, this->success); }
|
|
830
|
-
void NoiseEncryptionSetKeyResponse::calculate_size(
|
|
831
|
-
ProtoSize::add_bool_field(total_size, 1, this->success);
|
|
832
|
-
}
|
|
844
|
+
void NoiseEncryptionSetKeyResponse::calculate_size(ProtoSize &size) const { size.add_bool(1, this->success); }
|
|
833
845
|
#endif
|
|
834
|
-
|
|
835
|
-
switch (field_id) {
|
|
836
|
-
case 1: {
|
|
837
|
-
this->key = value.as_string();
|
|
838
|
-
return true;
|
|
839
|
-
}
|
|
840
|
-
case 2: {
|
|
841
|
-
this->value = value.as_string();
|
|
842
|
-
return true;
|
|
843
|
-
}
|
|
844
|
-
default:
|
|
845
|
-
return false;
|
|
846
|
-
}
|
|
847
|
-
}
|
|
846
|
+
#ifdef USE_API_HOMEASSISTANT_SERVICES
|
|
848
847
|
void HomeassistantServiceMap::encode(ProtoWriteBuffer buffer) const {
|
|
849
|
-
buffer.encode_string(1, this->
|
|
848
|
+
buffer.encode_string(1, this->key_ref_);
|
|
850
849
|
buffer.encode_string(2, this->value);
|
|
851
850
|
}
|
|
852
|
-
void HomeassistantServiceMap::calculate_size(
|
|
853
|
-
|
|
854
|
-
|
|
851
|
+
void HomeassistantServiceMap::calculate_size(ProtoSize &size) const {
|
|
852
|
+
size.add_length(1, this->key_ref_.size());
|
|
853
|
+
size.add_length(1, this->value.size());
|
|
855
854
|
}
|
|
856
855
|
void HomeassistantServiceResponse::encode(ProtoWriteBuffer buffer) const {
|
|
857
|
-
buffer.encode_string(1, this->
|
|
856
|
+
buffer.encode_string(1, this->service_ref_);
|
|
858
857
|
for (auto &it : this->data) {
|
|
859
858
|
buffer.encode_message(2, it, true);
|
|
860
859
|
}
|
|
@@ -866,356 +865,298 @@ void HomeassistantServiceResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
866
865
|
}
|
|
867
866
|
buffer.encode_bool(5, this->is_event);
|
|
868
867
|
}
|
|
869
|
-
void HomeassistantServiceResponse::calculate_size(
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
868
|
+
void HomeassistantServiceResponse::calculate_size(ProtoSize &size) const {
|
|
869
|
+
size.add_length(1, this->service_ref_.size());
|
|
870
|
+
size.add_repeated_message(1, this->data);
|
|
871
|
+
size.add_repeated_message(1, this->data_template);
|
|
872
|
+
size.add_repeated_message(1, this->variables);
|
|
873
|
+
size.add_bool(1, this->is_event);
|
|
875
874
|
}
|
|
875
|
+
#endif
|
|
876
|
+
#ifdef USE_API_HOMEASSISTANT_STATES
|
|
876
877
|
void SubscribeHomeAssistantStateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
877
|
-
buffer.encode_string(1, this->
|
|
878
|
-
buffer.encode_string(2, this->
|
|
878
|
+
buffer.encode_string(1, this->entity_id_ref_);
|
|
879
|
+
buffer.encode_string(2, this->attribute_ref_);
|
|
879
880
|
buffer.encode_bool(3, this->once);
|
|
880
881
|
}
|
|
881
|
-
void SubscribeHomeAssistantStateResponse::calculate_size(
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
882
|
+
void SubscribeHomeAssistantStateResponse::calculate_size(ProtoSize &size) const {
|
|
883
|
+
size.add_length(1, this->entity_id_ref_.size());
|
|
884
|
+
size.add_length(1, this->attribute_ref_.size());
|
|
885
|
+
size.add_bool(1, this->once);
|
|
885
886
|
}
|
|
886
887
|
bool HomeAssistantStateResponse::decode_length(uint32_t field_id, ProtoLengthDelimited value) {
|
|
887
888
|
switch (field_id) {
|
|
888
|
-
case 1:
|
|
889
|
+
case 1:
|
|
889
890
|
this->entity_id = value.as_string();
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
case 2: {
|
|
891
|
+
break;
|
|
892
|
+
case 2:
|
|
893
893
|
this->state = value.as_string();
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
case 3: {
|
|
894
|
+
break;
|
|
895
|
+
case 3:
|
|
897
896
|
this->attribute = value.as_string();
|
|
898
|
-
|
|
899
|
-
}
|
|
897
|
+
break;
|
|
900
898
|
default:
|
|
901
899
|
return false;
|
|
902
900
|
}
|
|
901
|
+
return true;
|
|
903
902
|
}
|
|
903
|
+
#endif
|
|
904
904
|
bool GetTimeResponse::decode_32bit(uint32_t field_id, Proto32Bit value) {
|
|
905
905
|
switch (field_id) {
|
|
906
|
-
case 1:
|
|
906
|
+
case 1:
|
|
907
907
|
this->epoch_seconds = value.as_fixed32();
|
|
908
|
-
|
|
909
|
-
}
|
|
908
|
+
break;
|
|
910
909
|
default:
|
|
911
910
|
return false;
|
|
912
911
|
}
|
|
912
|
+
return true;
|
|
913
913
|
}
|
|
914
914
|
void GetTimeResponse::encode(ProtoWriteBuffer buffer) const { buffer.encode_fixed32(1, this->epoch_seconds); }
|
|
915
|
-
void GetTimeResponse::calculate_size(
|
|
916
|
-
ProtoSize::add_fixed_field<4>(total_size, 1, this->epoch_seconds != 0);
|
|
917
|
-
}
|
|
915
|
+
void GetTimeResponse::calculate_size(ProtoSize &size) const { size.add_fixed32(1, this->epoch_seconds); }
|
|
918
916
|
#ifdef USE_API_SERVICES
|
|
919
|
-
bool ListEntitiesServicesArgument::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
|
920
|
-
switch (field_id) {
|
|
921
|
-
case 2: {
|
|
922
|
-
this->type = static_cast<enums::ServiceArgType>(value.as_uint32());
|
|
923
|
-
return true;
|
|
924
|
-
}
|
|
925
|
-
default:
|
|
926
|
-
return false;
|
|
927
|
-
}
|
|
928
|
-
}
|
|
929
|
-
bool ListEntitiesServicesArgument::decode_length(uint32_t field_id, ProtoLengthDelimited value) {
|
|
930
|
-
switch (field_id) {
|
|
931
|
-
case 1: {
|
|
932
|
-
this->name = value.as_string();
|
|
933
|
-
return true;
|
|
934
|
-
}
|
|
935
|
-
default:
|
|
936
|
-
return false;
|
|
937
|
-
}
|
|
938
|
-
}
|
|
939
917
|
void ListEntitiesServicesArgument::encode(ProtoWriteBuffer buffer) const {
|
|
940
|
-
buffer.encode_string(1, this->
|
|
918
|
+
buffer.encode_string(1, this->name_ref_);
|
|
941
919
|
buffer.encode_uint32(2, static_cast<uint32_t>(this->type));
|
|
942
920
|
}
|
|
943
|
-
void ListEntitiesServicesArgument::calculate_size(
|
|
944
|
-
|
|
945
|
-
|
|
921
|
+
void ListEntitiesServicesArgument::calculate_size(ProtoSize &size) const {
|
|
922
|
+
size.add_length(1, this->name_ref_.size());
|
|
923
|
+
size.add_uint32(1, static_cast<uint32_t>(this->type));
|
|
946
924
|
}
|
|
947
925
|
void ListEntitiesServicesResponse::encode(ProtoWriteBuffer buffer) const {
|
|
948
|
-
buffer.encode_string(1, this->
|
|
926
|
+
buffer.encode_string(1, this->name_ref_);
|
|
949
927
|
buffer.encode_fixed32(2, this->key);
|
|
950
928
|
for (auto &it : this->args) {
|
|
951
929
|
buffer.encode_message(3, it, true);
|
|
952
930
|
}
|
|
953
931
|
}
|
|
954
|
-
void ListEntitiesServicesResponse::calculate_size(
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
932
|
+
void ListEntitiesServicesResponse::calculate_size(ProtoSize &size) const {
|
|
933
|
+
size.add_length(1, this->name_ref_.size());
|
|
934
|
+
size.add_fixed32(1, this->key);
|
|
935
|
+
size.add_repeated_message(1, this->args);
|
|
958
936
|
}
|
|
959
937
|
bool ExecuteServiceArgument::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
|
960
938
|
switch (field_id) {
|
|
961
|
-
case 1:
|
|
939
|
+
case 1:
|
|
962
940
|
this->bool_ = value.as_bool();
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
case 2: {
|
|
941
|
+
break;
|
|
942
|
+
case 2:
|
|
966
943
|
this->legacy_int = value.as_int32();
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
case 5: {
|
|
944
|
+
break;
|
|
945
|
+
case 5:
|
|
970
946
|
this->int_ = value.as_sint32();
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
case 6: {
|
|
947
|
+
break;
|
|
948
|
+
case 6:
|
|
974
949
|
this->bool_array.push_back(value.as_bool());
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
case 7: {
|
|
950
|
+
break;
|
|
951
|
+
case 7:
|
|
978
952
|
this->int_array.push_back(value.as_sint32());
|
|
979
|
-
|
|
980
|
-
}
|
|
953
|
+
break;
|
|
981
954
|
default:
|
|
982
955
|
return false;
|
|
983
956
|
}
|
|
957
|
+
return true;
|
|
984
958
|
}
|
|
985
959
|
bool ExecuteServiceArgument::decode_length(uint32_t field_id, ProtoLengthDelimited value) {
|
|
986
960
|
switch (field_id) {
|
|
987
|
-
case 4:
|
|
961
|
+
case 4:
|
|
988
962
|
this->string_ = value.as_string();
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
case 9: {
|
|
963
|
+
break;
|
|
964
|
+
case 9:
|
|
992
965
|
this->string_array.push_back(value.as_string());
|
|
993
|
-
|
|
994
|
-
}
|
|
966
|
+
break;
|
|
995
967
|
default:
|
|
996
968
|
return false;
|
|
997
969
|
}
|
|
970
|
+
return true;
|
|
998
971
|
}
|
|
999
972
|
bool ExecuteServiceArgument::decode_32bit(uint32_t field_id, Proto32Bit value) {
|
|
1000
973
|
switch (field_id) {
|
|
1001
|
-
case 3:
|
|
974
|
+
case 3:
|
|
1002
975
|
this->float_ = value.as_float();
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
case 8: {
|
|
976
|
+
break;
|
|
977
|
+
case 8:
|
|
1006
978
|
this->float_array.push_back(value.as_float());
|
|
1007
|
-
|
|
1008
|
-
}
|
|
979
|
+
break;
|
|
1009
980
|
default:
|
|
1010
981
|
return false;
|
|
1011
982
|
}
|
|
1012
|
-
|
|
1013
|
-
void ExecuteServiceArgument::encode(ProtoWriteBuffer buffer) const {
|
|
1014
|
-
buffer.encode_bool(1, this->bool_);
|
|
1015
|
-
buffer.encode_int32(2, this->legacy_int);
|
|
1016
|
-
buffer.encode_float(3, this->float_);
|
|
1017
|
-
buffer.encode_string(4, this->string_);
|
|
1018
|
-
buffer.encode_sint32(5, this->int_);
|
|
1019
|
-
for (auto it : this->bool_array) {
|
|
1020
|
-
buffer.encode_bool(6, it, true);
|
|
1021
|
-
}
|
|
1022
|
-
for (auto &it : this->int_array) {
|
|
1023
|
-
buffer.encode_sint32(7, it, true);
|
|
1024
|
-
}
|
|
1025
|
-
for (auto &it : this->float_array) {
|
|
1026
|
-
buffer.encode_float(8, it, true);
|
|
1027
|
-
}
|
|
1028
|
-
for (auto &it : this->string_array) {
|
|
1029
|
-
buffer.encode_string(9, it, true);
|
|
1030
|
-
}
|
|
1031
|
-
}
|
|
1032
|
-
void ExecuteServiceArgument::calculate_size(uint32_t &total_size) const {
|
|
1033
|
-
ProtoSize::add_bool_field(total_size, 1, this->bool_);
|
|
1034
|
-
ProtoSize::add_int32_field(total_size, 1, this->legacy_int);
|
|
1035
|
-
ProtoSize::add_fixed_field<4>(total_size, 1, this->float_ != 0.0f);
|
|
1036
|
-
ProtoSize::add_string_field(total_size, 1, this->string_);
|
|
1037
|
-
ProtoSize::add_sint32_field(total_size, 1, this->int_);
|
|
1038
|
-
if (!this->bool_array.empty()) {
|
|
1039
|
-
for (const auto it : this->bool_array) {
|
|
1040
|
-
ProtoSize::add_bool_field_repeated(total_size, 1, it);
|
|
1041
|
-
}
|
|
1042
|
-
}
|
|
1043
|
-
if (!this->int_array.empty()) {
|
|
1044
|
-
for (const auto &it : this->int_array) {
|
|
1045
|
-
ProtoSize::add_sint32_field_repeated(total_size, 1, it);
|
|
1046
|
-
}
|
|
1047
|
-
}
|
|
1048
|
-
if (!this->float_array.empty()) {
|
|
1049
|
-
total_size += this->float_array.size() * 5;
|
|
1050
|
-
}
|
|
1051
|
-
if (!this->string_array.empty()) {
|
|
1052
|
-
for (const auto &it : this->string_array) {
|
|
1053
|
-
ProtoSize::add_string_field_repeated(total_size, 1, it);
|
|
1054
|
-
}
|
|
1055
|
-
}
|
|
983
|
+
return true;
|
|
1056
984
|
}
|
|
1057
985
|
bool ExecuteServiceRequest::decode_length(uint32_t field_id, ProtoLengthDelimited value) {
|
|
1058
986
|
switch (field_id) {
|
|
1059
|
-
case 2:
|
|
987
|
+
case 2:
|
|
1060
988
|
this->args.emplace_back();
|
|
1061
989
|
value.decode_to_message(this->args.back());
|
|
1062
|
-
|
|
1063
|
-
}
|
|
990
|
+
break;
|
|
1064
991
|
default:
|
|
1065
992
|
return false;
|
|
1066
993
|
}
|
|
994
|
+
return true;
|
|
1067
995
|
}
|
|
1068
996
|
bool ExecuteServiceRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
|
|
1069
997
|
switch (field_id) {
|
|
1070
|
-
case 1:
|
|
998
|
+
case 1:
|
|
1071
999
|
this->key = value.as_fixed32();
|
|
1072
|
-
|
|
1073
|
-
}
|
|
1000
|
+
break;
|
|
1074
1001
|
default:
|
|
1075
1002
|
return false;
|
|
1076
1003
|
}
|
|
1004
|
+
return true;
|
|
1077
1005
|
}
|
|
1078
1006
|
#endif
|
|
1079
1007
|
#ifdef USE_CAMERA
|
|
1080
1008
|
void ListEntitiesCameraResponse::encode(ProtoWriteBuffer buffer) const {
|
|
1081
|
-
buffer.encode_string(1, this->
|
|
1009
|
+
buffer.encode_string(1, this->object_id_ref_);
|
|
1082
1010
|
buffer.encode_fixed32(2, this->key);
|
|
1083
|
-
buffer.encode_string(3, this->
|
|
1084
|
-
buffer.encode_string(4, this->unique_id);
|
|
1011
|
+
buffer.encode_string(3, this->name_ref_);
|
|
1085
1012
|
buffer.encode_bool(5, this->disabled_by_default);
|
|
1086
|
-
|
|
1013
|
+
#ifdef USE_ENTITY_ICON
|
|
1014
|
+
buffer.encode_string(6, this->icon_ref_);
|
|
1015
|
+
#endif
|
|
1087
1016
|
buffer.encode_uint32(7, static_cast<uint32_t>(this->entity_category));
|
|
1017
|
+
#ifdef USE_DEVICES
|
|
1088
1018
|
buffer.encode_uint32(8, this->device_id);
|
|
1019
|
+
#endif
|
|
1089
1020
|
}
|
|
1090
|
-
void ListEntitiesCameraResponse::calculate_size(
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1021
|
+
void ListEntitiesCameraResponse::calculate_size(ProtoSize &size) const {
|
|
1022
|
+
size.add_length(1, this->object_id_ref_.size());
|
|
1023
|
+
size.add_fixed32(1, this->key);
|
|
1024
|
+
size.add_length(1, this->name_ref_.size());
|
|
1025
|
+
size.add_bool(1, this->disabled_by_default);
|
|
1026
|
+
#ifdef USE_ENTITY_ICON
|
|
1027
|
+
size.add_length(1, this->icon_ref_.size());
|
|
1028
|
+
#endif
|
|
1029
|
+
size.add_uint32(1, static_cast<uint32_t>(this->entity_category));
|
|
1030
|
+
#ifdef USE_DEVICES
|
|
1031
|
+
size.add_uint32(1, this->device_id);
|
|
1032
|
+
#endif
|
|
1099
1033
|
}
|
|
1100
1034
|
void CameraImageResponse::encode(ProtoWriteBuffer buffer) const {
|
|
1101
1035
|
buffer.encode_fixed32(1, this->key);
|
|
1102
|
-
buffer.encode_bytes(2,
|
|
1036
|
+
buffer.encode_bytes(2, this->data_ptr_, this->data_len_);
|
|
1103
1037
|
buffer.encode_bool(3, this->done);
|
|
1038
|
+
#ifdef USE_DEVICES
|
|
1104
1039
|
buffer.encode_uint32(4, this->device_id);
|
|
1040
|
+
#endif
|
|
1105
1041
|
}
|
|
1106
|
-
void CameraImageResponse::calculate_size(
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1042
|
+
void CameraImageResponse::calculate_size(ProtoSize &size) const {
|
|
1043
|
+
size.add_fixed32(1, this->key);
|
|
1044
|
+
size.add_length(1, this->data_len_);
|
|
1045
|
+
size.add_bool(1, this->done);
|
|
1046
|
+
#ifdef USE_DEVICES
|
|
1047
|
+
size.add_uint32(1, this->device_id);
|
|
1048
|
+
#endif
|
|
1111
1049
|
}
|
|
1112
1050
|
bool CameraImageRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
|
1113
1051
|
switch (field_id) {
|
|
1114
|
-
case 1:
|
|
1052
|
+
case 1:
|
|
1115
1053
|
this->single = value.as_bool();
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
case 2: {
|
|
1054
|
+
break;
|
|
1055
|
+
case 2:
|
|
1119
1056
|
this->stream = value.as_bool();
|
|
1120
|
-
|
|
1121
|
-
}
|
|
1057
|
+
break;
|
|
1122
1058
|
default:
|
|
1123
1059
|
return false;
|
|
1124
1060
|
}
|
|
1061
|
+
return true;
|
|
1125
1062
|
}
|
|
1126
1063
|
#endif
|
|
1127
1064
|
#ifdef USE_CLIMATE
|
|
1128
1065
|
void ListEntitiesClimateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
1129
|
-
buffer.encode_string(1, this->
|
|
1066
|
+
buffer.encode_string(1, this->object_id_ref_);
|
|
1130
1067
|
buffer.encode_fixed32(2, this->key);
|
|
1131
|
-
buffer.encode_string(3, this->
|
|
1132
|
-
buffer.encode_string(4, this->unique_id);
|
|
1068
|
+
buffer.encode_string(3, this->name_ref_);
|
|
1133
1069
|
buffer.encode_bool(5, this->supports_current_temperature);
|
|
1134
1070
|
buffer.encode_bool(6, this->supports_two_point_target_temperature);
|
|
1135
|
-
for (auto &it : this->supported_modes) {
|
|
1071
|
+
for (const auto &it : *this->supported_modes) {
|
|
1136
1072
|
buffer.encode_uint32(7, static_cast<uint32_t>(it), true);
|
|
1137
1073
|
}
|
|
1138
1074
|
buffer.encode_float(8, this->visual_min_temperature);
|
|
1139
1075
|
buffer.encode_float(9, this->visual_max_temperature);
|
|
1140
1076
|
buffer.encode_float(10, this->visual_target_temperature_step);
|
|
1141
|
-
buffer.encode_bool(11, this->legacy_supports_away);
|
|
1142
1077
|
buffer.encode_bool(12, this->supports_action);
|
|
1143
|
-
for (auto &it : this->supported_fan_modes) {
|
|
1078
|
+
for (const auto &it : *this->supported_fan_modes) {
|
|
1144
1079
|
buffer.encode_uint32(13, static_cast<uint32_t>(it), true);
|
|
1145
1080
|
}
|
|
1146
|
-
for (auto &it : this->supported_swing_modes) {
|
|
1081
|
+
for (const auto &it : *this->supported_swing_modes) {
|
|
1147
1082
|
buffer.encode_uint32(14, static_cast<uint32_t>(it), true);
|
|
1148
1083
|
}
|
|
1149
|
-
for (auto &it : this->supported_custom_fan_modes) {
|
|
1084
|
+
for (const auto &it : *this->supported_custom_fan_modes) {
|
|
1150
1085
|
buffer.encode_string(15, it, true);
|
|
1151
1086
|
}
|
|
1152
|
-
for (auto &it : this->supported_presets) {
|
|
1087
|
+
for (const auto &it : *this->supported_presets) {
|
|
1153
1088
|
buffer.encode_uint32(16, static_cast<uint32_t>(it), true);
|
|
1154
1089
|
}
|
|
1155
|
-
for (auto &it : this->supported_custom_presets) {
|
|
1090
|
+
for (const auto &it : *this->supported_custom_presets) {
|
|
1156
1091
|
buffer.encode_string(17, it, true);
|
|
1157
1092
|
}
|
|
1158
1093
|
buffer.encode_bool(18, this->disabled_by_default);
|
|
1159
|
-
|
|
1094
|
+
#ifdef USE_ENTITY_ICON
|
|
1095
|
+
buffer.encode_string(19, this->icon_ref_);
|
|
1096
|
+
#endif
|
|
1160
1097
|
buffer.encode_uint32(20, static_cast<uint32_t>(this->entity_category));
|
|
1161
1098
|
buffer.encode_float(21, this->visual_current_temperature_step);
|
|
1162
1099
|
buffer.encode_bool(22, this->supports_current_humidity);
|
|
1163
1100
|
buffer.encode_bool(23, this->supports_target_humidity);
|
|
1164
1101
|
buffer.encode_float(24, this->visual_min_humidity);
|
|
1165
1102
|
buffer.encode_float(25, this->visual_max_humidity);
|
|
1103
|
+
#ifdef USE_DEVICES
|
|
1166
1104
|
buffer.encode_uint32(26, this->device_id);
|
|
1105
|
+
#endif
|
|
1167
1106
|
}
|
|
1168
|
-
void ListEntitiesClimateResponse::calculate_size(
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
ProtoSize::add_enum_field_repeated(total_size, 1, static_cast<uint32_t>(it));
|
|
1107
|
+
void ListEntitiesClimateResponse::calculate_size(ProtoSize &size) const {
|
|
1108
|
+
size.add_length(1, this->object_id_ref_.size());
|
|
1109
|
+
size.add_fixed32(1, this->key);
|
|
1110
|
+
size.add_length(1, this->name_ref_.size());
|
|
1111
|
+
size.add_bool(1, this->supports_current_temperature);
|
|
1112
|
+
size.add_bool(1, this->supports_two_point_target_temperature);
|
|
1113
|
+
if (!this->supported_modes->empty()) {
|
|
1114
|
+
for (const auto &it : *this->supported_modes) {
|
|
1115
|
+
size.add_uint32_force(1, static_cast<uint32_t>(it));
|
|
1178
1116
|
}
|
|
1179
1117
|
}
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
ProtoSize::add_enum_field_repeated(total_size, 1, static_cast<uint32_t>(it));
|
|
1118
|
+
size.add_float(1, this->visual_min_temperature);
|
|
1119
|
+
size.add_float(1, this->visual_max_temperature);
|
|
1120
|
+
size.add_float(1, this->visual_target_temperature_step);
|
|
1121
|
+
size.add_bool(1, this->supports_action);
|
|
1122
|
+
if (!this->supported_fan_modes->empty()) {
|
|
1123
|
+
for (const auto &it : *this->supported_fan_modes) {
|
|
1124
|
+
size.add_uint32_force(1, static_cast<uint32_t>(it));
|
|
1188
1125
|
}
|
|
1189
1126
|
}
|
|
1190
|
-
if (!this->supported_swing_modes
|
|
1191
|
-
for (const auto &it : this->supported_swing_modes) {
|
|
1192
|
-
|
|
1127
|
+
if (!this->supported_swing_modes->empty()) {
|
|
1128
|
+
for (const auto &it : *this->supported_swing_modes) {
|
|
1129
|
+
size.add_uint32_force(1, static_cast<uint32_t>(it));
|
|
1193
1130
|
}
|
|
1194
1131
|
}
|
|
1195
|
-
if (!this->supported_custom_fan_modes
|
|
1196
|
-
for (const auto &it : this->supported_custom_fan_modes) {
|
|
1197
|
-
|
|
1132
|
+
if (!this->supported_custom_fan_modes->empty()) {
|
|
1133
|
+
for (const auto &it : *this->supported_custom_fan_modes) {
|
|
1134
|
+
size.add_length_force(1, it.size());
|
|
1198
1135
|
}
|
|
1199
1136
|
}
|
|
1200
|
-
if (!this->supported_presets
|
|
1201
|
-
for (const auto &it : this->supported_presets) {
|
|
1202
|
-
|
|
1137
|
+
if (!this->supported_presets->empty()) {
|
|
1138
|
+
for (const auto &it : *this->supported_presets) {
|
|
1139
|
+
size.add_uint32_force(2, static_cast<uint32_t>(it));
|
|
1203
1140
|
}
|
|
1204
1141
|
}
|
|
1205
|
-
if (!this->supported_custom_presets
|
|
1206
|
-
for (const auto &it : this->supported_custom_presets) {
|
|
1207
|
-
|
|
1142
|
+
if (!this->supported_custom_presets->empty()) {
|
|
1143
|
+
for (const auto &it : *this->supported_custom_presets) {
|
|
1144
|
+
size.add_length_force(2, it.size());
|
|
1208
1145
|
}
|
|
1209
1146
|
}
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1147
|
+
size.add_bool(2, this->disabled_by_default);
|
|
1148
|
+
#ifdef USE_ENTITY_ICON
|
|
1149
|
+
size.add_length(2, this->icon_ref_.size());
|
|
1150
|
+
#endif
|
|
1151
|
+
size.add_uint32(2, static_cast<uint32_t>(this->entity_category));
|
|
1152
|
+
size.add_float(2, this->visual_current_temperature_step);
|
|
1153
|
+
size.add_bool(2, this->supports_current_humidity);
|
|
1154
|
+
size.add_bool(2, this->supports_target_humidity);
|
|
1155
|
+
size.add_float(2, this->visual_min_humidity);
|
|
1156
|
+
size.add_float(2, this->visual_max_humidity);
|
|
1157
|
+
#ifdef USE_DEVICES
|
|
1158
|
+
size.add_uint32(2, this->device_id);
|
|
1159
|
+
#endif
|
|
1219
1160
|
}
|
|
1220
1161
|
void ClimateStateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
1221
1162
|
buffer.encode_fixed32(1, this->key);
|
|
@@ -1224,299 +1165,300 @@ void ClimateStateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
1224
1165
|
buffer.encode_float(4, this->target_temperature);
|
|
1225
1166
|
buffer.encode_float(5, this->target_temperature_low);
|
|
1226
1167
|
buffer.encode_float(6, this->target_temperature_high);
|
|
1227
|
-
buffer.encode_bool(7, this->unused_legacy_away);
|
|
1228
1168
|
buffer.encode_uint32(8, static_cast<uint32_t>(this->action));
|
|
1229
1169
|
buffer.encode_uint32(9, static_cast<uint32_t>(this->fan_mode));
|
|
1230
1170
|
buffer.encode_uint32(10, static_cast<uint32_t>(this->swing_mode));
|
|
1231
|
-
buffer.encode_string(11, this->
|
|
1171
|
+
buffer.encode_string(11, this->custom_fan_mode_ref_);
|
|
1232
1172
|
buffer.encode_uint32(12, static_cast<uint32_t>(this->preset));
|
|
1233
|
-
buffer.encode_string(13, this->
|
|
1173
|
+
buffer.encode_string(13, this->custom_preset_ref_);
|
|
1234
1174
|
buffer.encode_float(14, this->current_humidity);
|
|
1235
1175
|
buffer.encode_float(15, this->target_humidity);
|
|
1176
|
+
#ifdef USE_DEVICES
|
|
1236
1177
|
buffer.encode_uint32(16, this->device_id);
|
|
1178
|
+
#endif
|
|
1237
1179
|
}
|
|
1238
|
-
void ClimateStateResponse::calculate_size(
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1180
|
+
void ClimateStateResponse::calculate_size(ProtoSize &size) const {
|
|
1181
|
+
size.add_fixed32(1, this->key);
|
|
1182
|
+
size.add_uint32(1, static_cast<uint32_t>(this->mode));
|
|
1183
|
+
size.add_float(1, this->current_temperature);
|
|
1184
|
+
size.add_float(1, this->target_temperature);
|
|
1185
|
+
size.add_float(1, this->target_temperature_low);
|
|
1186
|
+
size.add_float(1, this->target_temperature_high);
|
|
1187
|
+
size.add_uint32(1, static_cast<uint32_t>(this->action));
|
|
1188
|
+
size.add_uint32(1, static_cast<uint32_t>(this->fan_mode));
|
|
1189
|
+
size.add_uint32(1, static_cast<uint32_t>(this->swing_mode));
|
|
1190
|
+
size.add_length(1, this->custom_fan_mode_ref_.size());
|
|
1191
|
+
size.add_uint32(1, static_cast<uint32_t>(this->preset));
|
|
1192
|
+
size.add_length(1, this->custom_preset_ref_.size());
|
|
1193
|
+
size.add_float(1, this->current_humidity);
|
|
1194
|
+
size.add_float(1, this->target_humidity);
|
|
1195
|
+
#ifdef USE_DEVICES
|
|
1196
|
+
size.add_uint32(2, this->device_id);
|
|
1197
|
+
#endif
|
|
1255
1198
|
}
|
|
1256
1199
|
bool ClimateCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
|
1257
1200
|
switch (field_id) {
|
|
1258
|
-
case 2:
|
|
1201
|
+
case 2:
|
|
1259
1202
|
this->has_mode = value.as_bool();
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
case 3: {
|
|
1203
|
+
break;
|
|
1204
|
+
case 3:
|
|
1263
1205
|
this->mode = static_cast<enums::ClimateMode>(value.as_uint32());
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
case 4: {
|
|
1206
|
+
break;
|
|
1207
|
+
case 4:
|
|
1267
1208
|
this->has_target_temperature = value.as_bool();
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
case 6: {
|
|
1209
|
+
break;
|
|
1210
|
+
case 6:
|
|
1271
1211
|
this->has_target_temperature_low = value.as_bool();
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
case 8: {
|
|
1212
|
+
break;
|
|
1213
|
+
case 8:
|
|
1275
1214
|
this->has_target_temperature_high = value.as_bool();
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
case 10: {
|
|
1279
|
-
this->unused_has_legacy_away = value.as_bool();
|
|
1280
|
-
return true;
|
|
1281
|
-
}
|
|
1282
|
-
case 11: {
|
|
1283
|
-
this->unused_legacy_away = value.as_bool();
|
|
1284
|
-
return true;
|
|
1285
|
-
}
|
|
1286
|
-
case 12: {
|
|
1215
|
+
break;
|
|
1216
|
+
case 12:
|
|
1287
1217
|
this->has_fan_mode = value.as_bool();
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
case 13: {
|
|
1218
|
+
break;
|
|
1219
|
+
case 13:
|
|
1291
1220
|
this->fan_mode = static_cast<enums::ClimateFanMode>(value.as_uint32());
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
case 14: {
|
|
1221
|
+
break;
|
|
1222
|
+
case 14:
|
|
1295
1223
|
this->has_swing_mode = value.as_bool();
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
case 15: {
|
|
1224
|
+
break;
|
|
1225
|
+
case 15:
|
|
1299
1226
|
this->swing_mode = static_cast<enums::ClimateSwingMode>(value.as_uint32());
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
case 16: {
|
|
1227
|
+
break;
|
|
1228
|
+
case 16:
|
|
1303
1229
|
this->has_custom_fan_mode = value.as_bool();
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
case 18: {
|
|
1230
|
+
break;
|
|
1231
|
+
case 18:
|
|
1307
1232
|
this->has_preset = value.as_bool();
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
case 19: {
|
|
1233
|
+
break;
|
|
1234
|
+
case 19:
|
|
1311
1235
|
this->preset = static_cast<enums::ClimatePreset>(value.as_uint32());
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
case 20: {
|
|
1236
|
+
break;
|
|
1237
|
+
case 20:
|
|
1315
1238
|
this->has_custom_preset = value.as_bool();
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
case 22: {
|
|
1239
|
+
break;
|
|
1240
|
+
case 22:
|
|
1319
1241
|
this->has_target_humidity = value.as_bool();
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
case 24:
|
|
1242
|
+
break;
|
|
1243
|
+
#ifdef USE_DEVICES
|
|
1244
|
+
case 24:
|
|
1323
1245
|
this->device_id = value.as_uint32();
|
|
1324
|
-
|
|
1325
|
-
|
|
1246
|
+
break;
|
|
1247
|
+
#endif
|
|
1326
1248
|
default:
|
|
1327
1249
|
return false;
|
|
1328
1250
|
}
|
|
1251
|
+
return true;
|
|
1329
1252
|
}
|
|
1330
1253
|
bool ClimateCommandRequest::decode_length(uint32_t field_id, ProtoLengthDelimited value) {
|
|
1331
1254
|
switch (field_id) {
|
|
1332
|
-
case 17:
|
|
1255
|
+
case 17:
|
|
1333
1256
|
this->custom_fan_mode = value.as_string();
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
case 21: {
|
|
1257
|
+
break;
|
|
1258
|
+
case 21:
|
|
1337
1259
|
this->custom_preset = value.as_string();
|
|
1338
|
-
|
|
1339
|
-
}
|
|
1260
|
+
break;
|
|
1340
1261
|
default:
|
|
1341
1262
|
return false;
|
|
1342
1263
|
}
|
|
1264
|
+
return true;
|
|
1343
1265
|
}
|
|
1344
1266
|
bool ClimateCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
|
|
1345
1267
|
switch (field_id) {
|
|
1346
|
-
case 1:
|
|
1268
|
+
case 1:
|
|
1347
1269
|
this->key = value.as_fixed32();
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
case 5: {
|
|
1270
|
+
break;
|
|
1271
|
+
case 5:
|
|
1351
1272
|
this->target_temperature = value.as_float();
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
case 7: {
|
|
1273
|
+
break;
|
|
1274
|
+
case 7:
|
|
1355
1275
|
this->target_temperature_low = value.as_float();
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
case 9: {
|
|
1276
|
+
break;
|
|
1277
|
+
case 9:
|
|
1359
1278
|
this->target_temperature_high = value.as_float();
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
case 23: {
|
|
1279
|
+
break;
|
|
1280
|
+
case 23:
|
|
1363
1281
|
this->target_humidity = value.as_float();
|
|
1364
|
-
|
|
1365
|
-
}
|
|
1282
|
+
break;
|
|
1366
1283
|
default:
|
|
1367
1284
|
return false;
|
|
1368
1285
|
}
|
|
1286
|
+
return true;
|
|
1369
1287
|
}
|
|
1370
1288
|
#endif
|
|
1371
1289
|
#ifdef USE_NUMBER
|
|
1372
1290
|
void ListEntitiesNumberResponse::encode(ProtoWriteBuffer buffer) const {
|
|
1373
|
-
buffer.encode_string(1, this->
|
|
1291
|
+
buffer.encode_string(1, this->object_id_ref_);
|
|
1374
1292
|
buffer.encode_fixed32(2, this->key);
|
|
1375
|
-
buffer.encode_string(3, this->
|
|
1376
|
-
|
|
1377
|
-
buffer.encode_string(5, this->
|
|
1293
|
+
buffer.encode_string(3, this->name_ref_);
|
|
1294
|
+
#ifdef USE_ENTITY_ICON
|
|
1295
|
+
buffer.encode_string(5, this->icon_ref_);
|
|
1296
|
+
#endif
|
|
1378
1297
|
buffer.encode_float(6, this->min_value);
|
|
1379
1298
|
buffer.encode_float(7, this->max_value);
|
|
1380
1299
|
buffer.encode_float(8, this->step);
|
|
1381
1300
|
buffer.encode_bool(9, this->disabled_by_default);
|
|
1382
1301
|
buffer.encode_uint32(10, static_cast<uint32_t>(this->entity_category));
|
|
1383
|
-
buffer.encode_string(11, this->
|
|
1302
|
+
buffer.encode_string(11, this->unit_of_measurement_ref_);
|
|
1384
1303
|
buffer.encode_uint32(12, static_cast<uint32_t>(this->mode));
|
|
1385
|
-
buffer.encode_string(13, this->
|
|
1304
|
+
buffer.encode_string(13, this->device_class_ref_);
|
|
1305
|
+
#ifdef USE_DEVICES
|
|
1386
1306
|
buffer.encode_uint32(14, this->device_id);
|
|
1307
|
+
#endif
|
|
1387
1308
|
}
|
|
1388
|
-
void ListEntitiesNumberResponse::calculate_size(
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1309
|
+
void ListEntitiesNumberResponse::calculate_size(ProtoSize &size) const {
|
|
1310
|
+
size.add_length(1, this->object_id_ref_.size());
|
|
1311
|
+
size.add_fixed32(1, this->key);
|
|
1312
|
+
size.add_length(1, this->name_ref_.size());
|
|
1313
|
+
#ifdef USE_ENTITY_ICON
|
|
1314
|
+
size.add_length(1, this->icon_ref_.size());
|
|
1315
|
+
#endif
|
|
1316
|
+
size.add_float(1, this->min_value);
|
|
1317
|
+
size.add_float(1, this->max_value);
|
|
1318
|
+
size.add_float(1, this->step);
|
|
1319
|
+
size.add_bool(1, this->disabled_by_default);
|
|
1320
|
+
size.add_uint32(1, static_cast<uint32_t>(this->entity_category));
|
|
1321
|
+
size.add_length(1, this->unit_of_measurement_ref_.size());
|
|
1322
|
+
size.add_uint32(1, static_cast<uint32_t>(this->mode));
|
|
1323
|
+
size.add_length(1, this->device_class_ref_.size());
|
|
1324
|
+
#ifdef USE_DEVICES
|
|
1325
|
+
size.add_uint32(1, this->device_id);
|
|
1326
|
+
#endif
|
|
1403
1327
|
}
|
|
1404
1328
|
void NumberStateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
1405
1329
|
buffer.encode_fixed32(1, this->key);
|
|
1406
1330
|
buffer.encode_float(2, this->state);
|
|
1407
1331
|
buffer.encode_bool(3, this->missing_state);
|
|
1332
|
+
#ifdef USE_DEVICES
|
|
1408
1333
|
buffer.encode_uint32(4, this->device_id);
|
|
1334
|
+
#endif
|
|
1409
1335
|
}
|
|
1410
|
-
void NumberStateResponse::calculate_size(
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1336
|
+
void NumberStateResponse::calculate_size(ProtoSize &size) const {
|
|
1337
|
+
size.add_fixed32(1, this->key);
|
|
1338
|
+
size.add_float(1, this->state);
|
|
1339
|
+
size.add_bool(1, this->missing_state);
|
|
1340
|
+
#ifdef USE_DEVICES
|
|
1341
|
+
size.add_uint32(1, this->device_id);
|
|
1342
|
+
#endif
|
|
1415
1343
|
}
|
|
1416
1344
|
bool NumberCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
|
1417
1345
|
switch (field_id) {
|
|
1418
|
-
|
|
1346
|
+
#ifdef USE_DEVICES
|
|
1347
|
+
case 3:
|
|
1419
1348
|
this->device_id = value.as_uint32();
|
|
1420
|
-
|
|
1421
|
-
|
|
1349
|
+
break;
|
|
1350
|
+
#endif
|
|
1422
1351
|
default:
|
|
1423
1352
|
return false;
|
|
1424
1353
|
}
|
|
1354
|
+
return true;
|
|
1425
1355
|
}
|
|
1426
1356
|
bool NumberCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
|
|
1427
1357
|
switch (field_id) {
|
|
1428
|
-
case 1:
|
|
1358
|
+
case 1:
|
|
1429
1359
|
this->key = value.as_fixed32();
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
case 2: {
|
|
1360
|
+
break;
|
|
1361
|
+
case 2:
|
|
1433
1362
|
this->state = value.as_float();
|
|
1434
|
-
|
|
1435
|
-
}
|
|
1363
|
+
break;
|
|
1436
1364
|
default:
|
|
1437
1365
|
return false;
|
|
1438
1366
|
}
|
|
1367
|
+
return true;
|
|
1439
1368
|
}
|
|
1440
1369
|
#endif
|
|
1441
1370
|
#ifdef USE_SELECT
|
|
1442
1371
|
void ListEntitiesSelectResponse::encode(ProtoWriteBuffer buffer) const {
|
|
1443
|
-
buffer.encode_string(1, this->
|
|
1372
|
+
buffer.encode_string(1, this->object_id_ref_);
|
|
1444
1373
|
buffer.encode_fixed32(2, this->key);
|
|
1445
|
-
buffer.encode_string(3, this->
|
|
1446
|
-
|
|
1447
|
-
buffer.encode_string(5, this->
|
|
1448
|
-
|
|
1374
|
+
buffer.encode_string(3, this->name_ref_);
|
|
1375
|
+
#ifdef USE_ENTITY_ICON
|
|
1376
|
+
buffer.encode_string(5, this->icon_ref_);
|
|
1377
|
+
#endif
|
|
1378
|
+
for (const auto &it : *this->options) {
|
|
1449
1379
|
buffer.encode_string(6, it, true);
|
|
1450
1380
|
}
|
|
1451
1381
|
buffer.encode_bool(7, this->disabled_by_default);
|
|
1452
1382
|
buffer.encode_uint32(8, static_cast<uint32_t>(this->entity_category));
|
|
1383
|
+
#ifdef USE_DEVICES
|
|
1453
1384
|
buffer.encode_uint32(9, this->device_id);
|
|
1385
|
+
#endif
|
|
1454
1386
|
}
|
|
1455
|
-
void ListEntitiesSelectResponse::calculate_size(
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1387
|
+
void ListEntitiesSelectResponse::calculate_size(ProtoSize &size) const {
|
|
1388
|
+
size.add_length(1, this->object_id_ref_.size());
|
|
1389
|
+
size.add_fixed32(1, this->key);
|
|
1390
|
+
size.add_length(1, this->name_ref_.size());
|
|
1391
|
+
#ifdef USE_ENTITY_ICON
|
|
1392
|
+
size.add_length(1, this->icon_ref_.size());
|
|
1393
|
+
#endif
|
|
1394
|
+
if (!this->options->empty()) {
|
|
1395
|
+
for (const auto &it : *this->options) {
|
|
1396
|
+
size.add_length_force(1, it.size());
|
|
1464
1397
|
}
|
|
1465
1398
|
}
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1399
|
+
size.add_bool(1, this->disabled_by_default);
|
|
1400
|
+
size.add_uint32(1, static_cast<uint32_t>(this->entity_category));
|
|
1401
|
+
#ifdef USE_DEVICES
|
|
1402
|
+
size.add_uint32(1, this->device_id);
|
|
1403
|
+
#endif
|
|
1469
1404
|
}
|
|
1470
1405
|
void SelectStateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
1471
1406
|
buffer.encode_fixed32(1, this->key);
|
|
1472
|
-
buffer.encode_string(2, this->
|
|
1407
|
+
buffer.encode_string(2, this->state_ref_);
|
|
1473
1408
|
buffer.encode_bool(3, this->missing_state);
|
|
1409
|
+
#ifdef USE_DEVICES
|
|
1474
1410
|
buffer.encode_uint32(4, this->device_id);
|
|
1411
|
+
#endif
|
|
1475
1412
|
}
|
|
1476
|
-
void SelectStateResponse::calculate_size(
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1413
|
+
void SelectStateResponse::calculate_size(ProtoSize &size) const {
|
|
1414
|
+
size.add_fixed32(1, this->key);
|
|
1415
|
+
size.add_length(1, this->state_ref_.size());
|
|
1416
|
+
size.add_bool(1, this->missing_state);
|
|
1417
|
+
#ifdef USE_DEVICES
|
|
1418
|
+
size.add_uint32(1, this->device_id);
|
|
1419
|
+
#endif
|
|
1481
1420
|
}
|
|
1482
1421
|
bool SelectCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
|
1483
1422
|
switch (field_id) {
|
|
1484
|
-
|
|
1423
|
+
#ifdef USE_DEVICES
|
|
1424
|
+
case 3:
|
|
1485
1425
|
this->device_id = value.as_uint32();
|
|
1486
|
-
|
|
1487
|
-
|
|
1426
|
+
break;
|
|
1427
|
+
#endif
|
|
1488
1428
|
default:
|
|
1489
1429
|
return false;
|
|
1490
1430
|
}
|
|
1431
|
+
return true;
|
|
1491
1432
|
}
|
|
1492
1433
|
bool SelectCommandRequest::decode_length(uint32_t field_id, ProtoLengthDelimited value) {
|
|
1493
1434
|
switch (field_id) {
|
|
1494
|
-
case 2:
|
|
1435
|
+
case 2:
|
|
1495
1436
|
this->state = value.as_string();
|
|
1496
|
-
|
|
1497
|
-
}
|
|
1437
|
+
break;
|
|
1498
1438
|
default:
|
|
1499
1439
|
return false;
|
|
1500
1440
|
}
|
|
1441
|
+
return true;
|
|
1501
1442
|
}
|
|
1502
1443
|
bool SelectCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
|
|
1503
1444
|
switch (field_id) {
|
|
1504
|
-
case 1:
|
|
1445
|
+
case 1:
|
|
1505
1446
|
this->key = value.as_fixed32();
|
|
1506
|
-
|
|
1507
|
-
}
|
|
1447
|
+
break;
|
|
1508
1448
|
default:
|
|
1509
1449
|
return false;
|
|
1510
1450
|
}
|
|
1451
|
+
return true;
|
|
1511
1452
|
}
|
|
1512
1453
|
#endif
|
|
1513
1454
|
#ifdef USE_SIREN
|
|
1514
1455
|
void ListEntitiesSirenResponse::encode(ProtoWriteBuffer buffer) const {
|
|
1515
|
-
buffer.encode_string(1, this->
|
|
1456
|
+
buffer.encode_string(1, this->object_id_ref_);
|
|
1516
1457
|
buffer.encode_fixed32(2, this->key);
|
|
1517
|
-
buffer.encode_string(3, this->
|
|
1518
|
-
|
|
1519
|
-
buffer.encode_string(5, this->
|
|
1458
|
+
buffer.encode_string(3, this->name_ref_);
|
|
1459
|
+
#ifdef USE_ENTITY_ICON
|
|
1460
|
+
buffer.encode_string(5, this->icon_ref_);
|
|
1461
|
+
#endif
|
|
1520
1462
|
buffer.encode_bool(6, this->disabled_by_default);
|
|
1521
1463
|
for (auto &it : this->tones) {
|
|
1522
1464
|
buffer.encode_string(7, it, true);
|
|
@@ -1524,510 +1466,410 @@ void ListEntitiesSirenResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
1524
1466
|
buffer.encode_bool(8, this->supports_duration);
|
|
1525
1467
|
buffer.encode_bool(9, this->supports_volume);
|
|
1526
1468
|
buffer.encode_uint32(10, static_cast<uint32_t>(this->entity_category));
|
|
1469
|
+
#ifdef USE_DEVICES
|
|
1527
1470
|
buffer.encode_uint32(11, this->device_id);
|
|
1471
|
+
#endif
|
|
1528
1472
|
}
|
|
1529
|
-
void ListEntitiesSirenResponse::calculate_size(
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1473
|
+
void ListEntitiesSirenResponse::calculate_size(ProtoSize &size) const {
|
|
1474
|
+
size.add_length(1, this->object_id_ref_.size());
|
|
1475
|
+
size.add_fixed32(1, this->key);
|
|
1476
|
+
size.add_length(1, this->name_ref_.size());
|
|
1477
|
+
#ifdef USE_ENTITY_ICON
|
|
1478
|
+
size.add_length(1, this->icon_ref_.size());
|
|
1479
|
+
#endif
|
|
1480
|
+
size.add_bool(1, this->disabled_by_default);
|
|
1536
1481
|
if (!this->tones.empty()) {
|
|
1537
1482
|
for (const auto &it : this->tones) {
|
|
1538
|
-
|
|
1483
|
+
size.add_length_force(1, it.size());
|
|
1539
1484
|
}
|
|
1540
1485
|
}
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1486
|
+
size.add_bool(1, this->supports_duration);
|
|
1487
|
+
size.add_bool(1, this->supports_volume);
|
|
1488
|
+
size.add_uint32(1, static_cast<uint32_t>(this->entity_category));
|
|
1489
|
+
#ifdef USE_DEVICES
|
|
1490
|
+
size.add_uint32(1, this->device_id);
|
|
1491
|
+
#endif
|
|
1545
1492
|
}
|
|
1546
1493
|
void SirenStateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
1547
1494
|
buffer.encode_fixed32(1, this->key);
|
|
1548
1495
|
buffer.encode_bool(2, this->state);
|
|
1496
|
+
#ifdef USE_DEVICES
|
|
1549
1497
|
buffer.encode_uint32(3, this->device_id);
|
|
1498
|
+
#endif
|
|
1550
1499
|
}
|
|
1551
|
-
void SirenStateResponse::calculate_size(
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1500
|
+
void SirenStateResponse::calculate_size(ProtoSize &size) const {
|
|
1501
|
+
size.add_fixed32(1, this->key);
|
|
1502
|
+
size.add_bool(1, this->state);
|
|
1503
|
+
#ifdef USE_DEVICES
|
|
1504
|
+
size.add_uint32(1, this->device_id);
|
|
1505
|
+
#endif
|
|
1555
1506
|
}
|
|
1556
1507
|
bool SirenCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
|
1557
1508
|
switch (field_id) {
|
|
1558
|
-
case 2:
|
|
1509
|
+
case 2:
|
|
1559
1510
|
this->has_state = value.as_bool();
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
case 3: {
|
|
1511
|
+
break;
|
|
1512
|
+
case 3:
|
|
1563
1513
|
this->state = value.as_bool();
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
case 4: {
|
|
1514
|
+
break;
|
|
1515
|
+
case 4:
|
|
1567
1516
|
this->has_tone = value.as_bool();
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
case 6: {
|
|
1517
|
+
break;
|
|
1518
|
+
case 6:
|
|
1571
1519
|
this->has_duration = value.as_bool();
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
case 7: {
|
|
1520
|
+
break;
|
|
1521
|
+
case 7:
|
|
1575
1522
|
this->duration = value.as_uint32();
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
case 8: {
|
|
1523
|
+
break;
|
|
1524
|
+
case 8:
|
|
1579
1525
|
this->has_volume = value.as_bool();
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
case 10:
|
|
1526
|
+
break;
|
|
1527
|
+
#ifdef USE_DEVICES
|
|
1528
|
+
case 10:
|
|
1583
1529
|
this->device_id = value.as_uint32();
|
|
1584
|
-
|
|
1585
|
-
|
|
1530
|
+
break;
|
|
1531
|
+
#endif
|
|
1586
1532
|
default:
|
|
1587
1533
|
return false;
|
|
1588
1534
|
}
|
|
1535
|
+
return true;
|
|
1589
1536
|
}
|
|
1590
1537
|
bool SirenCommandRequest::decode_length(uint32_t field_id, ProtoLengthDelimited value) {
|
|
1591
1538
|
switch (field_id) {
|
|
1592
|
-
case 5:
|
|
1539
|
+
case 5:
|
|
1593
1540
|
this->tone = value.as_string();
|
|
1594
|
-
|
|
1595
|
-
}
|
|
1541
|
+
break;
|
|
1596
1542
|
default:
|
|
1597
1543
|
return false;
|
|
1598
1544
|
}
|
|
1545
|
+
return true;
|
|
1599
1546
|
}
|
|
1600
1547
|
bool SirenCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
|
|
1601
1548
|
switch (field_id) {
|
|
1602
|
-
case 1:
|
|
1549
|
+
case 1:
|
|
1603
1550
|
this->key = value.as_fixed32();
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
case 9: {
|
|
1551
|
+
break;
|
|
1552
|
+
case 9:
|
|
1607
1553
|
this->volume = value.as_float();
|
|
1608
|
-
|
|
1609
|
-
}
|
|
1554
|
+
break;
|
|
1610
1555
|
default:
|
|
1611
1556
|
return false;
|
|
1612
1557
|
}
|
|
1558
|
+
return true;
|
|
1613
1559
|
}
|
|
1614
1560
|
#endif
|
|
1615
1561
|
#ifdef USE_LOCK
|
|
1616
1562
|
void ListEntitiesLockResponse::encode(ProtoWriteBuffer buffer) const {
|
|
1617
|
-
buffer.encode_string(1, this->
|
|
1563
|
+
buffer.encode_string(1, this->object_id_ref_);
|
|
1618
1564
|
buffer.encode_fixed32(2, this->key);
|
|
1619
|
-
buffer.encode_string(3, this->
|
|
1620
|
-
|
|
1621
|
-
buffer.encode_string(5, this->
|
|
1565
|
+
buffer.encode_string(3, this->name_ref_);
|
|
1566
|
+
#ifdef USE_ENTITY_ICON
|
|
1567
|
+
buffer.encode_string(5, this->icon_ref_);
|
|
1568
|
+
#endif
|
|
1622
1569
|
buffer.encode_bool(6, this->disabled_by_default);
|
|
1623
1570
|
buffer.encode_uint32(7, static_cast<uint32_t>(this->entity_category));
|
|
1624
1571
|
buffer.encode_bool(8, this->assumed_state);
|
|
1625
1572
|
buffer.encode_bool(9, this->supports_open);
|
|
1626
1573
|
buffer.encode_bool(10, this->requires_code);
|
|
1627
|
-
buffer.encode_string(11, this->
|
|
1574
|
+
buffer.encode_string(11, this->code_format_ref_);
|
|
1575
|
+
#ifdef USE_DEVICES
|
|
1628
1576
|
buffer.encode_uint32(12, this->device_id);
|
|
1577
|
+
#endif
|
|
1629
1578
|
}
|
|
1630
|
-
void ListEntitiesLockResponse::calculate_size(
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1579
|
+
void ListEntitiesLockResponse::calculate_size(ProtoSize &size) const {
|
|
1580
|
+
size.add_length(1, this->object_id_ref_.size());
|
|
1581
|
+
size.add_fixed32(1, this->key);
|
|
1582
|
+
size.add_length(1, this->name_ref_.size());
|
|
1583
|
+
#ifdef USE_ENTITY_ICON
|
|
1584
|
+
size.add_length(1, this->icon_ref_.size());
|
|
1585
|
+
#endif
|
|
1586
|
+
size.add_bool(1, this->disabled_by_default);
|
|
1587
|
+
size.add_uint32(1, static_cast<uint32_t>(this->entity_category));
|
|
1588
|
+
size.add_bool(1, this->assumed_state);
|
|
1589
|
+
size.add_bool(1, this->supports_open);
|
|
1590
|
+
size.add_bool(1, this->requires_code);
|
|
1591
|
+
size.add_length(1, this->code_format_ref_.size());
|
|
1592
|
+
#ifdef USE_DEVICES
|
|
1593
|
+
size.add_uint32(1, this->device_id);
|
|
1594
|
+
#endif
|
|
1643
1595
|
}
|
|
1644
1596
|
void LockStateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
1645
1597
|
buffer.encode_fixed32(1, this->key);
|
|
1646
1598
|
buffer.encode_uint32(2, static_cast<uint32_t>(this->state));
|
|
1599
|
+
#ifdef USE_DEVICES
|
|
1647
1600
|
buffer.encode_uint32(3, this->device_id);
|
|
1601
|
+
#endif
|
|
1648
1602
|
}
|
|
1649
|
-
void LockStateResponse::calculate_size(
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1603
|
+
void LockStateResponse::calculate_size(ProtoSize &size) const {
|
|
1604
|
+
size.add_fixed32(1, this->key);
|
|
1605
|
+
size.add_uint32(1, static_cast<uint32_t>(this->state));
|
|
1606
|
+
#ifdef USE_DEVICES
|
|
1607
|
+
size.add_uint32(1, this->device_id);
|
|
1608
|
+
#endif
|
|
1653
1609
|
}
|
|
1654
1610
|
bool LockCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
|
1655
1611
|
switch (field_id) {
|
|
1656
|
-
case 2:
|
|
1612
|
+
case 2:
|
|
1657
1613
|
this->command = static_cast<enums::LockCommand>(value.as_uint32());
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
case 3: {
|
|
1614
|
+
break;
|
|
1615
|
+
case 3:
|
|
1661
1616
|
this->has_code = value.as_bool();
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
case 5:
|
|
1617
|
+
break;
|
|
1618
|
+
#ifdef USE_DEVICES
|
|
1619
|
+
case 5:
|
|
1665
1620
|
this->device_id = value.as_uint32();
|
|
1666
|
-
|
|
1667
|
-
|
|
1621
|
+
break;
|
|
1622
|
+
#endif
|
|
1668
1623
|
default:
|
|
1669
1624
|
return false;
|
|
1670
1625
|
}
|
|
1626
|
+
return true;
|
|
1671
1627
|
}
|
|
1672
1628
|
bool LockCommandRequest::decode_length(uint32_t field_id, ProtoLengthDelimited value) {
|
|
1673
1629
|
switch (field_id) {
|
|
1674
|
-
case 4:
|
|
1630
|
+
case 4:
|
|
1675
1631
|
this->code = value.as_string();
|
|
1676
|
-
|
|
1677
|
-
}
|
|
1632
|
+
break;
|
|
1678
1633
|
default:
|
|
1679
1634
|
return false;
|
|
1680
1635
|
}
|
|
1636
|
+
return true;
|
|
1681
1637
|
}
|
|
1682
1638
|
bool LockCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
|
|
1683
1639
|
switch (field_id) {
|
|
1684
|
-
case 1:
|
|
1640
|
+
case 1:
|
|
1685
1641
|
this->key = value.as_fixed32();
|
|
1686
|
-
|
|
1687
|
-
}
|
|
1642
|
+
break;
|
|
1688
1643
|
default:
|
|
1689
1644
|
return false;
|
|
1690
1645
|
}
|
|
1646
|
+
return true;
|
|
1691
1647
|
}
|
|
1692
1648
|
#endif
|
|
1693
1649
|
#ifdef USE_BUTTON
|
|
1694
1650
|
void ListEntitiesButtonResponse::encode(ProtoWriteBuffer buffer) const {
|
|
1695
|
-
buffer.encode_string(1, this->
|
|
1651
|
+
buffer.encode_string(1, this->object_id_ref_);
|
|
1696
1652
|
buffer.encode_fixed32(2, this->key);
|
|
1697
|
-
buffer.encode_string(3, this->
|
|
1698
|
-
|
|
1699
|
-
buffer.encode_string(5, this->
|
|
1653
|
+
buffer.encode_string(3, this->name_ref_);
|
|
1654
|
+
#ifdef USE_ENTITY_ICON
|
|
1655
|
+
buffer.encode_string(5, this->icon_ref_);
|
|
1656
|
+
#endif
|
|
1700
1657
|
buffer.encode_bool(6, this->disabled_by_default);
|
|
1701
1658
|
buffer.encode_uint32(7, static_cast<uint32_t>(this->entity_category));
|
|
1702
|
-
buffer.encode_string(8, this->
|
|
1659
|
+
buffer.encode_string(8, this->device_class_ref_);
|
|
1660
|
+
#ifdef USE_DEVICES
|
|
1703
1661
|
buffer.encode_uint32(9, this->device_id);
|
|
1662
|
+
#endif
|
|
1704
1663
|
}
|
|
1705
|
-
void ListEntitiesButtonResponse::calculate_size(
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1664
|
+
void ListEntitiesButtonResponse::calculate_size(ProtoSize &size) const {
|
|
1665
|
+
size.add_length(1, this->object_id_ref_.size());
|
|
1666
|
+
size.add_fixed32(1, this->key);
|
|
1667
|
+
size.add_length(1, this->name_ref_.size());
|
|
1668
|
+
#ifdef USE_ENTITY_ICON
|
|
1669
|
+
size.add_length(1, this->icon_ref_.size());
|
|
1670
|
+
#endif
|
|
1671
|
+
size.add_bool(1, this->disabled_by_default);
|
|
1672
|
+
size.add_uint32(1, static_cast<uint32_t>(this->entity_category));
|
|
1673
|
+
size.add_length(1, this->device_class_ref_.size());
|
|
1674
|
+
#ifdef USE_DEVICES
|
|
1675
|
+
size.add_uint32(1, this->device_id);
|
|
1676
|
+
#endif
|
|
1715
1677
|
}
|
|
1716
1678
|
bool ButtonCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
|
1717
1679
|
switch (field_id) {
|
|
1718
|
-
|
|
1680
|
+
#ifdef USE_DEVICES
|
|
1681
|
+
case 2:
|
|
1719
1682
|
this->device_id = value.as_uint32();
|
|
1720
|
-
|
|
1721
|
-
}
|
|
1722
|
-
default:
|
|
1723
|
-
return false;
|
|
1724
|
-
}
|
|
1725
|
-
}
|
|
1726
|
-
bool ButtonCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
|
|
1727
|
-
switch (field_id) {
|
|
1728
|
-
case 1: {
|
|
1729
|
-
this->key = value.as_fixed32();
|
|
1730
|
-
return true;
|
|
1731
|
-
}
|
|
1732
|
-
default:
|
|
1733
|
-
return false;
|
|
1734
|
-
}
|
|
1735
|
-
}
|
|
1683
|
+
break;
|
|
1736
1684
|
#endif
|
|
1737
|
-
#ifdef USE_MEDIA_PLAYER
|
|
1738
|
-
bool MediaPlayerSupportedFormat::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
|
1739
|
-
switch (field_id) {
|
|
1740
|
-
case 2: {
|
|
1741
|
-
this->sample_rate = value.as_uint32();
|
|
1742
|
-
return true;
|
|
1743
|
-
}
|
|
1744
|
-
case 3: {
|
|
1745
|
-
this->num_channels = value.as_uint32();
|
|
1746
|
-
return true;
|
|
1747
|
-
}
|
|
1748
|
-
case 4: {
|
|
1749
|
-
this->purpose = static_cast<enums::MediaPlayerFormatPurpose>(value.as_uint32());
|
|
1750
|
-
return true;
|
|
1751
|
-
}
|
|
1752
|
-
case 5: {
|
|
1753
|
-
this->sample_bytes = value.as_uint32();
|
|
1754
|
-
return true;
|
|
1755
|
-
}
|
|
1756
1685
|
default:
|
|
1757
1686
|
return false;
|
|
1758
1687
|
}
|
|
1688
|
+
return true;
|
|
1759
1689
|
}
|
|
1760
|
-
bool
|
|
1690
|
+
bool ButtonCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
|
|
1761
1691
|
switch (field_id) {
|
|
1762
|
-
case 1:
|
|
1763
|
-
this->
|
|
1764
|
-
|
|
1765
|
-
}
|
|
1692
|
+
case 1:
|
|
1693
|
+
this->key = value.as_fixed32();
|
|
1694
|
+
break;
|
|
1766
1695
|
default:
|
|
1767
1696
|
return false;
|
|
1768
1697
|
}
|
|
1698
|
+
return true;
|
|
1769
1699
|
}
|
|
1700
|
+
#endif
|
|
1701
|
+
#ifdef USE_MEDIA_PLAYER
|
|
1770
1702
|
void MediaPlayerSupportedFormat::encode(ProtoWriteBuffer buffer) const {
|
|
1771
|
-
buffer.encode_string(1, this->
|
|
1703
|
+
buffer.encode_string(1, this->format_ref_);
|
|
1772
1704
|
buffer.encode_uint32(2, this->sample_rate);
|
|
1773
1705
|
buffer.encode_uint32(3, this->num_channels);
|
|
1774
1706
|
buffer.encode_uint32(4, static_cast<uint32_t>(this->purpose));
|
|
1775
1707
|
buffer.encode_uint32(5, this->sample_bytes);
|
|
1776
1708
|
}
|
|
1777
|
-
void MediaPlayerSupportedFormat::calculate_size(
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1709
|
+
void MediaPlayerSupportedFormat::calculate_size(ProtoSize &size) const {
|
|
1710
|
+
size.add_length(1, this->format_ref_.size());
|
|
1711
|
+
size.add_uint32(1, this->sample_rate);
|
|
1712
|
+
size.add_uint32(1, this->num_channels);
|
|
1713
|
+
size.add_uint32(1, static_cast<uint32_t>(this->purpose));
|
|
1714
|
+
size.add_uint32(1, this->sample_bytes);
|
|
1783
1715
|
}
|
|
1784
1716
|
void ListEntitiesMediaPlayerResponse::encode(ProtoWriteBuffer buffer) const {
|
|
1785
|
-
buffer.encode_string(1, this->
|
|
1717
|
+
buffer.encode_string(1, this->object_id_ref_);
|
|
1786
1718
|
buffer.encode_fixed32(2, this->key);
|
|
1787
|
-
buffer.encode_string(3, this->
|
|
1788
|
-
|
|
1789
|
-
buffer.encode_string(5, this->
|
|
1719
|
+
buffer.encode_string(3, this->name_ref_);
|
|
1720
|
+
#ifdef USE_ENTITY_ICON
|
|
1721
|
+
buffer.encode_string(5, this->icon_ref_);
|
|
1722
|
+
#endif
|
|
1790
1723
|
buffer.encode_bool(6, this->disabled_by_default);
|
|
1791
1724
|
buffer.encode_uint32(7, static_cast<uint32_t>(this->entity_category));
|
|
1792
1725
|
buffer.encode_bool(8, this->supports_pause);
|
|
1793
1726
|
for (auto &it : this->supported_formats) {
|
|
1794
1727
|
buffer.encode_message(9, it, true);
|
|
1795
1728
|
}
|
|
1729
|
+
#ifdef USE_DEVICES
|
|
1796
1730
|
buffer.encode_uint32(10, this->device_id);
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1731
|
+
#endif
|
|
1732
|
+
buffer.encode_uint32(11, this->feature_flags);
|
|
1733
|
+
}
|
|
1734
|
+
void ListEntitiesMediaPlayerResponse::calculate_size(ProtoSize &size) const {
|
|
1735
|
+
size.add_length(1, this->object_id_ref_.size());
|
|
1736
|
+
size.add_fixed32(1, this->key);
|
|
1737
|
+
size.add_length(1, this->name_ref_.size());
|
|
1738
|
+
#ifdef USE_ENTITY_ICON
|
|
1739
|
+
size.add_length(1, this->icon_ref_.size());
|
|
1740
|
+
#endif
|
|
1741
|
+
size.add_bool(1, this->disabled_by_default);
|
|
1742
|
+
size.add_uint32(1, static_cast<uint32_t>(this->entity_category));
|
|
1743
|
+
size.add_bool(1, this->supports_pause);
|
|
1744
|
+
size.add_repeated_message(1, this->supported_formats);
|
|
1745
|
+
#ifdef USE_DEVICES
|
|
1746
|
+
size.add_uint32(1, this->device_id);
|
|
1747
|
+
#endif
|
|
1748
|
+
size.add_uint32(1, this->feature_flags);
|
|
1809
1749
|
}
|
|
1810
1750
|
void MediaPlayerStateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
1811
1751
|
buffer.encode_fixed32(1, this->key);
|
|
1812
1752
|
buffer.encode_uint32(2, static_cast<uint32_t>(this->state));
|
|
1813
1753
|
buffer.encode_float(3, this->volume);
|
|
1814
1754
|
buffer.encode_bool(4, this->muted);
|
|
1755
|
+
#ifdef USE_DEVICES
|
|
1815
1756
|
buffer.encode_uint32(5, this->device_id);
|
|
1757
|
+
#endif
|
|
1816
1758
|
}
|
|
1817
|
-
void MediaPlayerStateResponse::calculate_size(
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1759
|
+
void MediaPlayerStateResponse::calculate_size(ProtoSize &size) const {
|
|
1760
|
+
size.add_fixed32(1, this->key);
|
|
1761
|
+
size.add_uint32(1, static_cast<uint32_t>(this->state));
|
|
1762
|
+
size.add_float(1, this->volume);
|
|
1763
|
+
size.add_bool(1, this->muted);
|
|
1764
|
+
#ifdef USE_DEVICES
|
|
1765
|
+
size.add_uint32(1, this->device_id);
|
|
1766
|
+
#endif
|
|
1823
1767
|
}
|
|
1824
1768
|
bool MediaPlayerCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
|
1825
1769
|
switch (field_id) {
|
|
1826
|
-
case 2:
|
|
1770
|
+
case 2:
|
|
1827
1771
|
this->has_command = value.as_bool();
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
case 3: {
|
|
1772
|
+
break;
|
|
1773
|
+
case 3:
|
|
1831
1774
|
this->command = static_cast<enums::MediaPlayerCommand>(value.as_uint32());
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
case 4: {
|
|
1775
|
+
break;
|
|
1776
|
+
case 4:
|
|
1835
1777
|
this->has_volume = value.as_bool();
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
case 6: {
|
|
1778
|
+
break;
|
|
1779
|
+
case 6:
|
|
1839
1780
|
this->has_media_url = value.as_bool();
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
case 8: {
|
|
1781
|
+
break;
|
|
1782
|
+
case 8:
|
|
1843
1783
|
this->has_announcement = value.as_bool();
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
case 9: {
|
|
1784
|
+
break;
|
|
1785
|
+
case 9:
|
|
1847
1786
|
this->announcement = value.as_bool();
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
case 10:
|
|
1787
|
+
break;
|
|
1788
|
+
#ifdef USE_DEVICES
|
|
1789
|
+
case 10:
|
|
1851
1790
|
this->device_id = value.as_uint32();
|
|
1852
|
-
|
|
1853
|
-
|
|
1791
|
+
break;
|
|
1792
|
+
#endif
|
|
1854
1793
|
default:
|
|
1855
1794
|
return false;
|
|
1856
1795
|
}
|
|
1796
|
+
return true;
|
|
1857
1797
|
}
|
|
1858
1798
|
bool MediaPlayerCommandRequest::decode_length(uint32_t field_id, ProtoLengthDelimited value) {
|
|
1859
1799
|
switch (field_id) {
|
|
1860
|
-
case 7:
|
|
1800
|
+
case 7:
|
|
1861
1801
|
this->media_url = value.as_string();
|
|
1862
|
-
|
|
1863
|
-
}
|
|
1802
|
+
break;
|
|
1864
1803
|
default:
|
|
1865
1804
|
return false;
|
|
1866
1805
|
}
|
|
1806
|
+
return true;
|
|
1867
1807
|
}
|
|
1868
1808
|
bool MediaPlayerCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
|
|
1869
1809
|
switch (field_id) {
|
|
1870
|
-
case 1:
|
|
1810
|
+
case 1:
|
|
1871
1811
|
this->key = value.as_fixed32();
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
case 5: {
|
|
1812
|
+
break;
|
|
1813
|
+
case 5:
|
|
1875
1814
|
this->volume = value.as_float();
|
|
1876
|
-
|
|
1877
|
-
}
|
|
1815
|
+
break;
|
|
1878
1816
|
default:
|
|
1879
1817
|
return false;
|
|
1880
1818
|
}
|
|
1819
|
+
return true;
|
|
1881
1820
|
}
|
|
1882
1821
|
#endif
|
|
1883
1822
|
#ifdef USE_BLUETOOTH_PROXY
|
|
1884
1823
|
bool SubscribeBluetoothLEAdvertisementsRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
|
1885
1824
|
switch (field_id) {
|
|
1886
|
-
case 1:
|
|
1825
|
+
case 1:
|
|
1887
1826
|
this->flags = value.as_uint32();
|
|
1888
|
-
|
|
1889
|
-
}
|
|
1890
|
-
default:
|
|
1891
|
-
return false;
|
|
1892
|
-
}
|
|
1893
|
-
}
|
|
1894
|
-
bool BluetoothServiceData::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
|
1895
|
-
switch (field_id) {
|
|
1896
|
-
case 2: {
|
|
1897
|
-
this->legacy_data.push_back(value.as_uint32());
|
|
1898
|
-
return true;
|
|
1899
|
-
}
|
|
1900
|
-
default:
|
|
1901
|
-
return false;
|
|
1902
|
-
}
|
|
1903
|
-
}
|
|
1904
|
-
bool BluetoothServiceData::decode_length(uint32_t field_id, ProtoLengthDelimited value) {
|
|
1905
|
-
switch (field_id) {
|
|
1906
|
-
case 1: {
|
|
1907
|
-
this->uuid = value.as_string();
|
|
1908
|
-
return true;
|
|
1909
|
-
}
|
|
1910
|
-
case 3: {
|
|
1911
|
-
this->data = value.as_string();
|
|
1912
|
-
return true;
|
|
1913
|
-
}
|
|
1914
|
-
default:
|
|
1915
|
-
return false;
|
|
1916
|
-
}
|
|
1917
|
-
}
|
|
1918
|
-
void BluetoothServiceData::encode(ProtoWriteBuffer buffer) const {
|
|
1919
|
-
buffer.encode_string(1, this->uuid);
|
|
1920
|
-
for (auto &it : this->legacy_data) {
|
|
1921
|
-
buffer.encode_uint32(2, it, true);
|
|
1922
|
-
}
|
|
1923
|
-
buffer.encode_bytes(3, reinterpret_cast<const uint8_t *>(this->data.data()), this->data.size());
|
|
1924
|
-
}
|
|
1925
|
-
void BluetoothServiceData::calculate_size(uint32_t &total_size) const {
|
|
1926
|
-
ProtoSize::add_string_field(total_size, 1, this->uuid);
|
|
1927
|
-
if (!this->legacy_data.empty()) {
|
|
1928
|
-
for (const auto &it : this->legacy_data) {
|
|
1929
|
-
ProtoSize::add_uint32_field_repeated(total_size, 1, it);
|
|
1930
|
-
}
|
|
1931
|
-
}
|
|
1932
|
-
ProtoSize::add_string_field(total_size, 1, this->data);
|
|
1933
|
-
}
|
|
1934
|
-
void BluetoothLEAdvertisementResponse::encode(ProtoWriteBuffer buffer) const {
|
|
1935
|
-
buffer.encode_uint64(1, this->address);
|
|
1936
|
-
buffer.encode_bytes(2, reinterpret_cast<const uint8_t *>(this->name.data()), this->name.size());
|
|
1937
|
-
buffer.encode_sint32(3, this->rssi);
|
|
1938
|
-
for (auto &it : this->service_uuids) {
|
|
1939
|
-
buffer.encode_string(4, it, true);
|
|
1940
|
-
}
|
|
1941
|
-
for (auto &it : this->service_data) {
|
|
1942
|
-
buffer.encode_message(5, it, true);
|
|
1943
|
-
}
|
|
1944
|
-
for (auto &it : this->manufacturer_data) {
|
|
1945
|
-
buffer.encode_message(6, it, true);
|
|
1946
|
-
}
|
|
1947
|
-
buffer.encode_uint32(7, this->address_type);
|
|
1948
|
-
}
|
|
1949
|
-
void BluetoothLEAdvertisementResponse::calculate_size(uint32_t &total_size) const {
|
|
1950
|
-
ProtoSize::add_uint64_field(total_size, 1, this->address);
|
|
1951
|
-
ProtoSize::add_string_field(total_size, 1, this->name);
|
|
1952
|
-
ProtoSize::add_sint32_field(total_size, 1, this->rssi);
|
|
1953
|
-
if (!this->service_uuids.empty()) {
|
|
1954
|
-
for (const auto &it : this->service_uuids) {
|
|
1955
|
-
ProtoSize::add_string_field_repeated(total_size, 1, it);
|
|
1956
|
-
}
|
|
1957
|
-
}
|
|
1958
|
-
ProtoSize::add_repeated_message(total_size, 1, this->service_data);
|
|
1959
|
-
ProtoSize::add_repeated_message(total_size, 1, this->manufacturer_data);
|
|
1960
|
-
ProtoSize::add_uint32_field(total_size, 1, this->address_type);
|
|
1961
|
-
}
|
|
1962
|
-
bool BluetoothLERawAdvertisement::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
|
1963
|
-
switch (field_id) {
|
|
1964
|
-
case 1: {
|
|
1965
|
-
this->address = value.as_uint64();
|
|
1966
|
-
return true;
|
|
1967
|
-
}
|
|
1968
|
-
case 2: {
|
|
1969
|
-
this->rssi = value.as_sint32();
|
|
1970
|
-
return true;
|
|
1971
|
-
}
|
|
1972
|
-
case 3: {
|
|
1973
|
-
this->address_type = value.as_uint32();
|
|
1974
|
-
return true;
|
|
1975
|
-
}
|
|
1976
|
-
default:
|
|
1977
|
-
return false;
|
|
1978
|
-
}
|
|
1979
|
-
}
|
|
1980
|
-
bool BluetoothLERawAdvertisement::decode_length(uint32_t field_id, ProtoLengthDelimited value) {
|
|
1981
|
-
switch (field_id) {
|
|
1982
|
-
case 4: {
|
|
1983
|
-
this->data = value.as_string();
|
|
1984
|
-
return true;
|
|
1985
|
-
}
|
|
1827
|
+
break;
|
|
1986
1828
|
default:
|
|
1987
1829
|
return false;
|
|
1988
1830
|
}
|
|
1831
|
+
return true;
|
|
1989
1832
|
}
|
|
1990
1833
|
void BluetoothLERawAdvertisement::encode(ProtoWriteBuffer buffer) const {
|
|
1991
1834
|
buffer.encode_uint64(1, this->address);
|
|
1992
1835
|
buffer.encode_sint32(2, this->rssi);
|
|
1993
1836
|
buffer.encode_uint32(3, this->address_type);
|
|
1994
|
-
buffer.encode_bytes(4,
|
|
1837
|
+
buffer.encode_bytes(4, this->data, this->data_len);
|
|
1995
1838
|
}
|
|
1996
|
-
void BluetoothLERawAdvertisement::calculate_size(
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
1839
|
+
void BluetoothLERawAdvertisement::calculate_size(ProtoSize &size) const {
|
|
1840
|
+
size.add_uint64(1, this->address);
|
|
1841
|
+
size.add_sint32(1, this->rssi);
|
|
1842
|
+
size.add_uint32(1, this->address_type);
|
|
1843
|
+
size.add_length(1, this->data_len);
|
|
2001
1844
|
}
|
|
2002
1845
|
void BluetoothLERawAdvertisementsResponse::encode(ProtoWriteBuffer buffer) const {
|
|
2003
|
-
for (
|
|
2004
|
-
buffer.encode_message(1,
|
|
1846
|
+
for (uint16_t i = 0; i < this->advertisements_len; i++) {
|
|
1847
|
+
buffer.encode_message(1, this->advertisements[i], true);
|
|
2005
1848
|
}
|
|
2006
1849
|
}
|
|
2007
|
-
void BluetoothLERawAdvertisementsResponse::calculate_size(
|
|
2008
|
-
|
|
1850
|
+
void BluetoothLERawAdvertisementsResponse::calculate_size(ProtoSize &size) const {
|
|
1851
|
+
for (uint16_t i = 0; i < this->advertisements_len; i++) {
|
|
1852
|
+
size.add_message_object_force(1, this->advertisements[i]);
|
|
1853
|
+
}
|
|
2009
1854
|
}
|
|
2010
1855
|
bool BluetoothDeviceRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
|
2011
1856
|
switch (field_id) {
|
|
2012
|
-
case 1:
|
|
1857
|
+
case 1:
|
|
2013
1858
|
this->address = value.as_uint64();
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
case 2: {
|
|
1859
|
+
break;
|
|
1860
|
+
case 2:
|
|
2017
1861
|
this->request_type = static_cast<enums::BluetoothDeviceRequestType>(value.as_uint32());
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
case 3: {
|
|
1862
|
+
break;
|
|
1863
|
+
case 3:
|
|
2021
1864
|
this->has_address_type = value.as_bool();
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
case 4: {
|
|
1865
|
+
break;
|
|
1866
|
+
case 4:
|
|
2025
1867
|
this->address_type = value.as_uint32();
|
|
2026
|
-
|
|
2027
|
-
}
|
|
1868
|
+
break;
|
|
2028
1869
|
default:
|
|
2029
1870
|
return false;
|
|
2030
1871
|
}
|
|
1872
|
+
return true;
|
|
2031
1873
|
}
|
|
2032
1874
|
void BluetoothDeviceConnectionResponse::encode(ProtoWriteBuffer buffer) const {
|
|
2033
1875
|
buffer.encode_uint64(1, this->address);
|
|
@@ -2035,141 +1877,79 @@ void BluetoothDeviceConnectionResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
2035
1877
|
buffer.encode_uint32(3, this->mtu);
|
|
2036
1878
|
buffer.encode_int32(4, this->error);
|
|
2037
1879
|
}
|
|
2038
|
-
void BluetoothDeviceConnectionResponse::calculate_size(
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
1880
|
+
void BluetoothDeviceConnectionResponse::calculate_size(ProtoSize &size) const {
|
|
1881
|
+
size.add_uint64(1, this->address);
|
|
1882
|
+
size.add_bool(1, this->connected);
|
|
1883
|
+
size.add_uint32(1, this->mtu);
|
|
1884
|
+
size.add_int32(1, this->error);
|
|
2043
1885
|
}
|
|
2044
1886
|
bool BluetoothGATTGetServicesRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
|
2045
1887
|
switch (field_id) {
|
|
2046
|
-
case 1:
|
|
1888
|
+
case 1:
|
|
2047
1889
|
this->address = value.as_uint64();
|
|
2048
|
-
|
|
2049
|
-
}
|
|
2050
|
-
default:
|
|
2051
|
-
return false;
|
|
2052
|
-
}
|
|
2053
|
-
}
|
|
2054
|
-
bool BluetoothGATTDescriptor::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
|
2055
|
-
switch (field_id) {
|
|
2056
|
-
case 1: {
|
|
2057
|
-
this->uuid.push_back(value.as_uint64());
|
|
2058
|
-
return true;
|
|
2059
|
-
}
|
|
2060
|
-
case 2: {
|
|
2061
|
-
this->handle = value.as_uint32();
|
|
2062
|
-
return true;
|
|
2063
|
-
}
|
|
1890
|
+
break;
|
|
2064
1891
|
default:
|
|
2065
1892
|
return false;
|
|
2066
1893
|
}
|
|
1894
|
+
return true;
|
|
2067
1895
|
}
|
|
2068
1896
|
void BluetoothGATTDescriptor::encode(ProtoWriteBuffer buffer) const {
|
|
2069
|
-
|
|
2070
|
-
buffer.encode_uint64(1,
|
|
1897
|
+
if (this->uuid[0] != 0 || this->uuid[1] != 0) {
|
|
1898
|
+
buffer.encode_uint64(1, this->uuid[0], true);
|
|
1899
|
+
buffer.encode_uint64(1, this->uuid[1], true);
|
|
2071
1900
|
}
|
|
2072
1901
|
buffer.encode_uint32(2, this->handle);
|
|
1902
|
+
buffer.encode_uint32(3, this->short_uuid);
|
|
2073
1903
|
}
|
|
2074
|
-
void BluetoothGATTDescriptor::calculate_size(
|
|
2075
|
-
if (
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
}
|
|
2079
|
-
}
|
|
2080
|
-
ProtoSize::add_uint32_field(total_size, 1, this->handle);
|
|
2081
|
-
}
|
|
2082
|
-
bool BluetoothGATTCharacteristic::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
|
2083
|
-
switch (field_id) {
|
|
2084
|
-
case 1: {
|
|
2085
|
-
this->uuid.push_back(value.as_uint64());
|
|
2086
|
-
return true;
|
|
2087
|
-
}
|
|
2088
|
-
case 2: {
|
|
2089
|
-
this->handle = value.as_uint32();
|
|
2090
|
-
return true;
|
|
2091
|
-
}
|
|
2092
|
-
case 3: {
|
|
2093
|
-
this->properties = value.as_uint32();
|
|
2094
|
-
return true;
|
|
2095
|
-
}
|
|
2096
|
-
default:
|
|
2097
|
-
return false;
|
|
2098
|
-
}
|
|
2099
|
-
}
|
|
2100
|
-
bool BluetoothGATTCharacteristic::decode_length(uint32_t field_id, ProtoLengthDelimited value) {
|
|
2101
|
-
switch (field_id) {
|
|
2102
|
-
case 4: {
|
|
2103
|
-
this->descriptors.emplace_back();
|
|
2104
|
-
value.decode_to_message(this->descriptors.back());
|
|
2105
|
-
return true;
|
|
2106
|
-
}
|
|
2107
|
-
default:
|
|
2108
|
-
return false;
|
|
1904
|
+
void BluetoothGATTDescriptor::calculate_size(ProtoSize &size) const {
|
|
1905
|
+
if (this->uuid[0] != 0 || this->uuid[1] != 0) {
|
|
1906
|
+
size.add_uint64_force(1, this->uuid[0]);
|
|
1907
|
+
size.add_uint64_force(1, this->uuid[1]);
|
|
2109
1908
|
}
|
|
1909
|
+
size.add_uint32(1, this->handle);
|
|
1910
|
+
size.add_uint32(1, this->short_uuid);
|
|
2110
1911
|
}
|
|
2111
1912
|
void BluetoothGATTCharacteristic::encode(ProtoWriteBuffer buffer) const {
|
|
2112
|
-
|
|
2113
|
-
buffer.encode_uint64(1,
|
|
1913
|
+
if (this->uuid[0] != 0 || this->uuid[1] != 0) {
|
|
1914
|
+
buffer.encode_uint64(1, this->uuid[0], true);
|
|
1915
|
+
buffer.encode_uint64(1, this->uuid[1], true);
|
|
2114
1916
|
}
|
|
2115
1917
|
buffer.encode_uint32(2, this->handle);
|
|
2116
1918
|
buffer.encode_uint32(3, this->properties);
|
|
2117
1919
|
for (auto &it : this->descriptors) {
|
|
2118
1920
|
buffer.encode_message(4, it, true);
|
|
2119
1921
|
}
|
|
1922
|
+
buffer.encode_uint32(5, this->short_uuid);
|
|
2120
1923
|
}
|
|
2121
|
-
void BluetoothGATTCharacteristic::calculate_size(
|
|
2122
|
-
if (
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
}
|
|
2126
|
-
}
|
|
2127
|
-
ProtoSize::add_uint32_field(total_size, 1, this->handle);
|
|
2128
|
-
ProtoSize::add_uint32_field(total_size, 1, this->properties);
|
|
2129
|
-
ProtoSize::add_repeated_message(total_size, 1, this->descriptors);
|
|
2130
|
-
}
|
|
2131
|
-
bool BluetoothGATTService::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
|
2132
|
-
switch (field_id) {
|
|
2133
|
-
case 1: {
|
|
2134
|
-
this->uuid.push_back(value.as_uint64());
|
|
2135
|
-
return true;
|
|
2136
|
-
}
|
|
2137
|
-
case 2: {
|
|
2138
|
-
this->handle = value.as_uint32();
|
|
2139
|
-
return true;
|
|
2140
|
-
}
|
|
2141
|
-
default:
|
|
2142
|
-
return false;
|
|
2143
|
-
}
|
|
2144
|
-
}
|
|
2145
|
-
bool BluetoothGATTService::decode_length(uint32_t field_id, ProtoLengthDelimited value) {
|
|
2146
|
-
switch (field_id) {
|
|
2147
|
-
case 3: {
|
|
2148
|
-
this->characteristics.emplace_back();
|
|
2149
|
-
value.decode_to_message(this->characteristics.back());
|
|
2150
|
-
return true;
|
|
2151
|
-
}
|
|
2152
|
-
default:
|
|
2153
|
-
return false;
|
|
1924
|
+
void BluetoothGATTCharacteristic::calculate_size(ProtoSize &size) const {
|
|
1925
|
+
if (this->uuid[0] != 0 || this->uuid[1] != 0) {
|
|
1926
|
+
size.add_uint64_force(1, this->uuid[0]);
|
|
1927
|
+
size.add_uint64_force(1, this->uuid[1]);
|
|
2154
1928
|
}
|
|
1929
|
+
size.add_uint32(1, this->handle);
|
|
1930
|
+
size.add_uint32(1, this->properties);
|
|
1931
|
+
size.add_repeated_message(1, this->descriptors);
|
|
1932
|
+
size.add_uint32(1, this->short_uuid);
|
|
2155
1933
|
}
|
|
2156
1934
|
void BluetoothGATTService::encode(ProtoWriteBuffer buffer) const {
|
|
2157
|
-
|
|
2158
|
-
buffer.encode_uint64(1,
|
|
1935
|
+
if (this->uuid[0] != 0 || this->uuid[1] != 0) {
|
|
1936
|
+
buffer.encode_uint64(1, this->uuid[0], true);
|
|
1937
|
+
buffer.encode_uint64(1, this->uuid[1], true);
|
|
2159
1938
|
}
|
|
2160
1939
|
buffer.encode_uint32(2, this->handle);
|
|
2161
1940
|
for (auto &it : this->characteristics) {
|
|
2162
1941
|
buffer.encode_message(3, it, true);
|
|
2163
1942
|
}
|
|
1943
|
+
buffer.encode_uint32(4, this->short_uuid);
|
|
2164
1944
|
}
|
|
2165
|
-
void BluetoothGATTService::calculate_size(
|
|
2166
|
-
if (
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
}
|
|
1945
|
+
void BluetoothGATTService::calculate_size(ProtoSize &size) const {
|
|
1946
|
+
if (this->uuid[0] != 0 || this->uuid[1] != 0) {
|
|
1947
|
+
size.add_uint64_force(1, this->uuid[0]);
|
|
1948
|
+
size.add_uint64_force(1, this->uuid[1]);
|
|
2170
1949
|
}
|
|
2171
|
-
|
|
2172
|
-
|
|
1950
|
+
size.add_uint32(1, this->handle);
|
|
1951
|
+
size.add_repeated_message(1, this->characteristics);
|
|
1952
|
+
size.add_uint32(1, this->short_uuid);
|
|
2173
1953
|
}
|
|
2174
1954
|
void BluetoothGATTGetServicesResponse::encode(ProtoWriteBuffer buffer) const {
|
|
2175
1955
|
buffer.encode_uint64(1, this->address);
|
|
@@ -2177,147 +1957,140 @@ void BluetoothGATTGetServicesResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
2177
1957
|
buffer.encode_message(2, it, true);
|
|
2178
1958
|
}
|
|
2179
1959
|
}
|
|
2180
|
-
void BluetoothGATTGetServicesResponse::calculate_size(
|
|
2181
|
-
|
|
2182
|
-
|
|
1960
|
+
void BluetoothGATTGetServicesResponse::calculate_size(ProtoSize &size) const {
|
|
1961
|
+
size.add_uint64(1, this->address);
|
|
1962
|
+
size.add_repeated_message(1, this->services);
|
|
2183
1963
|
}
|
|
2184
1964
|
void BluetoothGATTGetServicesDoneResponse::encode(ProtoWriteBuffer buffer) const {
|
|
2185
1965
|
buffer.encode_uint64(1, this->address);
|
|
2186
1966
|
}
|
|
2187
|
-
void BluetoothGATTGetServicesDoneResponse::calculate_size(
|
|
2188
|
-
ProtoSize::add_uint64_field(total_size, 1, this->address);
|
|
2189
|
-
}
|
|
1967
|
+
void BluetoothGATTGetServicesDoneResponse::calculate_size(ProtoSize &size) const { size.add_uint64(1, this->address); }
|
|
2190
1968
|
bool BluetoothGATTReadRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
|
2191
1969
|
switch (field_id) {
|
|
2192
|
-
case 1:
|
|
1970
|
+
case 1:
|
|
2193
1971
|
this->address = value.as_uint64();
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
case 2: {
|
|
1972
|
+
break;
|
|
1973
|
+
case 2:
|
|
2197
1974
|
this->handle = value.as_uint32();
|
|
2198
|
-
|
|
2199
|
-
}
|
|
1975
|
+
break;
|
|
2200
1976
|
default:
|
|
2201
1977
|
return false;
|
|
2202
1978
|
}
|
|
1979
|
+
return true;
|
|
2203
1980
|
}
|
|
2204
1981
|
void BluetoothGATTReadResponse::encode(ProtoWriteBuffer buffer) const {
|
|
2205
1982
|
buffer.encode_uint64(1, this->address);
|
|
2206
1983
|
buffer.encode_uint32(2, this->handle);
|
|
2207
|
-
buffer.encode_bytes(3,
|
|
1984
|
+
buffer.encode_bytes(3, this->data_ptr_, this->data_len_);
|
|
2208
1985
|
}
|
|
2209
|
-
void BluetoothGATTReadResponse::calculate_size(
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
1986
|
+
void BluetoothGATTReadResponse::calculate_size(ProtoSize &size) const {
|
|
1987
|
+
size.add_uint64(1, this->address);
|
|
1988
|
+
size.add_uint32(1, this->handle);
|
|
1989
|
+
size.add_length(1, this->data_len_);
|
|
2213
1990
|
}
|
|
2214
1991
|
bool BluetoothGATTWriteRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
|
2215
1992
|
switch (field_id) {
|
|
2216
|
-
case 1:
|
|
1993
|
+
case 1:
|
|
2217
1994
|
this->address = value.as_uint64();
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
case 2: {
|
|
1995
|
+
break;
|
|
1996
|
+
case 2:
|
|
2221
1997
|
this->handle = value.as_uint32();
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
case 3: {
|
|
1998
|
+
break;
|
|
1999
|
+
case 3:
|
|
2225
2000
|
this->response = value.as_bool();
|
|
2226
|
-
|
|
2227
|
-
}
|
|
2001
|
+
break;
|
|
2228
2002
|
default:
|
|
2229
2003
|
return false;
|
|
2230
2004
|
}
|
|
2005
|
+
return true;
|
|
2231
2006
|
}
|
|
2232
2007
|
bool BluetoothGATTWriteRequest::decode_length(uint32_t field_id, ProtoLengthDelimited value) {
|
|
2233
2008
|
switch (field_id) {
|
|
2234
|
-
case 4:
|
|
2009
|
+
case 4:
|
|
2235
2010
|
this->data = value.as_string();
|
|
2236
|
-
|
|
2237
|
-
}
|
|
2011
|
+
break;
|
|
2238
2012
|
default:
|
|
2239
2013
|
return false;
|
|
2240
2014
|
}
|
|
2015
|
+
return true;
|
|
2241
2016
|
}
|
|
2242
2017
|
bool BluetoothGATTReadDescriptorRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
|
2243
2018
|
switch (field_id) {
|
|
2244
|
-
case 1:
|
|
2019
|
+
case 1:
|
|
2245
2020
|
this->address = value.as_uint64();
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
case 2: {
|
|
2021
|
+
break;
|
|
2022
|
+
case 2:
|
|
2249
2023
|
this->handle = value.as_uint32();
|
|
2250
|
-
|
|
2251
|
-
}
|
|
2024
|
+
break;
|
|
2252
2025
|
default:
|
|
2253
2026
|
return false;
|
|
2254
2027
|
}
|
|
2028
|
+
return true;
|
|
2255
2029
|
}
|
|
2256
2030
|
bool BluetoothGATTWriteDescriptorRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
|
2257
2031
|
switch (field_id) {
|
|
2258
|
-
case 1:
|
|
2032
|
+
case 1:
|
|
2259
2033
|
this->address = value.as_uint64();
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
case 2: {
|
|
2034
|
+
break;
|
|
2035
|
+
case 2:
|
|
2263
2036
|
this->handle = value.as_uint32();
|
|
2264
|
-
|
|
2265
|
-
}
|
|
2037
|
+
break;
|
|
2266
2038
|
default:
|
|
2267
2039
|
return false;
|
|
2268
2040
|
}
|
|
2041
|
+
return true;
|
|
2269
2042
|
}
|
|
2270
2043
|
bool BluetoothGATTWriteDescriptorRequest::decode_length(uint32_t field_id, ProtoLengthDelimited value) {
|
|
2271
2044
|
switch (field_id) {
|
|
2272
|
-
case 3:
|
|
2045
|
+
case 3:
|
|
2273
2046
|
this->data = value.as_string();
|
|
2274
|
-
|
|
2275
|
-
}
|
|
2047
|
+
break;
|
|
2276
2048
|
default:
|
|
2277
2049
|
return false;
|
|
2278
2050
|
}
|
|
2051
|
+
return true;
|
|
2279
2052
|
}
|
|
2280
2053
|
bool BluetoothGATTNotifyRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
|
2281
2054
|
switch (field_id) {
|
|
2282
|
-
case 1:
|
|
2055
|
+
case 1:
|
|
2283
2056
|
this->address = value.as_uint64();
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
case 2: {
|
|
2057
|
+
break;
|
|
2058
|
+
case 2:
|
|
2287
2059
|
this->handle = value.as_uint32();
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
case 3: {
|
|
2060
|
+
break;
|
|
2061
|
+
case 3:
|
|
2291
2062
|
this->enable = value.as_bool();
|
|
2292
|
-
|
|
2293
|
-
}
|
|
2063
|
+
break;
|
|
2294
2064
|
default:
|
|
2295
2065
|
return false;
|
|
2296
2066
|
}
|
|
2067
|
+
return true;
|
|
2297
2068
|
}
|
|
2298
2069
|
void BluetoothGATTNotifyDataResponse::encode(ProtoWriteBuffer buffer) const {
|
|
2299
2070
|
buffer.encode_uint64(1, this->address);
|
|
2300
2071
|
buffer.encode_uint32(2, this->handle);
|
|
2301
|
-
buffer.encode_bytes(3,
|
|
2072
|
+
buffer.encode_bytes(3, this->data_ptr_, this->data_len_);
|
|
2302
2073
|
}
|
|
2303
|
-
void BluetoothGATTNotifyDataResponse::calculate_size(
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2074
|
+
void BluetoothGATTNotifyDataResponse::calculate_size(ProtoSize &size) const {
|
|
2075
|
+
size.add_uint64(1, this->address);
|
|
2076
|
+
size.add_uint32(1, this->handle);
|
|
2077
|
+
size.add_length(1, this->data_len_);
|
|
2307
2078
|
}
|
|
2308
2079
|
void BluetoothConnectionsFreeResponse::encode(ProtoWriteBuffer buffer) const {
|
|
2309
2080
|
buffer.encode_uint32(1, this->free);
|
|
2310
2081
|
buffer.encode_uint32(2, this->limit);
|
|
2311
|
-
for (auto &it : this->allocated) {
|
|
2312
|
-
|
|
2082
|
+
for (const auto &it : this->allocated) {
|
|
2083
|
+
if (it != 0) {
|
|
2084
|
+
buffer.encode_uint64(3, it, true);
|
|
2085
|
+
}
|
|
2313
2086
|
}
|
|
2314
2087
|
}
|
|
2315
|
-
void BluetoothConnectionsFreeResponse::calculate_size(
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2088
|
+
void BluetoothConnectionsFreeResponse::calculate_size(ProtoSize &size) const {
|
|
2089
|
+
size.add_uint32(1, this->free);
|
|
2090
|
+
size.add_uint32(1, this->limit);
|
|
2091
|
+
for (const auto &it : this->allocated) {
|
|
2092
|
+
if (it != 0) {
|
|
2093
|
+
size.add_uint64_force(1, it);
|
|
2321
2094
|
}
|
|
2322
2095
|
}
|
|
2323
2096
|
}
|
|
@@ -2326,323 +2099,262 @@ void BluetoothGATTErrorResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
2326
2099
|
buffer.encode_uint32(2, this->handle);
|
|
2327
2100
|
buffer.encode_int32(3, this->error);
|
|
2328
2101
|
}
|
|
2329
|
-
void BluetoothGATTErrorResponse::calculate_size(
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2102
|
+
void BluetoothGATTErrorResponse::calculate_size(ProtoSize &size) const {
|
|
2103
|
+
size.add_uint64(1, this->address);
|
|
2104
|
+
size.add_uint32(1, this->handle);
|
|
2105
|
+
size.add_int32(1, this->error);
|
|
2333
2106
|
}
|
|
2334
2107
|
void BluetoothGATTWriteResponse::encode(ProtoWriteBuffer buffer) const {
|
|
2335
2108
|
buffer.encode_uint64(1, this->address);
|
|
2336
2109
|
buffer.encode_uint32(2, this->handle);
|
|
2337
2110
|
}
|
|
2338
|
-
void BluetoothGATTWriteResponse::calculate_size(
|
|
2339
|
-
|
|
2340
|
-
|
|
2111
|
+
void BluetoothGATTWriteResponse::calculate_size(ProtoSize &size) const {
|
|
2112
|
+
size.add_uint64(1, this->address);
|
|
2113
|
+
size.add_uint32(1, this->handle);
|
|
2341
2114
|
}
|
|
2342
2115
|
void BluetoothGATTNotifyResponse::encode(ProtoWriteBuffer buffer) const {
|
|
2343
2116
|
buffer.encode_uint64(1, this->address);
|
|
2344
2117
|
buffer.encode_uint32(2, this->handle);
|
|
2345
2118
|
}
|
|
2346
|
-
void BluetoothGATTNotifyResponse::calculate_size(
|
|
2347
|
-
|
|
2348
|
-
|
|
2119
|
+
void BluetoothGATTNotifyResponse::calculate_size(ProtoSize &size) const {
|
|
2120
|
+
size.add_uint64(1, this->address);
|
|
2121
|
+
size.add_uint32(1, this->handle);
|
|
2349
2122
|
}
|
|
2350
2123
|
void BluetoothDevicePairingResponse::encode(ProtoWriteBuffer buffer) const {
|
|
2351
2124
|
buffer.encode_uint64(1, this->address);
|
|
2352
2125
|
buffer.encode_bool(2, this->paired);
|
|
2353
2126
|
buffer.encode_int32(3, this->error);
|
|
2354
2127
|
}
|
|
2355
|
-
void BluetoothDevicePairingResponse::calculate_size(
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2128
|
+
void BluetoothDevicePairingResponse::calculate_size(ProtoSize &size) const {
|
|
2129
|
+
size.add_uint64(1, this->address);
|
|
2130
|
+
size.add_bool(1, this->paired);
|
|
2131
|
+
size.add_int32(1, this->error);
|
|
2359
2132
|
}
|
|
2360
2133
|
void BluetoothDeviceUnpairingResponse::encode(ProtoWriteBuffer buffer) const {
|
|
2361
2134
|
buffer.encode_uint64(1, this->address);
|
|
2362
2135
|
buffer.encode_bool(2, this->success);
|
|
2363
2136
|
buffer.encode_int32(3, this->error);
|
|
2364
2137
|
}
|
|
2365
|
-
void BluetoothDeviceUnpairingResponse::calculate_size(
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2138
|
+
void BluetoothDeviceUnpairingResponse::calculate_size(ProtoSize &size) const {
|
|
2139
|
+
size.add_uint64(1, this->address);
|
|
2140
|
+
size.add_bool(1, this->success);
|
|
2141
|
+
size.add_int32(1, this->error);
|
|
2369
2142
|
}
|
|
2370
2143
|
void BluetoothDeviceClearCacheResponse::encode(ProtoWriteBuffer buffer) const {
|
|
2371
2144
|
buffer.encode_uint64(1, this->address);
|
|
2372
2145
|
buffer.encode_bool(2, this->success);
|
|
2373
2146
|
buffer.encode_int32(3, this->error);
|
|
2374
2147
|
}
|
|
2375
|
-
void BluetoothDeviceClearCacheResponse::calculate_size(
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2148
|
+
void BluetoothDeviceClearCacheResponse::calculate_size(ProtoSize &size) const {
|
|
2149
|
+
size.add_uint64(1, this->address);
|
|
2150
|
+
size.add_bool(1, this->success);
|
|
2151
|
+
size.add_int32(1, this->error);
|
|
2379
2152
|
}
|
|
2380
2153
|
void BluetoothScannerStateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
2381
2154
|
buffer.encode_uint32(1, static_cast<uint32_t>(this->state));
|
|
2382
2155
|
buffer.encode_uint32(2, static_cast<uint32_t>(this->mode));
|
|
2383
2156
|
}
|
|
2384
|
-
void BluetoothScannerStateResponse::calculate_size(
|
|
2385
|
-
|
|
2386
|
-
|
|
2157
|
+
void BluetoothScannerStateResponse::calculate_size(ProtoSize &size) const {
|
|
2158
|
+
size.add_uint32(1, static_cast<uint32_t>(this->state));
|
|
2159
|
+
size.add_uint32(1, static_cast<uint32_t>(this->mode));
|
|
2387
2160
|
}
|
|
2388
2161
|
bool BluetoothScannerSetModeRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
|
2389
2162
|
switch (field_id) {
|
|
2390
|
-
case 1:
|
|
2163
|
+
case 1:
|
|
2391
2164
|
this->mode = static_cast<enums::BluetoothScannerMode>(value.as_uint32());
|
|
2392
|
-
|
|
2393
|
-
}
|
|
2165
|
+
break;
|
|
2394
2166
|
default:
|
|
2395
2167
|
return false;
|
|
2396
2168
|
}
|
|
2169
|
+
return true;
|
|
2397
2170
|
}
|
|
2398
2171
|
#endif
|
|
2399
2172
|
#ifdef USE_VOICE_ASSISTANT
|
|
2400
2173
|
bool SubscribeVoiceAssistantRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
|
2401
2174
|
switch (field_id) {
|
|
2402
|
-
case 1:
|
|
2175
|
+
case 1:
|
|
2403
2176
|
this->subscribe = value.as_bool();
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
case 2: {
|
|
2177
|
+
break;
|
|
2178
|
+
case 2:
|
|
2407
2179
|
this->flags = value.as_uint32();
|
|
2408
|
-
|
|
2409
|
-
}
|
|
2410
|
-
default:
|
|
2411
|
-
return false;
|
|
2412
|
-
}
|
|
2413
|
-
}
|
|
2414
|
-
bool VoiceAssistantAudioSettings::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
|
2415
|
-
switch (field_id) {
|
|
2416
|
-
case 1: {
|
|
2417
|
-
this->noise_suppression_level = value.as_uint32();
|
|
2418
|
-
return true;
|
|
2419
|
-
}
|
|
2420
|
-
case 2: {
|
|
2421
|
-
this->auto_gain = value.as_uint32();
|
|
2422
|
-
return true;
|
|
2423
|
-
}
|
|
2424
|
-
default:
|
|
2425
|
-
return false;
|
|
2426
|
-
}
|
|
2427
|
-
}
|
|
2428
|
-
bool VoiceAssistantAudioSettings::decode_32bit(uint32_t field_id, Proto32Bit value) {
|
|
2429
|
-
switch (field_id) {
|
|
2430
|
-
case 3: {
|
|
2431
|
-
this->volume_multiplier = value.as_float();
|
|
2432
|
-
return true;
|
|
2433
|
-
}
|
|
2180
|
+
break;
|
|
2434
2181
|
default:
|
|
2435
2182
|
return false;
|
|
2436
2183
|
}
|
|
2184
|
+
return true;
|
|
2437
2185
|
}
|
|
2438
2186
|
void VoiceAssistantAudioSettings::encode(ProtoWriteBuffer buffer) const {
|
|
2439
2187
|
buffer.encode_uint32(1, this->noise_suppression_level);
|
|
2440
2188
|
buffer.encode_uint32(2, this->auto_gain);
|
|
2441
2189
|
buffer.encode_float(3, this->volume_multiplier);
|
|
2442
2190
|
}
|
|
2443
|
-
void VoiceAssistantAudioSettings::calculate_size(
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2191
|
+
void VoiceAssistantAudioSettings::calculate_size(ProtoSize &size) const {
|
|
2192
|
+
size.add_uint32(1, this->noise_suppression_level);
|
|
2193
|
+
size.add_uint32(1, this->auto_gain);
|
|
2194
|
+
size.add_float(1, this->volume_multiplier);
|
|
2447
2195
|
}
|
|
2448
2196
|
void VoiceAssistantRequest::encode(ProtoWriteBuffer buffer) const {
|
|
2449
2197
|
buffer.encode_bool(1, this->start);
|
|
2450
|
-
buffer.encode_string(2, this->
|
|
2198
|
+
buffer.encode_string(2, this->conversation_id_ref_);
|
|
2451
2199
|
buffer.encode_uint32(3, this->flags);
|
|
2452
2200
|
buffer.encode_message(4, this->audio_settings);
|
|
2453
|
-
buffer.encode_string(5, this->
|
|
2201
|
+
buffer.encode_string(5, this->wake_word_phrase_ref_);
|
|
2454
2202
|
}
|
|
2455
|
-
void VoiceAssistantRequest::calculate_size(
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2203
|
+
void VoiceAssistantRequest::calculate_size(ProtoSize &size) const {
|
|
2204
|
+
size.add_bool(1, this->start);
|
|
2205
|
+
size.add_length(1, this->conversation_id_ref_.size());
|
|
2206
|
+
size.add_uint32(1, this->flags);
|
|
2207
|
+
size.add_message_object(1, this->audio_settings);
|
|
2208
|
+
size.add_length(1, this->wake_word_phrase_ref_.size());
|
|
2461
2209
|
}
|
|
2462
2210
|
bool VoiceAssistantResponse::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
|
2463
2211
|
switch (field_id) {
|
|
2464
|
-
case 1:
|
|
2212
|
+
case 1:
|
|
2465
2213
|
this->port = value.as_uint32();
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
case 2: {
|
|
2214
|
+
break;
|
|
2215
|
+
case 2:
|
|
2469
2216
|
this->error = value.as_bool();
|
|
2470
|
-
|
|
2471
|
-
}
|
|
2217
|
+
break;
|
|
2472
2218
|
default:
|
|
2473
2219
|
return false;
|
|
2474
2220
|
}
|
|
2221
|
+
return true;
|
|
2475
2222
|
}
|
|
2476
2223
|
bool VoiceAssistantEventData::decode_length(uint32_t field_id, ProtoLengthDelimited value) {
|
|
2477
2224
|
switch (field_id) {
|
|
2478
|
-
case 1:
|
|
2225
|
+
case 1:
|
|
2479
2226
|
this->name = value.as_string();
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
case 2: {
|
|
2227
|
+
break;
|
|
2228
|
+
case 2:
|
|
2483
2229
|
this->value = value.as_string();
|
|
2484
|
-
|
|
2485
|
-
}
|
|
2230
|
+
break;
|
|
2486
2231
|
default:
|
|
2487
2232
|
return false;
|
|
2488
2233
|
}
|
|
2489
|
-
|
|
2490
|
-
void VoiceAssistantEventData::encode(ProtoWriteBuffer buffer) const {
|
|
2491
|
-
buffer.encode_string(1, this->name);
|
|
2492
|
-
buffer.encode_string(2, this->value);
|
|
2493
|
-
}
|
|
2494
|
-
void VoiceAssistantEventData::calculate_size(uint32_t &total_size) const {
|
|
2495
|
-
ProtoSize::add_string_field(total_size, 1, this->name);
|
|
2496
|
-
ProtoSize::add_string_field(total_size, 1, this->value);
|
|
2234
|
+
return true;
|
|
2497
2235
|
}
|
|
2498
2236
|
bool VoiceAssistantEventResponse::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
|
2499
2237
|
switch (field_id) {
|
|
2500
|
-
case 1:
|
|
2238
|
+
case 1:
|
|
2501
2239
|
this->event_type = static_cast<enums::VoiceAssistantEvent>(value.as_uint32());
|
|
2502
|
-
|
|
2503
|
-
}
|
|
2240
|
+
break;
|
|
2504
2241
|
default:
|
|
2505
2242
|
return false;
|
|
2506
2243
|
}
|
|
2244
|
+
return true;
|
|
2507
2245
|
}
|
|
2508
2246
|
bool VoiceAssistantEventResponse::decode_length(uint32_t field_id, ProtoLengthDelimited value) {
|
|
2509
2247
|
switch (field_id) {
|
|
2510
|
-
case 2:
|
|
2248
|
+
case 2:
|
|
2511
2249
|
this->data.emplace_back();
|
|
2512
2250
|
value.decode_to_message(this->data.back());
|
|
2513
|
-
|
|
2514
|
-
}
|
|
2251
|
+
break;
|
|
2515
2252
|
default:
|
|
2516
2253
|
return false;
|
|
2517
2254
|
}
|
|
2255
|
+
return true;
|
|
2518
2256
|
}
|
|
2519
2257
|
bool VoiceAssistantAudio::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
|
2520
2258
|
switch (field_id) {
|
|
2521
|
-
case 2:
|
|
2259
|
+
case 2:
|
|
2522
2260
|
this->end = value.as_bool();
|
|
2523
|
-
|
|
2524
|
-
}
|
|
2261
|
+
break;
|
|
2525
2262
|
default:
|
|
2526
2263
|
return false;
|
|
2527
2264
|
}
|
|
2265
|
+
return true;
|
|
2528
2266
|
}
|
|
2529
2267
|
bool VoiceAssistantAudio::decode_length(uint32_t field_id, ProtoLengthDelimited value) {
|
|
2530
2268
|
switch (field_id) {
|
|
2531
|
-
case 1:
|
|
2269
|
+
case 1:
|
|
2532
2270
|
this->data = value.as_string();
|
|
2533
|
-
|
|
2534
|
-
}
|
|
2271
|
+
break;
|
|
2535
2272
|
default:
|
|
2536
2273
|
return false;
|
|
2537
2274
|
}
|
|
2275
|
+
return true;
|
|
2538
2276
|
}
|
|
2539
2277
|
void VoiceAssistantAudio::encode(ProtoWriteBuffer buffer) const {
|
|
2540
|
-
buffer.encode_bytes(1,
|
|
2278
|
+
buffer.encode_bytes(1, this->data_ptr_, this->data_len_);
|
|
2541
2279
|
buffer.encode_bool(2, this->end);
|
|
2542
2280
|
}
|
|
2543
|
-
void VoiceAssistantAudio::calculate_size(
|
|
2544
|
-
|
|
2545
|
-
|
|
2281
|
+
void VoiceAssistantAudio::calculate_size(ProtoSize &size) const {
|
|
2282
|
+
size.add_length(1, this->data_len_);
|
|
2283
|
+
size.add_bool(1, this->end);
|
|
2546
2284
|
}
|
|
2547
2285
|
bool VoiceAssistantTimerEventResponse::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
|
2548
2286
|
switch (field_id) {
|
|
2549
|
-
case 1:
|
|
2287
|
+
case 1:
|
|
2550
2288
|
this->event_type = static_cast<enums::VoiceAssistantTimerEvent>(value.as_uint32());
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
case 4: {
|
|
2289
|
+
break;
|
|
2290
|
+
case 4:
|
|
2554
2291
|
this->total_seconds = value.as_uint32();
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
case 5: {
|
|
2292
|
+
break;
|
|
2293
|
+
case 5:
|
|
2558
2294
|
this->seconds_left = value.as_uint32();
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
case 6: {
|
|
2295
|
+
break;
|
|
2296
|
+
case 6:
|
|
2562
2297
|
this->is_active = value.as_bool();
|
|
2563
|
-
|
|
2564
|
-
}
|
|
2298
|
+
break;
|
|
2565
2299
|
default:
|
|
2566
2300
|
return false;
|
|
2567
2301
|
}
|
|
2302
|
+
return true;
|
|
2568
2303
|
}
|
|
2569
2304
|
bool VoiceAssistantTimerEventResponse::decode_length(uint32_t field_id, ProtoLengthDelimited value) {
|
|
2570
2305
|
switch (field_id) {
|
|
2571
|
-
case 2:
|
|
2306
|
+
case 2:
|
|
2572
2307
|
this->timer_id = value.as_string();
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
case 3: {
|
|
2308
|
+
break;
|
|
2309
|
+
case 3:
|
|
2576
2310
|
this->name = value.as_string();
|
|
2577
|
-
|
|
2578
|
-
}
|
|
2311
|
+
break;
|
|
2579
2312
|
default:
|
|
2580
2313
|
return false;
|
|
2581
2314
|
}
|
|
2315
|
+
return true;
|
|
2582
2316
|
}
|
|
2583
2317
|
bool VoiceAssistantAnnounceRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
|
2584
2318
|
switch (field_id) {
|
|
2585
|
-
case 4:
|
|
2319
|
+
case 4:
|
|
2586
2320
|
this->start_conversation = value.as_bool();
|
|
2587
|
-
|
|
2588
|
-
}
|
|
2321
|
+
break;
|
|
2589
2322
|
default:
|
|
2590
2323
|
return false;
|
|
2591
2324
|
}
|
|
2325
|
+
return true;
|
|
2592
2326
|
}
|
|
2593
2327
|
bool VoiceAssistantAnnounceRequest::decode_length(uint32_t field_id, ProtoLengthDelimited value) {
|
|
2594
2328
|
switch (field_id) {
|
|
2595
|
-
case 1:
|
|
2329
|
+
case 1:
|
|
2596
2330
|
this->media_id = value.as_string();
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
case 2: {
|
|
2331
|
+
break;
|
|
2332
|
+
case 2:
|
|
2600
2333
|
this->text = value.as_string();
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
case 3: {
|
|
2334
|
+
break;
|
|
2335
|
+
case 3:
|
|
2604
2336
|
this->preannounce_media_id = value.as_string();
|
|
2605
|
-
|
|
2606
|
-
}
|
|
2337
|
+
break;
|
|
2607
2338
|
default:
|
|
2608
2339
|
return false;
|
|
2609
2340
|
}
|
|
2341
|
+
return true;
|
|
2610
2342
|
}
|
|
2611
2343
|
void VoiceAssistantAnnounceFinished::encode(ProtoWriteBuffer buffer) const { buffer.encode_bool(1, this->success); }
|
|
2612
|
-
void VoiceAssistantAnnounceFinished::calculate_size(
|
|
2613
|
-
ProtoSize::add_bool_field(total_size, 1, this->success);
|
|
2614
|
-
}
|
|
2615
|
-
bool VoiceAssistantWakeWord::decode_length(uint32_t field_id, ProtoLengthDelimited value) {
|
|
2616
|
-
switch (field_id) {
|
|
2617
|
-
case 1: {
|
|
2618
|
-
this->id = value.as_string();
|
|
2619
|
-
return true;
|
|
2620
|
-
}
|
|
2621
|
-
case 2: {
|
|
2622
|
-
this->wake_word = value.as_string();
|
|
2623
|
-
return true;
|
|
2624
|
-
}
|
|
2625
|
-
case 3: {
|
|
2626
|
-
this->trained_languages.push_back(value.as_string());
|
|
2627
|
-
return true;
|
|
2628
|
-
}
|
|
2629
|
-
default:
|
|
2630
|
-
return false;
|
|
2631
|
-
}
|
|
2632
|
-
}
|
|
2344
|
+
void VoiceAssistantAnnounceFinished::calculate_size(ProtoSize &size) const { size.add_bool(1, this->success); }
|
|
2633
2345
|
void VoiceAssistantWakeWord::encode(ProtoWriteBuffer buffer) const {
|
|
2634
|
-
buffer.encode_string(1, this->
|
|
2635
|
-
buffer.encode_string(2, this->
|
|
2346
|
+
buffer.encode_string(1, this->id_ref_);
|
|
2347
|
+
buffer.encode_string(2, this->wake_word_ref_);
|
|
2636
2348
|
for (auto &it : this->trained_languages) {
|
|
2637
2349
|
buffer.encode_string(3, it, true);
|
|
2638
2350
|
}
|
|
2639
2351
|
}
|
|
2640
|
-
void VoiceAssistantWakeWord::calculate_size(
|
|
2641
|
-
|
|
2642
|
-
|
|
2352
|
+
void VoiceAssistantWakeWord::calculate_size(ProtoSize &size) const {
|
|
2353
|
+
size.add_length(1, this->id_ref_.size());
|
|
2354
|
+
size.add_length(1, this->wake_word_ref_.size());
|
|
2643
2355
|
if (!this->trained_languages.empty()) {
|
|
2644
2356
|
for (const auto &it : this->trained_languages) {
|
|
2645
|
-
|
|
2357
|
+
size.add_length_force(1, it.size());
|
|
2646
2358
|
}
|
|
2647
2359
|
}
|
|
2648
2360
|
}
|
|
@@ -2650,195 +2362,224 @@ void VoiceAssistantConfigurationResponse::encode(ProtoWriteBuffer buffer) const
|
|
|
2650
2362
|
for (auto &it : this->available_wake_words) {
|
|
2651
2363
|
buffer.encode_message(1, it, true);
|
|
2652
2364
|
}
|
|
2653
|
-
for (auto &it : this->active_wake_words) {
|
|
2365
|
+
for (const auto &it : *this->active_wake_words) {
|
|
2654
2366
|
buffer.encode_string(2, it, true);
|
|
2655
2367
|
}
|
|
2656
2368
|
buffer.encode_uint32(3, this->max_active_wake_words);
|
|
2657
2369
|
}
|
|
2658
|
-
void VoiceAssistantConfigurationResponse::calculate_size(
|
|
2659
|
-
|
|
2660
|
-
if (!this->active_wake_words
|
|
2661
|
-
for (const auto &it : this->active_wake_words) {
|
|
2662
|
-
|
|
2370
|
+
void VoiceAssistantConfigurationResponse::calculate_size(ProtoSize &size) const {
|
|
2371
|
+
size.add_repeated_message(1, this->available_wake_words);
|
|
2372
|
+
if (!this->active_wake_words->empty()) {
|
|
2373
|
+
for (const auto &it : *this->active_wake_words) {
|
|
2374
|
+
size.add_length_force(1, it.size());
|
|
2663
2375
|
}
|
|
2664
2376
|
}
|
|
2665
|
-
|
|
2377
|
+
size.add_uint32(1, this->max_active_wake_words);
|
|
2666
2378
|
}
|
|
2667
2379
|
bool VoiceAssistantSetConfiguration::decode_length(uint32_t field_id, ProtoLengthDelimited value) {
|
|
2668
2380
|
switch (field_id) {
|
|
2669
|
-
case 1:
|
|
2381
|
+
case 1:
|
|
2670
2382
|
this->active_wake_words.push_back(value.as_string());
|
|
2671
|
-
|
|
2672
|
-
}
|
|
2383
|
+
break;
|
|
2673
2384
|
default:
|
|
2674
2385
|
return false;
|
|
2675
2386
|
}
|
|
2387
|
+
return true;
|
|
2676
2388
|
}
|
|
2677
2389
|
#endif
|
|
2678
2390
|
#ifdef USE_ALARM_CONTROL_PANEL
|
|
2679
2391
|
void ListEntitiesAlarmControlPanelResponse::encode(ProtoWriteBuffer buffer) const {
|
|
2680
|
-
buffer.encode_string(1, this->
|
|
2392
|
+
buffer.encode_string(1, this->object_id_ref_);
|
|
2681
2393
|
buffer.encode_fixed32(2, this->key);
|
|
2682
|
-
buffer.encode_string(3, this->
|
|
2683
|
-
|
|
2684
|
-
buffer.encode_string(5, this->
|
|
2394
|
+
buffer.encode_string(3, this->name_ref_);
|
|
2395
|
+
#ifdef USE_ENTITY_ICON
|
|
2396
|
+
buffer.encode_string(5, this->icon_ref_);
|
|
2397
|
+
#endif
|
|
2685
2398
|
buffer.encode_bool(6, this->disabled_by_default);
|
|
2686
2399
|
buffer.encode_uint32(7, static_cast<uint32_t>(this->entity_category));
|
|
2687
2400
|
buffer.encode_uint32(8, this->supported_features);
|
|
2688
2401
|
buffer.encode_bool(9, this->requires_code);
|
|
2689
2402
|
buffer.encode_bool(10, this->requires_code_to_arm);
|
|
2403
|
+
#ifdef USE_DEVICES
|
|
2690
2404
|
buffer.encode_uint32(11, this->device_id);
|
|
2405
|
+
#endif
|
|
2691
2406
|
}
|
|
2692
|
-
void ListEntitiesAlarmControlPanelResponse::calculate_size(
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2407
|
+
void ListEntitiesAlarmControlPanelResponse::calculate_size(ProtoSize &size) const {
|
|
2408
|
+
size.add_length(1, this->object_id_ref_.size());
|
|
2409
|
+
size.add_fixed32(1, this->key);
|
|
2410
|
+
size.add_length(1, this->name_ref_.size());
|
|
2411
|
+
#ifdef USE_ENTITY_ICON
|
|
2412
|
+
size.add_length(1, this->icon_ref_.size());
|
|
2413
|
+
#endif
|
|
2414
|
+
size.add_bool(1, this->disabled_by_default);
|
|
2415
|
+
size.add_uint32(1, static_cast<uint32_t>(this->entity_category));
|
|
2416
|
+
size.add_uint32(1, this->supported_features);
|
|
2417
|
+
size.add_bool(1, this->requires_code);
|
|
2418
|
+
size.add_bool(1, this->requires_code_to_arm);
|
|
2419
|
+
#ifdef USE_DEVICES
|
|
2420
|
+
size.add_uint32(1, this->device_id);
|
|
2421
|
+
#endif
|
|
2704
2422
|
}
|
|
2705
2423
|
void AlarmControlPanelStateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
2706
2424
|
buffer.encode_fixed32(1, this->key);
|
|
2707
2425
|
buffer.encode_uint32(2, static_cast<uint32_t>(this->state));
|
|
2426
|
+
#ifdef USE_DEVICES
|
|
2708
2427
|
buffer.encode_uint32(3, this->device_id);
|
|
2428
|
+
#endif
|
|
2709
2429
|
}
|
|
2710
|
-
void AlarmControlPanelStateResponse::calculate_size(
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2430
|
+
void AlarmControlPanelStateResponse::calculate_size(ProtoSize &size) const {
|
|
2431
|
+
size.add_fixed32(1, this->key);
|
|
2432
|
+
size.add_uint32(1, static_cast<uint32_t>(this->state));
|
|
2433
|
+
#ifdef USE_DEVICES
|
|
2434
|
+
size.add_uint32(1, this->device_id);
|
|
2435
|
+
#endif
|
|
2714
2436
|
}
|
|
2715
2437
|
bool AlarmControlPanelCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
|
2716
2438
|
switch (field_id) {
|
|
2717
|
-
case 2:
|
|
2439
|
+
case 2:
|
|
2718
2440
|
this->command = static_cast<enums::AlarmControlPanelStateCommand>(value.as_uint32());
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
case 4:
|
|
2441
|
+
break;
|
|
2442
|
+
#ifdef USE_DEVICES
|
|
2443
|
+
case 4:
|
|
2722
2444
|
this->device_id = value.as_uint32();
|
|
2723
|
-
|
|
2724
|
-
|
|
2445
|
+
break;
|
|
2446
|
+
#endif
|
|
2725
2447
|
default:
|
|
2726
2448
|
return false;
|
|
2727
2449
|
}
|
|
2450
|
+
return true;
|
|
2728
2451
|
}
|
|
2729
2452
|
bool AlarmControlPanelCommandRequest::decode_length(uint32_t field_id, ProtoLengthDelimited value) {
|
|
2730
2453
|
switch (field_id) {
|
|
2731
|
-
case 3:
|
|
2454
|
+
case 3:
|
|
2732
2455
|
this->code = value.as_string();
|
|
2733
|
-
|
|
2734
|
-
}
|
|
2456
|
+
break;
|
|
2735
2457
|
default:
|
|
2736
2458
|
return false;
|
|
2737
2459
|
}
|
|
2460
|
+
return true;
|
|
2738
2461
|
}
|
|
2739
2462
|
bool AlarmControlPanelCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
|
|
2740
2463
|
switch (field_id) {
|
|
2741
|
-
case 1:
|
|
2464
|
+
case 1:
|
|
2742
2465
|
this->key = value.as_fixed32();
|
|
2743
|
-
|
|
2744
|
-
}
|
|
2466
|
+
break;
|
|
2745
2467
|
default:
|
|
2746
2468
|
return false;
|
|
2747
2469
|
}
|
|
2470
|
+
return true;
|
|
2748
2471
|
}
|
|
2749
2472
|
#endif
|
|
2750
2473
|
#ifdef USE_TEXT
|
|
2751
2474
|
void ListEntitiesTextResponse::encode(ProtoWriteBuffer buffer) const {
|
|
2752
|
-
buffer.encode_string(1, this->
|
|
2475
|
+
buffer.encode_string(1, this->object_id_ref_);
|
|
2753
2476
|
buffer.encode_fixed32(2, this->key);
|
|
2754
|
-
buffer.encode_string(3, this->
|
|
2755
|
-
|
|
2756
|
-
buffer.encode_string(5, this->
|
|
2477
|
+
buffer.encode_string(3, this->name_ref_);
|
|
2478
|
+
#ifdef USE_ENTITY_ICON
|
|
2479
|
+
buffer.encode_string(5, this->icon_ref_);
|
|
2480
|
+
#endif
|
|
2757
2481
|
buffer.encode_bool(6, this->disabled_by_default);
|
|
2758
2482
|
buffer.encode_uint32(7, static_cast<uint32_t>(this->entity_category));
|
|
2759
2483
|
buffer.encode_uint32(8, this->min_length);
|
|
2760
2484
|
buffer.encode_uint32(9, this->max_length);
|
|
2761
|
-
buffer.encode_string(10, this->
|
|
2485
|
+
buffer.encode_string(10, this->pattern_ref_);
|
|
2762
2486
|
buffer.encode_uint32(11, static_cast<uint32_t>(this->mode));
|
|
2487
|
+
#ifdef USE_DEVICES
|
|
2763
2488
|
buffer.encode_uint32(12, this->device_id);
|
|
2489
|
+
#endif
|
|
2764
2490
|
}
|
|
2765
|
-
void ListEntitiesTextResponse::calculate_size(
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2491
|
+
void ListEntitiesTextResponse::calculate_size(ProtoSize &size) const {
|
|
2492
|
+
size.add_length(1, this->object_id_ref_.size());
|
|
2493
|
+
size.add_fixed32(1, this->key);
|
|
2494
|
+
size.add_length(1, this->name_ref_.size());
|
|
2495
|
+
#ifdef USE_ENTITY_ICON
|
|
2496
|
+
size.add_length(1, this->icon_ref_.size());
|
|
2497
|
+
#endif
|
|
2498
|
+
size.add_bool(1, this->disabled_by_default);
|
|
2499
|
+
size.add_uint32(1, static_cast<uint32_t>(this->entity_category));
|
|
2500
|
+
size.add_uint32(1, this->min_length);
|
|
2501
|
+
size.add_uint32(1, this->max_length);
|
|
2502
|
+
size.add_length(1, this->pattern_ref_.size());
|
|
2503
|
+
size.add_uint32(1, static_cast<uint32_t>(this->mode));
|
|
2504
|
+
#ifdef USE_DEVICES
|
|
2505
|
+
size.add_uint32(1, this->device_id);
|
|
2506
|
+
#endif
|
|
2778
2507
|
}
|
|
2779
2508
|
void TextStateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
2780
2509
|
buffer.encode_fixed32(1, this->key);
|
|
2781
|
-
buffer.encode_string(2, this->
|
|
2510
|
+
buffer.encode_string(2, this->state_ref_);
|
|
2782
2511
|
buffer.encode_bool(3, this->missing_state);
|
|
2512
|
+
#ifdef USE_DEVICES
|
|
2783
2513
|
buffer.encode_uint32(4, this->device_id);
|
|
2514
|
+
#endif
|
|
2784
2515
|
}
|
|
2785
|
-
void TextStateResponse::calculate_size(
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2516
|
+
void TextStateResponse::calculate_size(ProtoSize &size) const {
|
|
2517
|
+
size.add_fixed32(1, this->key);
|
|
2518
|
+
size.add_length(1, this->state_ref_.size());
|
|
2519
|
+
size.add_bool(1, this->missing_state);
|
|
2520
|
+
#ifdef USE_DEVICES
|
|
2521
|
+
size.add_uint32(1, this->device_id);
|
|
2522
|
+
#endif
|
|
2790
2523
|
}
|
|
2791
2524
|
bool TextCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
|
2792
2525
|
switch (field_id) {
|
|
2793
|
-
|
|
2526
|
+
#ifdef USE_DEVICES
|
|
2527
|
+
case 3:
|
|
2794
2528
|
this->device_id = value.as_uint32();
|
|
2795
|
-
|
|
2796
|
-
|
|
2529
|
+
break;
|
|
2530
|
+
#endif
|
|
2797
2531
|
default:
|
|
2798
2532
|
return false;
|
|
2799
2533
|
}
|
|
2534
|
+
return true;
|
|
2800
2535
|
}
|
|
2801
2536
|
bool TextCommandRequest::decode_length(uint32_t field_id, ProtoLengthDelimited value) {
|
|
2802
2537
|
switch (field_id) {
|
|
2803
|
-
case 2:
|
|
2538
|
+
case 2:
|
|
2804
2539
|
this->state = value.as_string();
|
|
2805
|
-
|
|
2806
|
-
}
|
|
2540
|
+
break;
|
|
2807
2541
|
default:
|
|
2808
2542
|
return false;
|
|
2809
2543
|
}
|
|
2544
|
+
return true;
|
|
2810
2545
|
}
|
|
2811
2546
|
bool TextCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
|
|
2812
2547
|
switch (field_id) {
|
|
2813
|
-
case 1:
|
|
2548
|
+
case 1:
|
|
2814
2549
|
this->key = value.as_fixed32();
|
|
2815
|
-
|
|
2816
|
-
}
|
|
2550
|
+
break;
|
|
2817
2551
|
default:
|
|
2818
2552
|
return false;
|
|
2819
2553
|
}
|
|
2554
|
+
return true;
|
|
2820
2555
|
}
|
|
2821
2556
|
#endif
|
|
2822
2557
|
#ifdef USE_DATETIME_DATE
|
|
2823
2558
|
void ListEntitiesDateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
2824
|
-
buffer.encode_string(1, this->
|
|
2559
|
+
buffer.encode_string(1, this->object_id_ref_);
|
|
2825
2560
|
buffer.encode_fixed32(2, this->key);
|
|
2826
|
-
buffer.encode_string(3, this->
|
|
2827
|
-
|
|
2828
|
-
buffer.encode_string(5, this->
|
|
2561
|
+
buffer.encode_string(3, this->name_ref_);
|
|
2562
|
+
#ifdef USE_ENTITY_ICON
|
|
2563
|
+
buffer.encode_string(5, this->icon_ref_);
|
|
2564
|
+
#endif
|
|
2829
2565
|
buffer.encode_bool(6, this->disabled_by_default);
|
|
2830
2566
|
buffer.encode_uint32(7, static_cast<uint32_t>(this->entity_category));
|
|
2567
|
+
#ifdef USE_DEVICES
|
|
2831
2568
|
buffer.encode_uint32(8, this->device_id);
|
|
2569
|
+
#endif
|
|
2832
2570
|
}
|
|
2833
|
-
void ListEntitiesDateResponse::calculate_size(
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2571
|
+
void ListEntitiesDateResponse::calculate_size(ProtoSize &size) const {
|
|
2572
|
+
size.add_length(1, this->object_id_ref_.size());
|
|
2573
|
+
size.add_fixed32(1, this->key);
|
|
2574
|
+
size.add_length(1, this->name_ref_.size());
|
|
2575
|
+
#ifdef USE_ENTITY_ICON
|
|
2576
|
+
size.add_length(1, this->icon_ref_.size());
|
|
2577
|
+
#endif
|
|
2578
|
+
size.add_bool(1, this->disabled_by_default);
|
|
2579
|
+
size.add_uint32(1, static_cast<uint32_t>(this->entity_category));
|
|
2580
|
+
#ifdef USE_DEVICES
|
|
2581
|
+
size.add_uint32(1, this->device_id);
|
|
2582
|
+
#endif
|
|
2842
2583
|
}
|
|
2843
2584
|
void DateStateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
2844
2585
|
buffer.encode_fixed32(1, this->key);
|
|
@@ -2846,69 +2587,78 @@ void DateStateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
2846
2587
|
buffer.encode_uint32(3, this->year);
|
|
2847
2588
|
buffer.encode_uint32(4, this->month);
|
|
2848
2589
|
buffer.encode_uint32(5, this->day);
|
|
2590
|
+
#ifdef USE_DEVICES
|
|
2849
2591
|
buffer.encode_uint32(6, this->device_id);
|
|
2592
|
+
#endif
|
|
2850
2593
|
}
|
|
2851
|
-
void DateStateResponse::calculate_size(
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2594
|
+
void DateStateResponse::calculate_size(ProtoSize &size) const {
|
|
2595
|
+
size.add_fixed32(1, this->key);
|
|
2596
|
+
size.add_bool(1, this->missing_state);
|
|
2597
|
+
size.add_uint32(1, this->year);
|
|
2598
|
+
size.add_uint32(1, this->month);
|
|
2599
|
+
size.add_uint32(1, this->day);
|
|
2600
|
+
#ifdef USE_DEVICES
|
|
2601
|
+
size.add_uint32(1, this->device_id);
|
|
2602
|
+
#endif
|
|
2858
2603
|
}
|
|
2859
2604
|
bool DateCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
|
2860
2605
|
switch (field_id) {
|
|
2861
|
-
case 2:
|
|
2606
|
+
case 2:
|
|
2862
2607
|
this->year = value.as_uint32();
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
case 3: {
|
|
2608
|
+
break;
|
|
2609
|
+
case 3:
|
|
2866
2610
|
this->month = value.as_uint32();
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
case 4: {
|
|
2611
|
+
break;
|
|
2612
|
+
case 4:
|
|
2870
2613
|
this->day = value.as_uint32();
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
case 5:
|
|
2614
|
+
break;
|
|
2615
|
+
#ifdef USE_DEVICES
|
|
2616
|
+
case 5:
|
|
2874
2617
|
this->device_id = value.as_uint32();
|
|
2875
|
-
|
|
2876
|
-
|
|
2618
|
+
break;
|
|
2619
|
+
#endif
|
|
2877
2620
|
default:
|
|
2878
2621
|
return false;
|
|
2879
2622
|
}
|
|
2623
|
+
return true;
|
|
2880
2624
|
}
|
|
2881
2625
|
bool DateCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
|
|
2882
2626
|
switch (field_id) {
|
|
2883
|
-
case 1:
|
|
2627
|
+
case 1:
|
|
2884
2628
|
this->key = value.as_fixed32();
|
|
2885
|
-
|
|
2886
|
-
}
|
|
2629
|
+
break;
|
|
2887
2630
|
default:
|
|
2888
2631
|
return false;
|
|
2889
2632
|
}
|
|
2633
|
+
return true;
|
|
2890
2634
|
}
|
|
2891
2635
|
#endif
|
|
2892
2636
|
#ifdef USE_DATETIME_TIME
|
|
2893
2637
|
void ListEntitiesTimeResponse::encode(ProtoWriteBuffer buffer) const {
|
|
2894
|
-
buffer.encode_string(1, this->
|
|
2638
|
+
buffer.encode_string(1, this->object_id_ref_);
|
|
2895
2639
|
buffer.encode_fixed32(2, this->key);
|
|
2896
|
-
buffer.encode_string(3, this->
|
|
2897
|
-
|
|
2898
|
-
buffer.encode_string(5, this->
|
|
2640
|
+
buffer.encode_string(3, this->name_ref_);
|
|
2641
|
+
#ifdef USE_ENTITY_ICON
|
|
2642
|
+
buffer.encode_string(5, this->icon_ref_);
|
|
2643
|
+
#endif
|
|
2899
2644
|
buffer.encode_bool(6, this->disabled_by_default);
|
|
2900
2645
|
buffer.encode_uint32(7, static_cast<uint32_t>(this->entity_category));
|
|
2646
|
+
#ifdef USE_DEVICES
|
|
2901
2647
|
buffer.encode_uint32(8, this->device_id);
|
|
2648
|
+
#endif
|
|
2902
2649
|
}
|
|
2903
|
-
void ListEntitiesTimeResponse::calculate_size(
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2650
|
+
void ListEntitiesTimeResponse::calculate_size(ProtoSize &size) const {
|
|
2651
|
+
size.add_length(1, this->object_id_ref_.size());
|
|
2652
|
+
size.add_fixed32(1, this->key);
|
|
2653
|
+
size.add_length(1, this->name_ref_.size());
|
|
2654
|
+
#ifdef USE_ENTITY_ICON
|
|
2655
|
+
size.add_length(1, this->icon_ref_.size());
|
|
2656
|
+
#endif
|
|
2657
|
+
size.add_bool(1, this->disabled_by_default);
|
|
2658
|
+
size.add_uint32(1, static_cast<uint32_t>(this->entity_category));
|
|
2659
|
+
#ifdef USE_DEVICES
|
|
2660
|
+
size.add_uint32(1, this->device_id);
|
|
2661
|
+
#endif
|
|
2912
2662
|
}
|
|
2913
2663
|
void TimeStateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
2914
2664
|
buffer.encode_fixed32(1, this->key);
|
|
@@ -2916,245 +2666,284 @@ void TimeStateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
2916
2666
|
buffer.encode_uint32(3, this->hour);
|
|
2917
2667
|
buffer.encode_uint32(4, this->minute);
|
|
2918
2668
|
buffer.encode_uint32(5, this->second);
|
|
2669
|
+
#ifdef USE_DEVICES
|
|
2919
2670
|
buffer.encode_uint32(6, this->device_id);
|
|
2671
|
+
#endif
|
|
2920
2672
|
}
|
|
2921
|
-
void TimeStateResponse::calculate_size(
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2673
|
+
void TimeStateResponse::calculate_size(ProtoSize &size) const {
|
|
2674
|
+
size.add_fixed32(1, this->key);
|
|
2675
|
+
size.add_bool(1, this->missing_state);
|
|
2676
|
+
size.add_uint32(1, this->hour);
|
|
2677
|
+
size.add_uint32(1, this->minute);
|
|
2678
|
+
size.add_uint32(1, this->second);
|
|
2679
|
+
#ifdef USE_DEVICES
|
|
2680
|
+
size.add_uint32(1, this->device_id);
|
|
2681
|
+
#endif
|
|
2928
2682
|
}
|
|
2929
2683
|
bool TimeCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
|
2930
2684
|
switch (field_id) {
|
|
2931
|
-
case 2:
|
|
2685
|
+
case 2:
|
|
2932
2686
|
this->hour = value.as_uint32();
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
case 3: {
|
|
2687
|
+
break;
|
|
2688
|
+
case 3:
|
|
2936
2689
|
this->minute = value.as_uint32();
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
case 4: {
|
|
2690
|
+
break;
|
|
2691
|
+
case 4:
|
|
2940
2692
|
this->second = value.as_uint32();
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
case 5:
|
|
2693
|
+
break;
|
|
2694
|
+
#ifdef USE_DEVICES
|
|
2695
|
+
case 5:
|
|
2944
2696
|
this->device_id = value.as_uint32();
|
|
2945
|
-
|
|
2946
|
-
|
|
2697
|
+
break;
|
|
2698
|
+
#endif
|
|
2947
2699
|
default:
|
|
2948
2700
|
return false;
|
|
2949
2701
|
}
|
|
2702
|
+
return true;
|
|
2950
2703
|
}
|
|
2951
2704
|
bool TimeCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
|
|
2952
2705
|
switch (field_id) {
|
|
2953
|
-
case 1:
|
|
2706
|
+
case 1:
|
|
2954
2707
|
this->key = value.as_fixed32();
|
|
2955
|
-
|
|
2956
|
-
}
|
|
2708
|
+
break;
|
|
2957
2709
|
default:
|
|
2958
2710
|
return false;
|
|
2959
2711
|
}
|
|
2712
|
+
return true;
|
|
2960
2713
|
}
|
|
2961
2714
|
#endif
|
|
2962
2715
|
#ifdef USE_EVENT
|
|
2963
2716
|
void ListEntitiesEventResponse::encode(ProtoWriteBuffer buffer) const {
|
|
2964
|
-
buffer.encode_string(1, this->
|
|
2717
|
+
buffer.encode_string(1, this->object_id_ref_);
|
|
2965
2718
|
buffer.encode_fixed32(2, this->key);
|
|
2966
|
-
buffer.encode_string(3, this->
|
|
2967
|
-
|
|
2968
|
-
buffer.encode_string(5, this->
|
|
2719
|
+
buffer.encode_string(3, this->name_ref_);
|
|
2720
|
+
#ifdef USE_ENTITY_ICON
|
|
2721
|
+
buffer.encode_string(5, this->icon_ref_);
|
|
2722
|
+
#endif
|
|
2969
2723
|
buffer.encode_bool(6, this->disabled_by_default);
|
|
2970
2724
|
buffer.encode_uint32(7, static_cast<uint32_t>(this->entity_category));
|
|
2971
|
-
buffer.encode_string(8, this->
|
|
2725
|
+
buffer.encode_string(8, this->device_class_ref_);
|
|
2972
2726
|
for (auto &it : this->event_types) {
|
|
2973
2727
|
buffer.encode_string(9, it, true);
|
|
2974
2728
|
}
|
|
2729
|
+
#ifdef USE_DEVICES
|
|
2975
2730
|
buffer.encode_uint32(10, this->device_id);
|
|
2731
|
+
#endif
|
|
2976
2732
|
}
|
|
2977
|
-
void ListEntitiesEventResponse::calculate_size(
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2733
|
+
void ListEntitiesEventResponse::calculate_size(ProtoSize &size) const {
|
|
2734
|
+
size.add_length(1, this->object_id_ref_.size());
|
|
2735
|
+
size.add_fixed32(1, this->key);
|
|
2736
|
+
size.add_length(1, this->name_ref_.size());
|
|
2737
|
+
#ifdef USE_ENTITY_ICON
|
|
2738
|
+
size.add_length(1, this->icon_ref_.size());
|
|
2739
|
+
#endif
|
|
2740
|
+
size.add_bool(1, this->disabled_by_default);
|
|
2741
|
+
size.add_uint32(1, static_cast<uint32_t>(this->entity_category));
|
|
2742
|
+
size.add_length(1, this->device_class_ref_.size());
|
|
2986
2743
|
if (!this->event_types.empty()) {
|
|
2987
2744
|
for (const auto &it : this->event_types) {
|
|
2988
|
-
|
|
2745
|
+
size.add_length_force(1, it.size());
|
|
2989
2746
|
}
|
|
2990
2747
|
}
|
|
2991
|
-
|
|
2748
|
+
#ifdef USE_DEVICES
|
|
2749
|
+
size.add_uint32(1, this->device_id);
|
|
2750
|
+
#endif
|
|
2992
2751
|
}
|
|
2993
2752
|
void EventResponse::encode(ProtoWriteBuffer buffer) const {
|
|
2994
2753
|
buffer.encode_fixed32(1, this->key);
|
|
2995
|
-
buffer.encode_string(2, this->
|
|
2754
|
+
buffer.encode_string(2, this->event_type_ref_);
|
|
2755
|
+
#ifdef USE_DEVICES
|
|
2996
2756
|
buffer.encode_uint32(3, this->device_id);
|
|
2757
|
+
#endif
|
|
2997
2758
|
}
|
|
2998
|
-
void EventResponse::calculate_size(
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
|
|
2759
|
+
void EventResponse::calculate_size(ProtoSize &size) const {
|
|
2760
|
+
size.add_fixed32(1, this->key);
|
|
2761
|
+
size.add_length(1, this->event_type_ref_.size());
|
|
2762
|
+
#ifdef USE_DEVICES
|
|
2763
|
+
size.add_uint32(1, this->device_id);
|
|
2764
|
+
#endif
|
|
3002
2765
|
}
|
|
3003
2766
|
#endif
|
|
3004
2767
|
#ifdef USE_VALVE
|
|
3005
2768
|
void ListEntitiesValveResponse::encode(ProtoWriteBuffer buffer) const {
|
|
3006
|
-
buffer.encode_string(1, this->
|
|
2769
|
+
buffer.encode_string(1, this->object_id_ref_);
|
|
3007
2770
|
buffer.encode_fixed32(2, this->key);
|
|
3008
|
-
buffer.encode_string(3, this->
|
|
3009
|
-
|
|
3010
|
-
buffer.encode_string(5, this->
|
|
2771
|
+
buffer.encode_string(3, this->name_ref_);
|
|
2772
|
+
#ifdef USE_ENTITY_ICON
|
|
2773
|
+
buffer.encode_string(5, this->icon_ref_);
|
|
2774
|
+
#endif
|
|
3011
2775
|
buffer.encode_bool(6, this->disabled_by_default);
|
|
3012
2776
|
buffer.encode_uint32(7, static_cast<uint32_t>(this->entity_category));
|
|
3013
|
-
buffer.encode_string(8, this->
|
|
2777
|
+
buffer.encode_string(8, this->device_class_ref_);
|
|
3014
2778
|
buffer.encode_bool(9, this->assumed_state);
|
|
3015
2779
|
buffer.encode_bool(10, this->supports_position);
|
|
3016
2780
|
buffer.encode_bool(11, this->supports_stop);
|
|
2781
|
+
#ifdef USE_DEVICES
|
|
3017
2782
|
buffer.encode_uint32(12, this->device_id);
|
|
2783
|
+
#endif
|
|
3018
2784
|
}
|
|
3019
|
-
void ListEntitiesValveResponse::calculate_size(
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
2785
|
+
void ListEntitiesValveResponse::calculate_size(ProtoSize &size) const {
|
|
2786
|
+
size.add_length(1, this->object_id_ref_.size());
|
|
2787
|
+
size.add_fixed32(1, this->key);
|
|
2788
|
+
size.add_length(1, this->name_ref_.size());
|
|
2789
|
+
#ifdef USE_ENTITY_ICON
|
|
2790
|
+
size.add_length(1, this->icon_ref_.size());
|
|
2791
|
+
#endif
|
|
2792
|
+
size.add_bool(1, this->disabled_by_default);
|
|
2793
|
+
size.add_uint32(1, static_cast<uint32_t>(this->entity_category));
|
|
2794
|
+
size.add_length(1, this->device_class_ref_.size());
|
|
2795
|
+
size.add_bool(1, this->assumed_state);
|
|
2796
|
+
size.add_bool(1, this->supports_position);
|
|
2797
|
+
size.add_bool(1, this->supports_stop);
|
|
2798
|
+
#ifdef USE_DEVICES
|
|
2799
|
+
size.add_uint32(1, this->device_id);
|
|
2800
|
+
#endif
|
|
3032
2801
|
}
|
|
3033
2802
|
void ValveStateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
3034
2803
|
buffer.encode_fixed32(1, this->key);
|
|
3035
2804
|
buffer.encode_float(2, this->position);
|
|
3036
2805
|
buffer.encode_uint32(3, static_cast<uint32_t>(this->current_operation));
|
|
2806
|
+
#ifdef USE_DEVICES
|
|
3037
2807
|
buffer.encode_uint32(4, this->device_id);
|
|
2808
|
+
#endif
|
|
3038
2809
|
}
|
|
3039
|
-
void ValveStateResponse::calculate_size(
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
2810
|
+
void ValveStateResponse::calculate_size(ProtoSize &size) const {
|
|
2811
|
+
size.add_fixed32(1, this->key);
|
|
2812
|
+
size.add_float(1, this->position);
|
|
2813
|
+
size.add_uint32(1, static_cast<uint32_t>(this->current_operation));
|
|
2814
|
+
#ifdef USE_DEVICES
|
|
2815
|
+
size.add_uint32(1, this->device_id);
|
|
2816
|
+
#endif
|
|
3044
2817
|
}
|
|
3045
2818
|
bool ValveCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
|
3046
2819
|
switch (field_id) {
|
|
3047
|
-
case 2:
|
|
2820
|
+
case 2:
|
|
3048
2821
|
this->has_position = value.as_bool();
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
case 4: {
|
|
2822
|
+
break;
|
|
2823
|
+
case 4:
|
|
3052
2824
|
this->stop = value.as_bool();
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
case 5:
|
|
2825
|
+
break;
|
|
2826
|
+
#ifdef USE_DEVICES
|
|
2827
|
+
case 5:
|
|
3056
2828
|
this->device_id = value.as_uint32();
|
|
3057
|
-
|
|
3058
|
-
|
|
2829
|
+
break;
|
|
2830
|
+
#endif
|
|
3059
2831
|
default:
|
|
3060
2832
|
return false;
|
|
3061
2833
|
}
|
|
2834
|
+
return true;
|
|
3062
2835
|
}
|
|
3063
2836
|
bool ValveCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
|
|
3064
2837
|
switch (field_id) {
|
|
3065
|
-
case 1:
|
|
2838
|
+
case 1:
|
|
3066
2839
|
this->key = value.as_fixed32();
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
case 3: {
|
|
2840
|
+
break;
|
|
2841
|
+
case 3:
|
|
3070
2842
|
this->position = value.as_float();
|
|
3071
|
-
|
|
3072
|
-
}
|
|
2843
|
+
break;
|
|
3073
2844
|
default:
|
|
3074
2845
|
return false;
|
|
3075
2846
|
}
|
|
2847
|
+
return true;
|
|
3076
2848
|
}
|
|
3077
2849
|
#endif
|
|
3078
2850
|
#ifdef USE_DATETIME_DATETIME
|
|
3079
2851
|
void ListEntitiesDateTimeResponse::encode(ProtoWriteBuffer buffer) const {
|
|
3080
|
-
buffer.encode_string(1, this->
|
|
2852
|
+
buffer.encode_string(1, this->object_id_ref_);
|
|
3081
2853
|
buffer.encode_fixed32(2, this->key);
|
|
3082
|
-
buffer.encode_string(3, this->
|
|
3083
|
-
|
|
3084
|
-
buffer.encode_string(5, this->
|
|
2854
|
+
buffer.encode_string(3, this->name_ref_);
|
|
2855
|
+
#ifdef USE_ENTITY_ICON
|
|
2856
|
+
buffer.encode_string(5, this->icon_ref_);
|
|
2857
|
+
#endif
|
|
3085
2858
|
buffer.encode_bool(6, this->disabled_by_default);
|
|
3086
2859
|
buffer.encode_uint32(7, static_cast<uint32_t>(this->entity_category));
|
|
2860
|
+
#ifdef USE_DEVICES
|
|
3087
2861
|
buffer.encode_uint32(8, this->device_id);
|
|
2862
|
+
#endif
|
|
3088
2863
|
}
|
|
3089
|
-
void ListEntitiesDateTimeResponse::calculate_size(
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
2864
|
+
void ListEntitiesDateTimeResponse::calculate_size(ProtoSize &size) const {
|
|
2865
|
+
size.add_length(1, this->object_id_ref_.size());
|
|
2866
|
+
size.add_fixed32(1, this->key);
|
|
2867
|
+
size.add_length(1, this->name_ref_.size());
|
|
2868
|
+
#ifdef USE_ENTITY_ICON
|
|
2869
|
+
size.add_length(1, this->icon_ref_.size());
|
|
2870
|
+
#endif
|
|
2871
|
+
size.add_bool(1, this->disabled_by_default);
|
|
2872
|
+
size.add_uint32(1, static_cast<uint32_t>(this->entity_category));
|
|
2873
|
+
#ifdef USE_DEVICES
|
|
2874
|
+
size.add_uint32(1, this->device_id);
|
|
2875
|
+
#endif
|
|
3098
2876
|
}
|
|
3099
2877
|
void DateTimeStateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
3100
2878
|
buffer.encode_fixed32(1, this->key);
|
|
3101
2879
|
buffer.encode_bool(2, this->missing_state);
|
|
3102
2880
|
buffer.encode_fixed32(3, this->epoch_seconds);
|
|
2881
|
+
#ifdef USE_DEVICES
|
|
3103
2882
|
buffer.encode_uint32(4, this->device_id);
|
|
2883
|
+
#endif
|
|
3104
2884
|
}
|
|
3105
|
-
void DateTimeStateResponse::calculate_size(
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
2885
|
+
void DateTimeStateResponse::calculate_size(ProtoSize &size) const {
|
|
2886
|
+
size.add_fixed32(1, this->key);
|
|
2887
|
+
size.add_bool(1, this->missing_state);
|
|
2888
|
+
size.add_fixed32(1, this->epoch_seconds);
|
|
2889
|
+
#ifdef USE_DEVICES
|
|
2890
|
+
size.add_uint32(1, this->device_id);
|
|
2891
|
+
#endif
|
|
3110
2892
|
}
|
|
3111
2893
|
bool DateTimeCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
|
3112
2894
|
switch (field_id) {
|
|
3113
|
-
|
|
2895
|
+
#ifdef USE_DEVICES
|
|
2896
|
+
case 3:
|
|
3114
2897
|
this->device_id = value.as_uint32();
|
|
3115
|
-
|
|
3116
|
-
|
|
2898
|
+
break;
|
|
2899
|
+
#endif
|
|
3117
2900
|
default:
|
|
3118
2901
|
return false;
|
|
3119
2902
|
}
|
|
2903
|
+
return true;
|
|
3120
2904
|
}
|
|
3121
2905
|
bool DateTimeCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
|
|
3122
2906
|
switch (field_id) {
|
|
3123
|
-
case 1:
|
|
2907
|
+
case 1:
|
|
3124
2908
|
this->key = value.as_fixed32();
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
case 2: {
|
|
2909
|
+
break;
|
|
2910
|
+
case 2:
|
|
3128
2911
|
this->epoch_seconds = value.as_fixed32();
|
|
3129
|
-
|
|
3130
|
-
}
|
|
2912
|
+
break;
|
|
3131
2913
|
default:
|
|
3132
2914
|
return false;
|
|
3133
2915
|
}
|
|
2916
|
+
return true;
|
|
3134
2917
|
}
|
|
3135
2918
|
#endif
|
|
3136
2919
|
#ifdef USE_UPDATE
|
|
3137
2920
|
void ListEntitiesUpdateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
3138
|
-
buffer.encode_string(1, this->
|
|
2921
|
+
buffer.encode_string(1, this->object_id_ref_);
|
|
3139
2922
|
buffer.encode_fixed32(2, this->key);
|
|
3140
|
-
buffer.encode_string(3, this->
|
|
3141
|
-
|
|
3142
|
-
buffer.encode_string(5, this->
|
|
2923
|
+
buffer.encode_string(3, this->name_ref_);
|
|
2924
|
+
#ifdef USE_ENTITY_ICON
|
|
2925
|
+
buffer.encode_string(5, this->icon_ref_);
|
|
2926
|
+
#endif
|
|
3143
2927
|
buffer.encode_bool(6, this->disabled_by_default);
|
|
3144
2928
|
buffer.encode_uint32(7, static_cast<uint32_t>(this->entity_category));
|
|
3145
|
-
buffer.encode_string(8, this->
|
|
2929
|
+
buffer.encode_string(8, this->device_class_ref_);
|
|
2930
|
+
#ifdef USE_DEVICES
|
|
3146
2931
|
buffer.encode_uint32(9, this->device_id);
|
|
2932
|
+
#endif
|
|
3147
2933
|
}
|
|
3148
|
-
void ListEntitiesUpdateResponse::calculate_size(
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
2934
|
+
void ListEntitiesUpdateResponse::calculate_size(ProtoSize &size) const {
|
|
2935
|
+
size.add_length(1, this->object_id_ref_.size());
|
|
2936
|
+
size.add_fixed32(1, this->key);
|
|
2937
|
+
size.add_length(1, this->name_ref_.size());
|
|
2938
|
+
#ifdef USE_ENTITY_ICON
|
|
2939
|
+
size.add_length(1, this->icon_ref_.size());
|
|
2940
|
+
#endif
|
|
2941
|
+
size.add_bool(1, this->disabled_by_default);
|
|
2942
|
+
size.add_uint32(1, static_cast<uint32_t>(this->entity_category));
|
|
2943
|
+
size.add_length(1, this->device_class_ref_.size());
|
|
2944
|
+
#ifdef USE_DEVICES
|
|
2945
|
+
size.add_uint32(1, this->device_id);
|
|
2946
|
+
#endif
|
|
3158
2947
|
}
|
|
3159
2948
|
void UpdateStateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
3160
2949
|
buffer.encode_fixed32(1, this->key);
|
|
@@ -3162,51 +2951,55 @@ void UpdateStateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
3162
2951
|
buffer.encode_bool(3, this->in_progress);
|
|
3163
2952
|
buffer.encode_bool(4, this->has_progress);
|
|
3164
2953
|
buffer.encode_float(5, this->progress);
|
|
3165
|
-
buffer.encode_string(6, this->
|
|
3166
|
-
buffer.encode_string(7, this->
|
|
3167
|
-
buffer.encode_string(8, this->
|
|
3168
|
-
buffer.encode_string(9, this->
|
|
3169
|
-
buffer.encode_string(10, this->
|
|
2954
|
+
buffer.encode_string(6, this->current_version_ref_);
|
|
2955
|
+
buffer.encode_string(7, this->latest_version_ref_);
|
|
2956
|
+
buffer.encode_string(8, this->title_ref_);
|
|
2957
|
+
buffer.encode_string(9, this->release_summary_ref_);
|
|
2958
|
+
buffer.encode_string(10, this->release_url_ref_);
|
|
2959
|
+
#ifdef USE_DEVICES
|
|
3170
2960
|
buffer.encode_uint32(11, this->device_id);
|
|
2961
|
+
#endif
|
|
3171
2962
|
}
|
|
3172
|
-
void UpdateStateResponse::calculate_size(
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
2963
|
+
void UpdateStateResponse::calculate_size(ProtoSize &size) const {
|
|
2964
|
+
size.add_fixed32(1, this->key);
|
|
2965
|
+
size.add_bool(1, this->missing_state);
|
|
2966
|
+
size.add_bool(1, this->in_progress);
|
|
2967
|
+
size.add_bool(1, this->has_progress);
|
|
2968
|
+
size.add_float(1, this->progress);
|
|
2969
|
+
size.add_length(1, this->current_version_ref_.size());
|
|
2970
|
+
size.add_length(1, this->latest_version_ref_.size());
|
|
2971
|
+
size.add_length(1, this->title_ref_.size());
|
|
2972
|
+
size.add_length(1, this->release_summary_ref_.size());
|
|
2973
|
+
size.add_length(1, this->release_url_ref_.size());
|
|
2974
|
+
#ifdef USE_DEVICES
|
|
2975
|
+
size.add_uint32(1, this->device_id);
|
|
2976
|
+
#endif
|
|
3184
2977
|
}
|
|
3185
2978
|
bool UpdateCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
|
3186
2979
|
switch (field_id) {
|
|
3187
|
-
case 2:
|
|
2980
|
+
case 2:
|
|
3188
2981
|
this->command = static_cast<enums::UpdateCommand>(value.as_uint32());
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
case 3:
|
|
2982
|
+
break;
|
|
2983
|
+
#ifdef USE_DEVICES
|
|
2984
|
+
case 3:
|
|
3192
2985
|
this->device_id = value.as_uint32();
|
|
3193
|
-
|
|
3194
|
-
|
|
2986
|
+
break;
|
|
2987
|
+
#endif
|
|
3195
2988
|
default:
|
|
3196
2989
|
return false;
|
|
3197
2990
|
}
|
|
2991
|
+
return true;
|
|
3198
2992
|
}
|
|
3199
2993
|
bool UpdateCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
|
|
3200
2994
|
switch (field_id) {
|
|
3201
|
-
case 1:
|
|
2995
|
+
case 1:
|
|
3202
2996
|
this->key = value.as_fixed32();
|
|
3203
|
-
|
|
3204
|
-
}
|
|
2997
|
+
break;
|
|
3205
2998
|
default:
|
|
3206
2999
|
return false;
|
|
3207
3000
|
}
|
|
3001
|
+
return true;
|
|
3208
3002
|
}
|
|
3209
3003
|
#endif
|
|
3210
3004
|
|
|
3211
|
-
} // namespace api
|
|
3212
|
-
} // namespace esphome
|
|
3005
|
+
} // namespace esphome::api
|