mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-31 15:12:06 +00:00 
			
		
		
		
	cleanups to address review comments
This commit is contained in:
		| @@ -188,10 +188,15 @@ message DeviceInfoRequest { | |||||||
|   // Empty |   // Empty | ||||||
| } | } | ||||||
|  |  | ||||||
| message SubDeviceInfo { | message SubAreaInfo { | ||||||
|   uint32 uid = 1; |   uint32 area_id = 1; | ||||||
|   string name = 2; |   string name = 2; | ||||||
|   string suggested_area = 3; | } | ||||||
|  |  | ||||||
|  | message SubDeviceInfo { | ||||||
|  |   uint32 device_id = 1; | ||||||
|  |   string name = 2; | ||||||
|  |   uint32 area_id = 3; | ||||||
| } | } | ||||||
|  |  | ||||||
| message DeviceInfoResponse { | message DeviceInfoResponse { | ||||||
| @@ -244,6 +249,7 @@ message DeviceInfoResponse { | |||||||
|   bool api_encryption_supported = 19; |   bool api_encryption_supported = 19; | ||||||
|  |  | ||||||
|   repeated SubDeviceInfo sub_devices = 20; |   repeated SubDeviceInfo sub_devices = 20; | ||||||
|  |   repeated SubAreaInfo sub_areas = 21; | ||||||
| } | } | ||||||
|  |  | ||||||
| message ListEntitiesRequest { | message ListEntitiesRequest { | ||||||
| @@ -288,7 +294,7 @@ message ListEntitiesBinarySensorResponse { | |||||||
|   bool disabled_by_default = 7; |   bool disabled_by_default = 7; | ||||||
|   string icon = 8; |   string icon = 8; | ||||||
|   EntityCategory entity_category = 9; |   EntityCategory entity_category = 9; | ||||||
|   uint32 device_uid = 10; |   uint32 device_id = 10; | ||||||
| } | } | ||||||
| message BinarySensorStateResponse { | message BinarySensorStateResponse { | ||||||
|   option (id) = 21; |   option (id) = 21; | ||||||
| @@ -324,7 +330,7 @@ message ListEntitiesCoverResponse { | |||||||
|   string icon = 10; |   string icon = 10; | ||||||
|   EntityCategory entity_category = 11; |   EntityCategory entity_category = 11; | ||||||
|   bool supports_stop = 12; |   bool supports_stop = 12; | ||||||
|   uint32 device_uid = 13; |   uint32 device_id = 13; | ||||||
| } | } | ||||||
|  |  | ||||||
| enum LegacyCoverState { | enum LegacyCoverState { | ||||||
| @@ -398,7 +404,7 @@ message ListEntitiesFanResponse { | |||||||
|   string icon = 10; |   string icon = 10; | ||||||
|   EntityCategory entity_category = 11; |   EntityCategory entity_category = 11; | ||||||
|   repeated string supported_preset_modes = 12; |   repeated string supported_preset_modes = 12; | ||||||
|   uint32 device_uid = 13; |   uint32 device_id = 13; | ||||||
| } | } | ||||||
| enum FanSpeed { | enum FanSpeed { | ||||||
|   FAN_SPEED_LOW = 0; |   FAN_SPEED_LOW = 0; | ||||||
| @@ -482,7 +488,7 @@ message ListEntitiesLightResponse { | |||||||
|   bool disabled_by_default = 13; |   bool disabled_by_default = 13; | ||||||
|   string icon = 14; |   string icon = 14; | ||||||
|   EntityCategory entity_category = 15; |   EntityCategory entity_category = 15; | ||||||
|   uint32 device_uid = 16; |   uint32 device_id = 16; | ||||||
| } | } | ||||||
| message LightStateResponse { | message LightStateResponse { | ||||||
|   option (id) = 24; |   option (id) = 24; | ||||||
| @@ -575,7 +581,7 @@ message ListEntitiesSensorResponse { | |||||||
|   SensorLastResetType legacy_last_reset_type = 11; |   SensorLastResetType legacy_last_reset_type = 11; | ||||||
|   bool disabled_by_default = 12; |   bool disabled_by_default = 12; | ||||||
|   EntityCategory entity_category = 13; |   EntityCategory entity_category = 13; | ||||||
|   uint32 device_uid = 14; |   uint32 device_id = 14; | ||||||
| } | } | ||||||
| message SensorStateResponse { | message SensorStateResponse { | ||||||
|   option (id) = 25; |   option (id) = 25; | ||||||
| @@ -608,7 +614,7 @@ message ListEntitiesSwitchResponse { | |||||||
|   bool disabled_by_default = 7; |   bool disabled_by_default = 7; | ||||||
|   EntityCategory entity_category = 8; |   EntityCategory entity_category = 8; | ||||||
|   string device_class = 9; |   string device_class = 9; | ||||||
|   uint32 device_uid = 10; |   uint32 device_id = 10; | ||||||
| } | } | ||||||
| message SwitchStateResponse { | message SwitchStateResponse { | ||||||
|   option (id) = 26; |   option (id) = 26; | ||||||
| @@ -646,7 +652,7 @@ message ListEntitiesTextSensorResponse { | |||||||
|   bool disabled_by_default = 6; |   bool disabled_by_default = 6; | ||||||
|   EntityCategory entity_category = 7; |   EntityCategory entity_category = 7; | ||||||
|   string device_class = 8; |   string device_class = 8; | ||||||
|   uint32 device_uid = 9; |   uint32 device_id = 9; | ||||||
| } | } | ||||||
| message TextSensorStateResponse { | message TextSensorStateResponse { | ||||||
|   option (id) = 27; |   option (id) = 27; | ||||||
| @@ -829,7 +835,7 @@ message ListEntitiesCameraResponse { | |||||||
|   bool disabled_by_default = 5; |   bool disabled_by_default = 5; | ||||||
|   string icon = 6; |   string icon = 6; | ||||||
|   EntityCategory entity_category = 7; |   EntityCategory entity_category = 7; | ||||||
|   uint32 device_uid = 8; |   uint32 device_id = 8; | ||||||
| } | } | ||||||
|  |  | ||||||
| message CameraImageResponse { | message CameraImageResponse { | ||||||
| @@ -932,7 +938,7 @@ message ListEntitiesClimateResponse { | |||||||
|   bool supports_target_humidity = 23; |   bool supports_target_humidity = 23; | ||||||
|   float visual_min_humidity = 24; |   float visual_min_humidity = 24; | ||||||
|   float visual_max_humidity = 25; |   float visual_max_humidity = 25; | ||||||
|   uint32 device_uid = 26; |   uint32 device_id = 26; | ||||||
| } | } | ||||||
| message ClimateStateResponse { | message ClimateStateResponse { | ||||||
|   option (id) = 47; |   option (id) = 47; | ||||||
| @@ -1016,7 +1022,7 @@ message ListEntitiesNumberResponse { | |||||||
|   string unit_of_measurement = 11; |   string unit_of_measurement = 11; | ||||||
|   NumberMode mode = 12; |   NumberMode mode = 12; | ||||||
|   string device_class = 13; |   string device_class = 13; | ||||||
|   uint32 device_uid = 14; |   uint32 device_id = 14; | ||||||
| } | } | ||||||
| message NumberStateResponse { | message NumberStateResponse { | ||||||
|   option (id) = 50; |   option (id) = 50; | ||||||
| @@ -1057,7 +1063,7 @@ message ListEntitiesSelectResponse { | |||||||
|   repeated string options = 6; |   repeated string options = 6; | ||||||
|   bool disabled_by_default = 7; |   bool disabled_by_default = 7; | ||||||
|   EntityCategory entity_category = 8; |   EntityCategory entity_category = 8; | ||||||
|   uint32 device_uid = 9; |   uint32 device_id = 9; | ||||||
| } | } | ||||||
| message SelectStateResponse { | message SelectStateResponse { | ||||||
|   option (id) = 53; |   option (id) = 53; | ||||||
| @@ -1163,7 +1169,7 @@ message ListEntitiesLockResponse { | |||||||
|  |  | ||||||
|   // Not yet implemented: |   // Not yet implemented: | ||||||
|   string code_format = 11; |   string code_format = 11; | ||||||
|   uint32 device_uid = 12; |   uint32 device_id = 12; | ||||||
| } | } | ||||||
| message LockStateResponse { | message LockStateResponse { | ||||||
|   option (id) = 59; |   option (id) = 59; | ||||||
| @@ -1203,7 +1209,7 @@ message ListEntitiesButtonResponse { | |||||||
|   bool disabled_by_default = 6; |   bool disabled_by_default = 6; | ||||||
|   EntityCategory entity_category = 7; |   EntityCategory entity_category = 7; | ||||||
|   string device_class = 8; |   string device_class = 8; | ||||||
|   uint32 device_uid = 9; |   uint32 device_id = 9; | ||||||
| } | } | ||||||
| message ButtonCommandRequest { | message ButtonCommandRequest { | ||||||
|   option (id) = 62; |   option (id) = 62; | ||||||
| @@ -1260,7 +1266,7 @@ message ListEntitiesMediaPlayerResponse { | |||||||
|  |  | ||||||
|   repeated MediaPlayerSupportedFormat supported_formats = 9; |   repeated MediaPlayerSupportedFormat supported_formats = 9; | ||||||
|  |  | ||||||
|   uint32 device_uid = 10; |   uint32 device_id = 10; | ||||||
| } | } | ||||||
| message MediaPlayerStateResponse { | message MediaPlayerStateResponse { | ||||||
|   option (id) = 64; |   option (id) = 64; | ||||||
| @@ -1801,7 +1807,7 @@ message ListEntitiesAlarmControlPanelResponse { | |||||||
|   uint32 supported_features = 8; |   uint32 supported_features = 8; | ||||||
|   bool requires_code = 9; |   bool requires_code = 9; | ||||||
|   bool requires_code_to_arm = 10; |   bool requires_code_to_arm = 10; | ||||||
|   uint32 device_uid = 11; |   uint32 device_id = 11; | ||||||
| } | } | ||||||
|  |  | ||||||
| message AlarmControlPanelStateResponse { | message AlarmControlPanelStateResponse { | ||||||
| @@ -1847,7 +1853,7 @@ message ListEntitiesTextResponse { | |||||||
|   uint32 max_length = 9; |   uint32 max_length = 9; | ||||||
|   string pattern = 10; |   string pattern = 10; | ||||||
|   TextMode mode = 11; |   TextMode mode = 11; | ||||||
|   uint32 device_uid = 12; |   uint32 device_id = 12; | ||||||
| } | } | ||||||
| message TextStateResponse { | message TextStateResponse { | ||||||
|   option (id) = 98; |   option (id) = 98; | ||||||
| @@ -1888,7 +1894,7 @@ message ListEntitiesDateResponse { | |||||||
|   string icon = 5; |   string icon = 5; | ||||||
|   bool disabled_by_default = 6; |   bool disabled_by_default = 6; | ||||||
|   EntityCategory entity_category = 7; |   EntityCategory entity_category = 7; | ||||||
|   uint32 device_uid = 8; |   uint32 device_id = 8; | ||||||
| } | } | ||||||
| message DateStateResponse { | message DateStateResponse { | ||||||
|   option (id) = 101; |   option (id) = 101; | ||||||
| @@ -1932,7 +1938,7 @@ message ListEntitiesTimeResponse { | |||||||
|   string icon = 5; |   string icon = 5; | ||||||
|   bool disabled_by_default = 6; |   bool disabled_by_default = 6; | ||||||
|   EntityCategory entity_category = 7; |   EntityCategory entity_category = 7; | ||||||
|   uint32 device_uid = 8; |   uint32 device_id = 8; | ||||||
| } | } | ||||||
| message TimeStateResponse { | message TimeStateResponse { | ||||||
|   option (id) = 104; |   option (id) = 104; | ||||||
| @@ -1979,7 +1985,7 @@ message ListEntitiesEventResponse { | |||||||
|   string device_class = 8; |   string device_class = 8; | ||||||
|  |  | ||||||
|   repeated string event_types = 9; |   repeated string event_types = 9; | ||||||
|   uint32 device_uid = 10; |   uint32 device_id = 10; | ||||||
| } | } | ||||||
| message EventResponse { | message EventResponse { | ||||||
|   option (id) = 108; |   option (id) = 108; | ||||||
| @@ -2011,7 +2017,7 @@ message ListEntitiesValveResponse { | |||||||
|   bool assumed_state = 9; |   bool assumed_state = 9; | ||||||
|   bool supports_position = 10; |   bool supports_position = 10; | ||||||
|   bool supports_stop = 11; |   bool supports_stop = 11; | ||||||
|   uint32 device_uid = 12; |   uint32 device_id = 12; | ||||||
| } | } | ||||||
|  |  | ||||||
| enum ValveOperation { | enum ValveOperation { | ||||||
| @@ -2058,7 +2064,7 @@ message ListEntitiesDateTimeResponse { | |||||||
|   string icon = 5; |   string icon = 5; | ||||||
|   bool disabled_by_default = 6; |   bool disabled_by_default = 6; | ||||||
|   EntityCategory entity_category = 7; |   EntityCategory entity_category = 7; | ||||||
|   uint32 device_uid = 8; |   uint32 device_id = 8; | ||||||
| } | } | ||||||
| message DateTimeStateResponse { | message DateTimeStateResponse { | ||||||
|   option (id) = 113; |   option (id) = 113; | ||||||
| @@ -2099,7 +2105,7 @@ message ListEntitiesUpdateResponse { | |||||||
|   bool disabled_by_default = 6; |   bool disabled_by_default = 6; | ||||||
|   EntityCategory entity_category = 7; |   EntityCategory entity_category = 7; | ||||||
|   string device_class = 8; |   string device_class = 8; | ||||||
|   uint32 device_uid = 9; |   uint32 device_id = 9; | ||||||
| } | } | ||||||
| message UpdateStateResponse { | message UpdateStateResponse { | ||||||
|   option (id) = 117; |   option (id) = 117; | ||||||
|   | |||||||
| @@ -311,7 +311,6 @@ uint16_t APIConnection::try_send_binary_sensor_info(EntityBase *entity, APIConne | |||||||
|   ListEntitiesBinarySensorResponse msg; |   ListEntitiesBinarySensorResponse msg; | ||||||
|   msg.device_class = binary_sensor->get_device_class(); |   msg.device_class = binary_sensor->get_device_class(); | ||||||
|   msg.is_status_binary_sensor = binary_sensor->is_status_binary_sensor(); |   msg.is_status_binary_sensor = binary_sensor->is_status_binary_sensor(); | ||||||
|   msg.device_uid = binary_sensor->get_device_uid(); |  | ||||||
|   msg.unique_id = get_default_unique_id("binary_sensor", binary_sensor); |   msg.unique_id = get_default_unique_id("binary_sensor", binary_sensor); | ||||||
|   fill_entity_info_base(binary_sensor, msg); |   fill_entity_info_base(binary_sensor, msg); | ||||||
|   return encode_message_to_buffer(msg, ListEntitiesBinarySensorResponse::MESSAGE_TYPE, conn, remaining_size, is_single); |   return encode_message_to_buffer(msg, ListEntitiesBinarySensorResponse::MESSAGE_TYPE, conn, remaining_size, is_single); | ||||||
| @@ -349,7 +348,6 @@ uint16_t APIConnection::try_send_cover_info(EntityBase *entity, APIConnection *c | |||||||
|   msg.supports_tilt = traits.get_supports_tilt(); |   msg.supports_tilt = traits.get_supports_tilt(); | ||||||
|   msg.supports_stop = traits.get_supports_stop(); |   msg.supports_stop = traits.get_supports_stop(); | ||||||
|   msg.device_class = cover->get_device_class(); |   msg.device_class = cover->get_device_class(); | ||||||
|   msg.device_uid = cover->get_device_uid(); |  | ||||||
|   msg.unique_id = get_default_unique_id("cover", cover); |   msg.unique_id = get_default_unique_id("cover", cover); | ||||||
|   fill_entity_info_base(cover, msg); |   fill_entity_info_base(cover, msg); | ||||||
|   return encode_message_to_buffer(msg, ListEntitiesCoverResponse::MESSAGE_TYPE, conn, remaining_size, is_single); |   return encode_message_to_buffer(msg, ListEntitiesCoverResponse::MESSAGE_TYPE, conn, remaining_size, is_single); | ||||||
| @@ -419,7 +417,6 @@ uint16_t APIConnection::try_send_fan_info(EntityBase *entity, APIConnection *con | |||||||
|   msg.supported_speed_count = traits.supported_speed_count(); |   msg.supported_speed_count = traits.supported_speed_count(); | ||||||
|   for (auto const &preset : traits.supported_preset_modes()) |   for (auto const &preset : traits.supported_preset_modes()) | ||||||
|     msg.supported_preset_modes.push_back(preset); |     msg.supported_preset_modes.push_back(preset); | ||||||
|   msg.device_uid = fan->get_device_uid(); |  | ||||||
|   msg.unique_id = get_default_unique_id("fan", fan); |   msg.unique_id = get_default_unique_id("fan", fan); | ||||||
|   fill_entity_info_base(fan, msg); |   fill_entity_info_base(fan, msg); | ||||||
|   return encode_message_to_buffer(msg, ListEntitiesFanResponse::MESSAGE_TYPE, conn, remaining_size, is_single); |   return encode_message_to_buffer(msg, ListEntitiesFanResponse::MESSAGE_TYPE, conn, remaining_size, is_single); | ||||||
| @@ -500,7 +497,6 @@ uint16_t APIConnection::try_send_light_info(EntityBase *entity, APIConnection *c | |||||||
|       msg.effects.push_back(effect->get_name()); |       msg.effects.push_back(effect->get_name()); | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
|   msg.device_uid = light->get_device_uid(); |  | ||||||
|   msg.unique_id = get_default_unique_id("light", light); |   msg.unique_id = get_default_unique_id("light", light); | ||||||
|   fill_entity_info_base(light, msg); |   fill_entity_info_base(light, msg); | ||||||
|   return encode_message_to_buffer(msg, ListEntitiesLightResponse::MESSAGE_TYPE, conn, remaining_size, is_single); |   return encode_message_to_buffer(msg, ListEntitiesLightResponse::MESSAGE_TYPE, conn, remaining_size, is_single); | ||||||
| @@ -569,7 +565,6 @@ uint16_t APIConnection::try_send_sensor_info(EntityBase *entity, APIConnection * | |||||||
|   msg.force_update = sensor->get_force_update(); |   msg.force_update = sensor->get_force_update(); | ||||||
|   msg.device_class = sensor->get_device_class(); |   msg.device_class = sensor->get_device_class(); | ||||||
|   msg.state_class = static_cast<enums::SensorStateClass>(sensor->get_state_class()); |   msg.state_class = static_cast<enums::SensorStateClass>(sensor->get_state_class()); | ||||||
|   msg.device_uid = sensor->get_device_uid(); |  | ||||||
|   msg.unique_id = sensor->unique_id(); |   msg.unique_id = sensor->unique_id(); | ||||||
|   if (msg.unique_id.empty()) |   if (msg.unique_id.empty()) | ||||||
|     msg.unique_id = get_default_unique_id("sensor", sensor); |     msg.unique_id = get_default_unique_id("sensor", sensor); | ||||||
| @@ -601,7 +596,6 @@ uint16_t APIConnection::try_send_switch_info(EntityBase *entity, APIConnection * | |||||||
|   ListEntitiesSwitchResponse msg; |   ListEntitiesSwitchResponse msg; | ||||||
|   msg.assumed_state = a_switch->assumed_state(); |   msg.assumed_state = a_switch->assumed_state(); | ||||||
|   msg.device_class = a_switch->get_device_class(); |   msg.device_class = a_switch->get_device_class(); | ||||||
|   msg.device_uid = a_switch->get_device_uid(); |  | ||||||
|   msg.unique_id = get_default_unique_id("switch", a_switch); |   msg.unique_id = get_default_unique_id("switch", a_switch); | ||||||
|   fill_entity_info_base(a_switch, msg); |   fill_entity_info_base(a_switch, msg); | ||||||
|   return encode_message_to_buffer(msg, ListEntitiesSwitchResponse::MESSAGE_TYPE, conn, remaining_size, is_single); |   return encode_message_to_buffer(msg, ListEntitiesSwitchResponse::MESSAGE_TYPE, conn, remaining_size, is_single); | ||||||
| @@ -644,7 +638,6 @@ uint16_t APIConnection::try_send_text_sensor_info(EntityBase *entity, APIConnect | |||||||
|   ListEntitiesTextSensorResponse msg; |   ListEntitiesTextSensorResponse msg; | ||||||
|   msg.device_class = text_sensor->get_device_class(); |   msg.device_class = text_sensor->get_device_class(); | ||||||
|   msg.unique_id = text_sensor->unique_id(); |   msg.unique_id = text_sensor->unique_id(); | ||||||
|   msg.device_uid = text_sensor->get_device_uid(); |  | ||||||
|   if (msg.unique_id.empty()) |   if (msg.unique_id.empty()) | ||||||
|     msg.unique_id = get_default_unique_id("text_sensor", text_sensor); |     msg.unique_id = get_default_unique_id("text_sensor", text_sensor); | ||||||
|   fill_entity_info_base(text_sensor, msg); |   fill_entity_info_base(text_sensor, msg); | ||||||
| @@ -721,7 +714,6 @@ uint16_t APIConnection::try_send_climate_info(EntityBase *entity, APIConnection | |||||||
|     msg.supported_custom_presets.push_back(custom_preset); |     msg.supported_custom_presets.push_back(custom_preset); | ||||||
|   for (auto swing_mode : traits.get_supported_swing_modes()) |   for (auto swing_mode : traits.get_supported_swing_modes()) | ||||||
|     msg.supported_swing_modes.push_back(static_cast<enums::ClimateSwingMode>(swing_mode)); |     msg.supported_swing_modes.push_back(static_cast<enums::ClimateSwingMode>(swing_mode)); | ||||||
|   msg.device_uid = climate->get_device_uid(); |  | ||||||
|   msg.unique_id = get_default_unique_id("climate", climate); |   msg.unique_id = get_default_unique_id("climate", climate); | ||||||
|   fill_entity_info_base(climate, msg); |   fill_entity_info_base(climate, msg); | ||||||
|   return encode_message_to_buffer(msg, ListEntitiesClimateResponse::MESSAGE_TYPE, conn, remaining_size, is_single); |   return encode_message_to_buffer(msg, ListEntitiesClimateResponse::MESSAGE_TYPE, conn, remaining_size, is_single); | ||||||
| @@ -784,7 +776,6 @@ uint16_t APIConnection::try_send_number_info(EntityBase *entity, APIConnection * | |||||||
|   msg.min_value = number->traits.get_min_value(); |   msg.min_value = number->traits.get_min_value(); | ||||||
|   msg.max_value = number->traits.get_max_value(); |   msg.max_value = number->traits.get_max_value(); | ||||||
|   msg.step = number->traits.get_step(); |   msg.step = number->traits.get_step(); | ||||||
|   msg.device_uid = number->get_device_uid(); |  | ||||||
|   msg.unique_id = get_default_unique_id("number", number); |   msg.unique_id = get_default_unique_id("number", number); | ||||||
|   fill_entity_info_base(number, msg); |   fill_entity_info_base(number, msg); | ||||||
|   return encode_message_to_buffer(msg, ListEntitiesNumberResponse::MESSAGE_TYPE, conn, remaining_size, is_single); |   return encode_message_to_buffer(msg, ListEntitiesNumberResponse::MESSAGE_TYPE, conn, remaining_size, is_single); | ||||||
| @@ -822,7 +813,6 @@ uint16_t APIConnection::try_send_date_info(EntityBase *entity, APIConnection *co | |||||||
|                                            bool is_single) { |                                            bool is_single) { | ||||||
|   auto *date = static_cast<datetime::DateEntity *>(entity); |   auto *date = static_cast<datetime::DateEntity *>(entity); | ||||||
|   ListEntitiesDateResponse msg; |   ListEntitiesDateResponse msg; | ||||||
|   msg.device_uid = date->get_device_uid(); |  | ||||||
|   msg.unique_id = get_default_unique_id("date", date); |   msg.unique_id = get_default_unique_id("date", date); | ||||||
|   fill_entity_info_base(date, msg); |   fill_entity_info_base(date, msg); | ||||||
|   return encode_message_to_buffer(msg, ListEntitiesDateResponse::MESSAGE_TYPE, conn, remaining_size, is_single); |   return encode_message_to_buffer(msg, ListEntitiesDateResponse::MESSAGE_TYPE, conn, remaining_size, is_single); | ||||||
| @@ -860,7 +850,6 @@ uint16_t APIConnection::try_send_time_info(EntityBase *entity, APIConnection *co | |||||||
|                                            bool is_single) { |                                            bool is_single) { | ||||||
|   auto *time = static_cast<datetime::TimeEntity *>(entity); |   auto *time = static_cast<datetime::TimeEntity *>(entity); | ||||||
|   ListEntitiesTimeResponse msg; |   ListEntitiesTimeResponse msg; | ||||||
|   msg.device_uid = time->get_device_uid(); |  | ||||||
|   msg.unique_id = get_default_unique_id("time", time); |   msg.unique_id = get_default_unique_id("time", time); | ||||||
|   fill_entity_info_base(time, msg); |   fill_entity_info_base(time, msg); | ||||||
|   return encode_message_to_buffer(msg, ListEntitiesTimeResponse::MESSAGE_TYPE, conn, remaining_size, is_single); |   return encode_message_to_buffer(msg, ListEntitiesTimeResponse::MESSAGE_TYPE, conn, remaining_size, is_single); | ||||||
| @@ -900,7 +889,6 @@ uint16_t APIConnection::try_send_datetime_info(EntityBase *entity, APIConnection | |||||||
|                                                bool is_single) { |                                                bool is_single) { | ||||||
|   auto *datetime = static_cast<datetime::DateTimeEntity *>(entity); |   auto *datetime = static_cast<datetime::DateTimeEntity *>(entity); | ||||||
|   ListEntitiesDateTimeResponse msg; |   ListEntitiesDateTimeResponse msg; | ||||||
|   msg.device_uid = datetime->get_device_uid(); |  | ||||||
|   msg.unique_id = get_default_unique_id("datetime", datetime); |   msg.unique_id = get_default_unique_id("datetime", datetime); | ||||||
|   fill_entity_info_base(datetime, msg); |   fill_entity_info_base(datetime, msg); | ||||||
|   return encode_message_to_buffer(msg, ListEntitiesDateTimeResponse::MESSAGE_TYPE, conn, remaining_size, is_single); |   return encode_message_to_buffer(msg, ListEntitiesDateTimeResponse::MESSAGE_TYPE, conn, remaining_size, is_single); | ||||||
| @@ -942,7 +930,6 @@ uint16_t APIConnection::try_send_text_info(EntityBase *entity, APIConnection *co | |||||||
|   msg.min_length = text->traits.get_min_length(); |   msg.min_length = text->traits.get_min_length(); | ||||||
|   msg.max_length = text->traits.get_max_length(); |   msg.max_length = text->traits.get_max_length(); | ||||||
|   msg.pattern = text->traits.get_pattern(); |   msg.pattern = text->traits.get_pattern(); | ||||||
|   msg.device_uid = text->get_device_uid(); |  | ||||||
|   msg.unique_id = get_default_unique_id("text", text); |   msg.unique_id = get_default_unique_id("text", text); | ||||||
|   fill_entity_info_base(text, msg); |   fill_entity_info_base(text, msg); | ||||||
|   return encode_message_to_buffer(msg, ListEntitiesTextResponse::MESSAGE_TYPE, conn, remaining_size, is_single); |   return encode_message_to_buffer(msg, ListEntitiesTextResponse::MESSAGE_TYPE, conn, remaining_size, is_single); | ||||||
| @@ -982,7 +969,6 @@ uint16_t APIConnection::try_send_select_info(EntityBase *entity, APIConnection * | |||||||
|   ListEntitiesSelectResponse msg; |   ListEntitiesSelectResponse msg; | ||||||
|   for (const auto &option : select->traits.get_options()) |   for (const auto &option : select->traits.get_options()) | ||||||
|     msg.options.push_back(option); |     msg.options.push_back(option); | ||||||
|   msg.device_uid = select->get_device_uid(); |  | ||||||
|   msg.unique_id = get_default_unique_id("select", select); |   msg.unique_id = get_default_unique_id("select", select); | ||||||
|   fill_entity_info_base(select, msg); |   fill_entity_info_base(select, msg); | ||||||
|   return encode_message_to_buffer(msg, ListEntitiesSelectResponse::MESSAGE_TYPE, conn, remaining_size, is_single); |   return encode_message_to_buffer(msg, ListEntitiesSelectResponse::MESSAGE_TYPE, conn, remaining_size, is_single); | ||||||
| @@ -1007,7 +993,6 @@ uint16_t APIConnection::try_send_button_info(EntityBase *entity, APIConnection * | |||||||
|   auto *button = static_cast<button::Button *>(entity); |   auto *button = static_cast<button::Button *>(entity); | ||||||
|   ListEntitiesButtonResponse msg; |   ListEntitiesButtonResponse msg; | ||||||
|   msg.device_class = button->get_device_class(); |   msg.device_class = button->get_device_class(); | ||||||
|   msg.device_uid = button->get_device_uid(); |  | ||||||
|   msg.unique_id = get_default_unique_id("button", button); |   msg.unique_id = get_default_unique_id("button", button); | ||||||
|   fill_entity_info_base(button, msg); |   fill_entity_info_base(button, msg); | ||||||
|   return encode_message_to_buffer(msg, ListEntitiesButtonResponse::MESSAGE_TYPE, conn, remaining_size, is_single); |   return encode_message_to_buffer(msg, ListEntitiesButtonResponse::MESSAGE_TYPE, conn, remaining_size, is_single); | ||||||
| @@ -1045,7 +1030,6 @@ uint16_t APIConnection::try_send_lock_info(EntityBase *entity, APIConnection *co | |||||||
|   msg.assumed_state = a_lock->traits.get_assumed_state(); |   msg.assumed_state = a_lock->traits.get_assumed_state(); | ||||||
|   msg.supports_open = a_lock->traits.get_supports_open(); |   msg.supports_open = a_lock->traits.get_supports_open(); | ||||||
|   msg.requires_code = a_lock->traits.get_requires_code(); |   msg.requires_code = a_lock->traits.get_requires_code(); | ||||||
|   msg.device_uid = a_lock->get_device_uid(); |  | ||||||
|   msg.unique_id = get_default_unique_id("lock", a_lock); |   msg.unique_id = get_default_unique_id("lock", a_lock); | ||||||
|   fill_entity_info_base(a_lock, msg); |   fill_entity_info_base(a_lock, msg); | ||||||
|   return encode_message_to_buffer(msg, ListEntitiesLockResponse::MESSAGE_TYPE, conn, remaining_size, is_single); |   return encode_message_to_buffer(msg, ListEntitiesLockResponse::MESSAGE_TYPE, conn, remaining_size, is_single); | ||||||
| @@ -1094,7 +1078,6 @@ uint16_t APIConnection::try_send_valve_info(EntityBase *entity, APIConnection *c | |||||||
|   msg.assumed_state = traits.get_is_assumed_state(); |   msg.assumed_state = traits.get_is_assumed_state(); | ||||||
|   msg.supports_position = traits.get_supports_position(); |   msg.supports_position = traits.get_supports_position(); | ||||||
|   msg.supports_stop = traits.get_supports_stop(); |   msg.supports_stop = traits.get_supports_stop(); | ||||||
|   msg.device_uid = valve->get_device_uid(); |  | ||||||
|   msg.unique_id = get_default_unique_id("valve", valve); |   msg.unique_id = get_default_unique_id("valve", valve); | ||||||
|   fill_entity_info_base(valve, msg); |   fill_entity_info_base(valve, msg); | ||||||
|   return encode_message_to_buffer(msg, ListEntitiesValveResponse::MESSAGE_TYPE, conn, remaining_size, is_single); |   return encode_message_to_buffer(msg, ListEntitiesValveResponse::MESSAGE_TYPE, conn, remaining_size, is_single); | ||||||
| @@ -1150,7 +1133,6 @@ uint16_t APIConnection::try_send_media_player_info(EntityBase *entity, APIConnec | |||||||
|     media_format.sample_bytes = supported_format.sample_bytes; |     media_format.sample_bytes = supported_format.sample_bytes; | ||||||
|     msg.supported_formats.push_back(media_format); |     msg.supported_formats.push_back(media_format); | ||||||
|   } |   } | ||||||
|   msg.device_uid = media_player->get_device_uid(); |  | ||||||
|   msg.unique_id = get_default_unique_id("media_player", media_player); |   msg.unique_id = get_default_unique_id("media_player", media_player); | ||||||
|   fill_entity_info_base(media_player, msg); |   fill_entity_info_base(media_player, msg); | ||||||
|   return encode_message_to_buffer(msg, ListEntitiesMediaPlayerResponse::MESSAGE_TYPE, conn, remaining_size, is_single); |   return encode_message_to_buffer(msg, ListEntitiesMediaPlayerResponse::MESSAGE_TYPE, conn, remaining_size, is_single); | ||||||
| @@ -1194,7 +1176,6 @@ uint16_t APIConnection::try_send_camera_info(EntityBase *entity, APIConnection * | |||||||
|                                              bool is_single) { |                                              bool is_single) { | ||||||
|   auto *camera = static_cast<esp32_camera::ESP32Camera *>(entity); |   auto *camera = static_cast<esp32_camera::ESP32Camera *>(entity); | ||||||
|   ListEntitiesCameraResponse msg; |   ListEntitiesCameraResponse msg; | ||||||
|   msg.device_uid = camera->get_device_uid(); |  | ||||||
|   msg.unique_id = get_default_unique_id("camera", camera); |   msg.unique_id = get_default_unique_id("camera", camera); | ||||||
|   fill_entity_info_base(camera, msg); |   fill_entity_info_base(camera, msg); | ||||||
|   return encode_message_to_buffer(msg, ListEntitiesCameraResponse::MESSAGE_TYPE, conn, remaining_size, is_single); |   return encode_message_to_buffer(msg, ListEntitiesCameraResponse::MESSAGE_TYPE, conn, remaining_size, is_single); | ||||||
| @@ -1408,7 +1389,6 @@ uint16_t APIConnection::try_send_alarm_control_panel_info(EntityBase *entity, AP | |||||||
|   msg.supported_features = a_alarm_control_panel->get_supported_features(); |   msg.supported_features = a_alarm_control_panel->get_supported_features(); | ||||||
|   msg.requires_code = a_alarm_control_panel->get_requires_code(); |   msg.requires_code = a_alarm_control_panel->get_requires_code(); | ||||||
|   msg.requires_code_to_arm = a_alarm_control_panel->get_requires_code_to_arm(); |   msg.requires_code_to_arm = a_alarm_control_panel->get_requires_code_to_arm(); | ||||||
|   msg.device_uid = a_alarm_control_panel->get_device_uid(); |  | ||||||
|   msg.unique_id = get_default_unique_id("alarm_control_panel", a_alarm_control_panel); |   msg.unique_id = get_default_unique_id("alarm_control_panel", a_alarm_control_panel); | ||||||
|   fill_entity_info_base(a_alarm_control_panel, msg); |   fill_entity_info_base(a_alarm_control_panel, msg); | ||||||
|   return encode_message_to_buffer(msg, ListEntitiesAlarmControlPanelResponse::MESSAGE_TYPE, conn, remaining_size, |   return encode_message_to_buffer(msg, ListEntitiesAlarmControlPanelResponse::MESSAGE_TYPE, conn, remaining_size, | ||||||
| @@ -1470,7 +1450,6 @@ uint16_t APIConnection::try_send_event_info(EntityBase *entity, APIConnection *c | |||||||
|   msg.device_class = event->get_device_class(); |   msg.device_class = event->get_device_class(); | ||||||
|   for (const auto &event_type : event->get_event_types()) |   for (const auto &event_type : event->get_event_types()) | ||||||
|     msg.event_types.push_back(event_type); |     msg.event_types.push_back(event_type); | ||||||
|   msg.device_uid = event->get_device_uid(); |  | ||||||
|   msg.unique_id = get_default_unique_id("event", event); |   msg.unique_id = get_default_unique_id("event", event); | ||||||
|   fill_entity_info_base(event, msg); |   fill_entity_info_base(event, msg); | ||||||
|   return encode_message_to_buffer(msg, ListEntitiesEventResponse::MESSAGE_TYPE, conn, remaining_size, is_single); |   return encode_message_to_buffer(msg, ListEntitiesEventResponse::MESSAGE_TYPE, conn, remaining_size, is_single); | ||||||
| @@ -1509,7 +1488,6 @@ uint16_t APIConnection::try_send_update_info(EntityBase *entity, APIConnection * | |||||||
|   auto *update = static_cast<update::UpdateEntity *>(entity); |   auto *update = static_cast<update::UpdateEntity *>(entity); | ||||||
|   ListEntitiesUpdateResponse msg; |   ListEntitiesUpdateResponse msg; | ||||||
|   msg.device_class = update->get_device_class(); |   msg.device_class = update->get_device_class(); | ||||||
|   msg.device_uid = update->get_device_uid(); |  | ||||||
|   msg.unique_id = get_default_unique_id("update", update); |   msg.unique_id = get_default_unique_id("update", update); | ||||||
|   fill_entity_info_base(update, msg); |   fill_entity_info_base(update, msg); | ||||||
|   return encode_message_to_buffer(msg, ListEntitiesUpdateResponse::MESSAGE_TYPE, conn, remaining_size, is_single); |   return encode_message_to_buffer(msg, ListEntitiesUpdateResponse::MESSAGE_TYPE, conn, remaining_size, is_single); | ||||||
| @@ -1645,11 +1623,17 @@ DeviceInfoResponse APIConnection::device_info(const DeviceInfoRequest &msg) { | |||||||
| #ifdef USE_SUB_DEVICE | #ifdef USE_SUB_DEVICE | ||||||
|   for (auto const &sub_device : App.get_sub_devices()) { |   for (auto const &sub_device : App.get_sub_devices()) { | ||||||
|     SubDeviceInfo sub_device_info; |     SubDeviceInfo sub_device_info; | ||||||
|     sub_device_info.uid = sub_device->get_uid(); |     sub_device_info.device_id = sub_device->get_device_id(); | ||||||
|     sub_device_info.name = sub_device->get_name(); |     sub_device_info.name = sub_device->get_name(); | ||||||
|     sub_device_info.suggested_area = sub_device->get_area(); |     sub_device_info.area_id = sub_device->get_area_id(); | ||||||
|     resp.sub_devices.push_back(sub_device_info); |     resp.sub_devices.push_back(sub_device_info); | ||||||
|   } |   } | ||||||
|  |   for (auto const &area : App.get_areas()) { | ||||||
|  |     SubAreaInfo area_info; | ||||||
|  |     area_info.area_id = area->get_area_id(); | ||||||
|  |     area_info.name = area->get_name(); | ||||||
|  |     resp.sub_areas.push_back(area_info); | ||||||
|  |   } | ||||||
| #endif | #endif | ||||||
|   return resp; |   return resp; | ||||||
| } | } | ||||||
|   | |||||||
| @@ -301,6 +301,9 @@ class APIConnection : public APIServerConnection { | |||||||
|     response.icon = entity->get_icon(); |     response.icon = entity->get_icon(); | ||||||
|     response.disabled_by_default = entity->is_disabled_by_default(); |     response.disabled_by_default = entity->is_disabled_by_default(); | ||||||
|     response.entity_category = static_cast<enums::EntityCategory>(entity->get_entity_category()); |     response.entity_category = static_cast<enums::EntityCategory>(entity->get_entity_category()); | ||||||
|  | #ifdef USE_SUB_DEVICE | ||||||
|  |     response.device_id = entity->get_device_id(); | ||||||
|  | #endif | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   // Helper function to fill common entity state fields |   // Helper function to fill common entity state fields | ||||||
|   | |||||||
| @@ -812,10 +812,57 @@ void PingResponse::dump_to(std::string &out) const { out.append("PingResponse {} | |||||||
| #ifdef HAS_PROTO_MESSAGE_DUMP | #ifdef HAS_PROTO_MESSAGE_DUMP | ||||||
| void DeviceInfoRequest::dump_to(std::string &out) const { out.append("DeviceInfoRequest {}"); } | void DeviceInfoRequest::dump_to(std::string &out) const { out.append("DeviceInfoRequest {}"); } | ||||||
| #endif | #endif | ||||||
|  | bool SubAreaInfo::decode_varint(uint32_t field_id, ProtoVarInt value) { | ||||||
|  |   switch (field_id) { | ||||||
|  |     case 1: { | ||||||
|  |       this->area_id = value.as_uint32(); | ||||||
|  |       return true; | ||||||
|  |     } | ||||||
|  |     default: | ||||||
|  |       return false; | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | bool SubAreaInfo::decode_length(uint32_t field_id, ProtoLengthDelimited value) { | ||||||
|  |   switch (field_id) { | ||||||
|  |     case 2: { | ||||||
|  |       this->name = value.as_string(); | ||||||
|  |       return true; | ||||||
|  |     } | ||||||
|  |     default: | ||||||
|  |       return false; | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | void SubAreaInfo::encode(ProtoWriteBuffer buffer) const { | ||||||
|  |   buffer.encode_uint32(1, this->area_id); | ||||||
|  |   buffer.encode_string(2, this->name); | ||||||
|  | } | ||||||
|  | void SubAreaInfo::calculate_size(uint32_t &total_size) const { | ||||||
|  |   ProtoSize::add_uint32_field(total_size, 1, this->area_id, false); | ||||||
|  |   ProtoSize::add_string_field(total_size, 1, this->name, false); | ||||||
|  | } | ||||||
|  | #ifdef HAS_PROTO_MESSAGE_DUMP | ||||||
|  | void SubAreaInfo::dump_to(std::string &out) const { | ||||||
|  |   __attribute__((unused)) char buffer[64]; | ||||||
|  |   out.append("SubAreaInfo {\n"); | ||||||
|  |   out.append("  area_id: "); | ||||||
|  |   sprintf(buffer, "%" PRIu32, this->area_id); | ||||||
|  |   out.append(buffer); | ||||||
|  |   out.append("\n"); | ||||||
|  |  | ||||||
|  |   out.append("  name: "); | ||||||
|  |   out.append("'").append(this->name).append("'"); | ||||||
|  |   out.append("\n"); | ||||||
|  |   out.append("}"); | ||||||
|  | } | ||||||
|  | #endif | ||||||
| bool SubDeviceInfo::decode_varint(uint32_t field_id, ProtoVarInt value) { | bool SubDeviceInfo::decode_varint(uint32_t field_id, ProtoVarInt value) { | ||||||
|   switch (field_id) { |   switch (field_id) { | ||||||
|     case 1: { |     case 1: { | ||||||
|       this->uid = value.as_uint32(); |       this->device_id = value.as_uint32(); | ||||||
|  |       return true; | ||||||
|  |     } | ||||||
|  |     case 3: { | ||||||
|  |       this->area_id = value.as_uint32(); | ||||||
|       return true; |       return true; | ||||||
|     } |     } | ||||||
|     default: |     default: | ||||||
| @@ -828,30 +875,26 @@ bool SubDeviceInfo::decode_length(uint32_t field_id, ProtoLengthDelimited value) | |||||||
|       this->name = value.as_string(); |       this->name = value.as_string(); | ||||||
|       return true; |       return true; | ||||||
|     } |     } | ||||||
|     case 3: { |  | ||||||
|       this->suggested_area = value.as_string(); |  | ||||||
|       return true; |  | ||||||
|     } |  | ||||||
|     default: |     default: | ||||||
|       return false; |       return false; | ||||||
|   } |   } | ||||||
| } | } | ||||||
| void SubDeviceInfo::encode(ProtoWriteBuffer buffer) const { | void SubDeviceInfo::encode(ProtoWriteBuffer buffer) const { | ||||||
|   buffer.encode_uint32(1, this->uid); |   buffer.encode_uint32(1, this->device_id); | ||||||
|   buffer.encode_string(2, this->name); |   buffer.encode_string(2, this->name); | ||||||
|   buffer.encode_string(3, this->suggested_area); |   buffer.encode_uint32(3, this->area_id); | ||||||
| } | } | ||||||
| void SubDeviceInfo::calculate_size(uint32_t &total_size) const { | void SubDeviceInfo::calculate_size(uint32_t &total_size) const { | ||||||
|   ProtoSize::add_uint32_field(total_size, 1, this->uid, false); |   ProtoSize::add_uint32_field(total_size, 1, this->device_id, false); | ||||||
|   ProtoSize::add_string_field(total_size, 1, this->name, false); |   ProtoSize::add_string_field(total_size, 1, this->name, false); | ||||||
|   ProtoSize::add_string_field(total_size, 1, this->suggested_area, false); |   ProtoSize::add_uint32_field(total_size, 1, this->area_id, false); | ||||||
| } | } | ||||||
| #ifdef HAS_PROTO_MESSAGE_DUMP | #ifdef HAS_PROTO_MESSAGE_DUMP | ||||||
| void SubDeviceInfo::dump_to(std::string &out) const { | void SubDeviceInfo::dump_to(std::string &out) const { | ||||||
|   __attribute__((unused)) char buffer[64]; |   __attribute__((unused)) char buffer[64]; | ||||||
|   out.append("SubDeviceInfo {\n"); |   out.append("SubDeviceInfo {\n"); | ||||||
|   out.append("  uid: "); |   out.append("  device_id: "); | ||||||
|   sprintf(buffer, "%" PRIu32, this->uid); |   sprintf(buffer, "%" PRIu32, this->device_id); | ||||||
|   out.append(buffer); |   out.append(buffer); | ||||||
|   out.append("\n"); |   out.append("\n"); | ||||||
|  |  | ||||||
| @@ -859,8 +902,9 @@ void SubDeviceInfo::dump_to(std::string &out) const { | |||||||
|   out.append("'").append(this->name).append("'"); |   out.append("'").append(this->name).append("'"); | ||||||
|   out.append("\n"); |   out.append("\n"); | ||||||
|  |  | ||||||
|   out.append("  suggested_area: "); |   out.append("  area_id: "); | ||||||
|   out.append("'").append(this->suggested_area).append("'"); |   sprintf(buffer, "%" PRIu32, this->area_id); | ||||||
|  |   out.append(buffer); | ||||||
|   out.append("\n"); |   out.append("\n"); | ||||||
|   out.append("}"); |   out.append("}"); | ||||||
| } | } | ||||||
| @@ -953,6 +997,10 @@ bool DeviceInfoResponse::decode_length(uint32_t field_id, ProtoLengthDelimited v | |||||||
|       this->sub_devices.push_back(value.as_message<SubDeviceInfo>()); |       this->sub_devices.push_back(value.as_message<SubDeviceInfo>()); | ||||||
|       return true; |       return true; | ||||||
|     } |     } | ||||||
|  |     case 21: { | ||||||
|  |       this->sub_areas.push_back(value.as_message<SubAreaInfo>()); | ||||||
|  |       return true; | ||||||
|  |     } | ||||||
|     default: |     default: | ||||||
|       return false; |       return false; | ||||||
|   } |   } | ||||||
| @@ -980,6 +1028,9 @@ void DeviceInfoResponse::encode(ProtoWriteBuffer buffer) const { | |||||||
|   for (auto &it : this->sub_devices) { |   for (auto &it : this->sub_devices) { | ||||||
|     buffer.encode_message<SubDeviceInfo>(20, it, true); |     buffer.encode_message<SubDeviceInfo>(20, it, true); | ||||||
|   } |   } | ||||||
|  |   for (auto &it : this->sub_areas) { | ||||||
|  |     buffer.encode_message<SubAreaInfo>(21, it, true); | ||||||
|  |   } | ||||||
| } | } | ||||||
| void DeviceInfoResponse::calculate_size(uint32_t &total_size) const { | void DeviceInfoResponse::calculate_size(uint32_t &total_size) const { | ||||||
|   ProtoSize::add_bool_field(total_size, 1, this->uses_password, false); |   ProtoSize::add_bool_field(total_size, 1, this->uses_password, false); | ||||||
| @@ -1002,6 +1053,7 @@ void DeviceInfoResponse::calculate_size(uint32_t &total_size) const { | |||||||
|   ProtoSize::add_string_field(total_size, 2, this->bluetooth_mac_address, false); |   ProtoSize::add_string_field(total_size, 2, this->bluetooth_mac_address, false); | ||||||
|   ProtoSize::add_bool_field(total_size, 2, this->api_encryption_supported, false); |   ProtoSize::add_bool_field(total_size, 2, this->api_encryption_supported, false); | ||||||
|   ProtoSize::add_repeated_message(total_size, 2, this->sub_devices); |   ProtoSize::add_repeated_message(total_size, 2, this->sub_devices); | ||||||
|  |   ProtoSize::add_repeated_message(total_size, 2, this->sub_areas); | ||||||
| } | } | ||||||
| #ifdef HAS_PROTO_MESSAGE_DUMP | #ifdef HAS_PROTO_MESSAGE_DUMP | ||||||
| void DeviceInfoResponse::dump_to(std::string &out) const { | void DeviceInfoResponse::dump_to(std::string &out) const { | ||||||
| @@ -1093,6 +1145,12 @@ void DeviceInfoResponse::dump_to(std::string &out) const { | |||||||
|     it.dump_to(out); |     it.dump_to(out); | ||||||
|     out.append("\n"); |     out.append("\n"); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  |   for (const auto &it : this->sub_areas) { | ||||||
|  |     out.append("  sub_areas: "); | ||||||
|  |     it.dump_to(out); | ||||||
|  |     out.append("\n"); | ||||||
|  |   } | ||||||
|   out.append("}"); |   out.append("}"); | ||||||
| } | } | ||||||
| #endif | #endif | ||||||
| @@ -1120,7 +1178,7 @@ bool ListEntitiesBinarySensorResponse::decode_varint(uint32_t field_id, ProtoVar | |||||||
|       return true; |       return true; | ||||||
|     } |     } | ||||||
|     case 10: { |     case 10: { | ||||||
|       this->device_uid = value.as_uint32(); |       this->device_id = value.as_uint32(); | ||||||
|       return true; |       return true; | ||||||
|     } |     } | ||||||
|     default: |     default: | ||||||
| @@ -1173,7 +1231,7 @@ void ListEntitiesBinarySensorResponse::encode(ProtoWriteBuffer buffer) const { | |||||||
|   buffer.encode_bool(7, this->disabled_by_default); |   buffer.encode_bool(7, this->disabled_by_default); | ||||||
|   buffer.encode_string(8, this->icon); |   buffer.encode_string(8, this->icon); | ||||||
|   buffer.encode_enum<enums::EntityCategory>(9, this->entity_category); |   buffer.encode_enum<enums::EntityCategory>(9, this->entity_category); | ||||||
|   buffer.encode_uint32(10, this->device_uid); |   buffer.encode_uint32(10, this->device_id); | ||||||
| } | } | ||||||
| void ListEntitiesBinarySensorResponse::calculate_size(uint32_t &total_size) const { | void ListEntitiesBinarySensorResponse::calculate_size(uint32_t &total_size) const { | ||||||
|   ProtoSize::add_string_field(total_size, 1, this->object_id, false); |   ProtoSize::add_string_field(total_size, 1, this->object_id, false); | ||||||
| @@ -1185,7 +1243,7 @@ void ListEntitiesBinarySensorResponse::calculate_size(uint32_t &total_size) cons | |||||||
|   ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false); |   ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false); | ||||||
|   ProtoSize::add_string_field(total_size, 1, this->icon, false); |   ProtoSize::add_string_field(total_size, 1, this->icon, false); | ||||||
|   ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false); |   ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false); | ||||||
|   ProtoSize::add_uint32_field(total_size, 1, this->device_uid, false); |   ProtoSize::add_uint32_field(total_size, 1, this->device_id, false); | ||||||
| } | } | ||||||
| #ifdef HAS_PROTO_MESSAGE_DUMP | #ifdef HAS_PROTO_MESSAGE_DUMP | ||||||
| void ListEntitiesBinarySensorResponse::dump_to(std::string &out) const { | void ListEntitiesBinarySensorResponse::dump_to(std::string &out) const { | ||||||
| @@ -1228,8 +1286,8 @@ void ListEntitiesBinarySensorResponse::dump_to(std::string &out) const { | |||||||
|   out.append(proto_enum_to_string<enums::EntityCategory>(this->entity_category)); |   out.append(proto_enum_to_string<enums::EntityCategory>(this->entity_category)); | ||||||
|   out.append("\n"); |   out.append("\n"); | ||||||
|  |  | ||||||
|   out.append("  device_uid: "); |   out.append("  device_id: "); | ||||||
|   sprintf(buffer, "%" PRIu32, this->device_uid); |   sprintf(buffer, "%" PRIu32, this->device_id); | ||||||
|   out.append(buffer); |   out.append(buffer); | ||||||
|   out.append("\n"); |   out.append("\n"); | ||||||
|   out.append("}"); |   out.append("}"); | ||||||
| @@ -1315,7 +1373,7 @@ bool ListEntitiesCoverResponse::decode_varint(uint32_t field_id, ProtoVarInt val | |||||||
|       return true; |       return true; | ||||||
|     } |     } | ||||||
|     case 13: { |     case 13: { | ||||||
|       this->device_uid = value.as_uint32(); |       this->device_id = value.as_uint32(); | ||||||
|       return true; |       return true; | ||||||
|     } |     } | ||||||
|     default: |     default: | ||||||
| @@ -1371,7 +1429,7 @@ void ListEntitiesCoverResponse::encode(ProtoWriteBuffer buffer) const { | |||||||
|   buffer.encode_string(10, this->icon); |   buffer.encode_string(10, this->icon); | ||||||
|   buffer.encode_enum<enums::EntityCategory>(11, this->entity_category); |   buffer.encode_enum<enums::EntityCategory>(11, this->entity_category); | ||||||
|   buffer.encode_bool(12, this->supports_stop); |   buffer.encode_bool(12, this->supports_stop); | ||||||
|   buffer.encode_uint32(13, this->device_uid); |   buffer.encode_uint32(13, this->device_id); | ||||||
| } | } | ||||||
| void ListEntitiesCoverResponse::calculate_size(uint32_t &total_size) const { | void ListEntitiesCoverResponse::calculate_size(uint32_t &total_size) const { | ||||||
|   ProtoSize::add_string_field(total_size, 1, this->object_id, false); |   ProtoSize::add_string_field(total_size, 1, this->object_id, false); | ||||||
| @@ -1386,7 +1444,7 @@ void ListEntitiesCoverResponse::calculate_size(uint32_t &total_size) const { | |||||||
|   ProtoSize::add_string_field(total_size, 1, this->icon, false); |   ProtoSize::add_string_field(total_size, 1, this->icon, false); | ||||||
|   ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false); |   ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false); | ||||||
|   ProtoSize::add_bool_field(total_size, 1, this->supports_stop, false); |   ProtoSize::add_bool_field(total_size, 1, this->supports_stop, false); | ||||||
|   ProtoSize::add_uint32_field(total_size, 1, this->device_uid, false); |   ProtoSize::add_uint32_field(total_size, 1, this->device_id, false); | ||||||
| } | } | ||||||
| #ifdef HAS_PROTO_MESSAGE_DUMP | #ifdef HAS_PROTO_MESSAGE_DUMP | ||||||
| void ListEntitiesCoverResponse::dump_to(std::string &out) const { | void ListEntitiesCoverResponse::dump_to(std::string &out) const { | ||||||
| @@ -1441,8 +1499,8 @@ void ListEntitiesCoverResponse::dump_to(std::string &out) const { | |||||||
|   out.append(YESNO(this->supports_stop)); |   out.append(YESNO(this->supports_stop)); | ||||||
|   out.append("\n"); |   out.append("\n"); | ||||||
|  |  | ||||||
|   out.append("  device_uid: "); |   out.append("  device_id: "); | ||||||
|   sprintf(buffer, "%" PRIu32, this->device_uid); |   sprintf(buffer, "%" PRIu32, this->device_id); | ||||||
|   out.append(buffer); |   out.append(buffer); | ||||||
|   out.append("\n"); |   out.append("\n"); | ||||||
|   out.append("}"); |   out.append("}"); | ||||||
| @@ -1655,7 +1713,7 @@ bool ListEntitiesFanResponse::decode_varint(uint32_t field_id, ProtoVarInt value | |||||||
|       return true; |       return true; | ||||||
|     } |     } | ||||||
|     case 13: { |     case 13: { | ||||||
|       this->device_uid = value.as_uint32(); |       this->device_id = value.as_uint32(); | ||||||
|       return true; |       return true; | ||||||
|     } |     } | ||||||
|     default: |     default: | ||||||
| @@ -1713,7 +1771,7 @@ void ListEntitiesFanResponse::encode(ProtoWriteBuffer buffer) const { | |||||||
|   for (auto &it : this->supported_preset_modes) { |   for (auto &it : this->supported_preset_modes) { | ||||||
|     buffer.encode_string(12, it, true); |     buffer.encode_string(12, it, true); | ||||||
|   } |   } | ||||||
|   buffer.encode_uint32(13, this->device_uid); |   buffer.encode_uint32(13, this->device_id); | ||||||
| } | } | ||||||
| void ListEntitiesFanResponse::calculate_size(uint32_t &total_size) const { | void ListEntitiesFanResponse::calculate_size(uint32_t &total_size) const { | ||||||
|   ProtoSize::add_string_field(total_size, 1, this->object_id, false); |   ProtoSize::add_string_field(total_size, 1, this->object_id, false); | ||||||
| @@ -1732,7 +1790,7 @@ void ListEntitiesFanResponse::calculate_size(uint32_t &total_size) const { | |||||||
|       ProtoSize::add_string_field(total_size, 1, it, true); |       ProtoSize::add_string_field(total_size, 1, it, true); | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
|   ProtoSize::add_uint32_field(total_size, 1, this->device_uid, false); |   ProtoSize::add_uint32_field(total_size, 1, this->device_id, false); | ||||||
| } | } | ||||||
| #ifdef HAS_PROTO_MESSAGE_DUMP | #ifdef HAS_PROTO_MESSAGE_DUMP | ||||||
| void ListEntitiesFanResponse::dump_to(std::string &out) const { | void ListEntitiesFanResponse::dump_to(std::string &out) const { | ||||||
| @@ -1790,8 +1848,8 @@ void ListEntitiesFanResponse::dump_to(std::string &out) const { | |||||||
|     out.append("\n"); |     out.append("\n"); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   out.append("  device_uid: "); |   out.append("  device_id: "); | ||||||
|   sprintf(buffer, "%" PRIu32, this->device_uid); |   sprintf(buffer, "%" PRIu32, this->device_id); | ||||||
|   out.append(buffer); |   out.append(buffer); | ||||||
|   out.append("\n"); |   out.append("\n"); | ||||||
|   out.append("}"); |   out.append("}"); | ||||||
| @@ -2088,7 +2146,7 @@ bool ListEntitiesLightResponse::decode_varint(uint32_t field_id, ProtoVarInt val | |||||||
|       return true; |       return true; | ||||||
|     } |     } | ||||||
|     case 16: { |     case 16: { | ||||||
|       this->device_uid = value.as_uint32(); |       this->device_id = value.as_uint32(); | ||||||
|       return true; |       return true; | ||||||
|     } |     } | ||||||
|     default: |     default: | ||||||
| @@ -2159,7 +2217,7 @@ void ListEntitiesLightResponse::encode(ProtoWriteBuffer buffer) const { | |||||||
|   buffer.encode_bool(13, this->disabled_by_default); |   buffer.encode_bool(13, this->disabled_by_default); | ||||||
|   buffer.encode_string(14, this->icon); |   buffer.encode_string(14, this->icon); | ||||||
|   buffer.encode_enum<enums::EntityCategory>(15, this->entity_category); |   buffer.encode_enum<enums::EntityCategory>(15, this->entity_category); | ||||||
|   buffer.encode_uint32(16, this->device_uid); |   buffer.encode_uint32(16, this->device_id); | ||||||
| } | } | ||||||
| void ListEntitiesLightResponse::calculate_size(uint32_t &total_size) const { | void ListEntitiesLightResponse::calculate_size(uint32_t &total_size) const { | ||||||
|   ProtoSize::add_string_field(total_size, 1, this->object_id, false); |   ProtoSize::add_string_field(total_size, 1, this->object_id, false); | ||||||
| @@ -2185,7 +2243,7 @@ void ListEntitiesLightResponse::calculate_size(uint32_t &total_size) const { | |||||||
|   ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false); |   ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false); | ||||||
|   ProtoSize::add_string_field(total_size, 1, this->icon, false); |   ProtoSize::add_string_field(total_size, 1, this->icon, false); | ||||||
|   ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false); |   ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false); | ||||||
|   ProtoSize::add_uint32_field(total_size, 2, this->device_uid, false); |   ProtoSize::add_uint32_field(total_size, 2, this->device_id, false); | ||||||
| } | } | ||||||
| #ifdef HAS_PROTO_MESSAGE_DUMP | #ifdef HAS_PROTO_MESSAGE_DUMP | ||||||
| void ListEntitiesLightResponse::dump_to(std::string &out) const { | void ListEntitiesLightResponse::dump_to(std::string &out) const { | ||||||
| @@ -2258,8 +2316,8 @@ void ListEntitiesLightResponse::dump_to(std::string &out) const { | |||||||
|   out.append(proto_enum_to_string<enums::EntityCategory>(this->entity_category)); |   out.append(proto_enum_to_string<enums::EntityCategory>(this->entity_category)); | ||||||
|   out.append("\n"); |   out.append("\n"); | ||||||
|  |  | ||||||
|   out.append("  device_uid: "); |   out.append("  device_id: "); | ||||||
|   sprintf(buffer, "%" PRIu32, this->device_uid); |   sprintf(buffer, "%" PRIu32, this->device_id); | ||||||
|   out.append(buffer); |   out.append(buffer); | ||||||
|   out.append("\n"); |   out.append("\n"); | ||||||
|   out.append("}"); |   out.append("}"); | ||||||
| @@ -2770,7 +2828,7 @@ bool ListEntitiesSensorResponse::decode_varint(uint32_t field_id, ProtoVarInt va | |||||||
|       return true; |       return true; | ||||||
|     } |     } | ||||||
|     case 14: { |     case 14: { | ||||||
|       this->device_uid = value.as_uint32(); |       this->device_id = value.as_uint32(); | ||||||
|       return true; |       return true; | ||||||
|     } |     } | ||||||
|     default: |     default: | ||||||
| @@ -2831,7 +2889,7 @@ void ListEntitiesSensorResponse::encode(ProtoWriteBuffer buffer) const { | |||||||
|   buffer.encode_enum<enums::SensorLastResetType>(11, this->legacy_last_reset_type); |   buffer.encode_enum<enums::SensorLastResetType>(11, this->legacy_last_reset_type); | ||||||
|   buffer.encode_bool(12, this->disabled_by_default); |   buffer.encode_bool(12, this->disabled_by_default); | ||||||
|   buffer.encode_enum<enums::EntityCategory>(13, this->entity_category); |   buffer.encode_enum<enums::EntityCategory>(13, this->entity_category); | ||||||
|   buffer.encode_uint32(14, this->device_uid); |   buffer.encode_uint32(14, this->device_id); | ||||||
| } | } | ||||||
| void ListEntitiesSensorResponse::calculate_size(uint32_t &total_size) const { | void ListEntitiesSensorResponse::calculate_size(uint32_t &total_size) const { | ||||||
|   ProtoSize::add_string_field(total_size, 1, this->object_id, false); |   ProtoSize::add_string_field(total_size, 1, this->object_id, false); | ||||||
| @@ -2847,7 +2905,7 @@ void ListEntitiesSensorResponse::calculate_size(uint32_t &total_size) const { | |||||||
|   ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->legacy_last_reset_type), false); |   ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->legacy_last_reset_type), false); | ||||||
|   ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false); |   ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false); | ||||||
|   ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false); |   ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false); | ||||||
|   ProtoSize::add_uint32_field(total_size, 1, this->device_uid, false); |   ProtoSize::add_uint32_field(total_size, 1, this->device_id, false); | ||||||
| } | } | ||||||
| #ifdef HAS_PROTO_MESSAGE_DUMP | #ifdef HAS_PROTO_MESSAGE_DUMP | ||||||
| void ListEntitiesSensorResponse::dump_to(std::string &out) const { | void ListEntitiesSensorResponse::dump_to(std::string &out) const { | ||||||
| @@ -2907,8 +2965,8 @@ void ListEntitiesSensorResponse::dump_to(std::string &out) const { | |||||||
|   out.append(proto_enum_to_string<enums::EntityCategory>(this->entity_category)); |   out.append(proto_enum_to_string<enums::EntityCategory>(this->entity_category)); | ||||||
|   out.append("\n"); |   out.append("\n"); | ||||||
|  |  | ||||||
|   out.append("  device_uid: "); |   out.append("  device_id: "); | ||||||
|   sprintf(buffer, "%" PRIu32, this->device_uid); |   sprintf(buffer, "%" PRIu32, this->device_id); | ||||||
|   out.append(buffer); |   out.append(buffer); | ||||||
|   out.append("\n"); |   out.append("\n"); | ||||||
|   out.append("}"); |   out.append("}"); | ||||||
| @@ -2983,7 +3041,7 @@ bool ListEntitiesSwitchResponse::decode_varint(uint32_t field_id, ProtoVarInt va | |||||||
|       return true; |       return true; | ||||||
|     } |     } | ||||||
|     case 10: { |     case 10: { | ||||||
|       this->device_uid = value.as_uint32(); |       this->device_id = value.as_uint32(); | ||||||
|       return true; |       return true; | ||||||
|     } |     } | ||||||
|     default: |     default: | ||||||
| @@ -3036,7 +3094,7 @@ void ListEntitiesSwitchResponse::encode(ProtoWriteBuffer buffer) const { | |||||||
|   buffer.encode_bool(7, this->disabled_by_default); |   buffer.encode_bool(7, this->disabled_by_default); | ||||||
|   buffer.encode_enum<enums::EntityCategory>(8, this->entity_category); |   buffer.encode_enum<enums::EntityCategory>(8, this->entity_category); | ||||||
|   buffer.encode_string(9, this->device_class); |   buffer.encode_string(9, this->device_class); | ||||||
|   buffer.encode_uint32(10, this->device_uid); |   buffer.encode_uint32(10, this->device_id); | ||||||
| } | } | ||||||
| void ListEntitiesSwitchResponse::calculate_size(uint32_t &total_size) const { | void ListEntitiesSwitchResponse::calculate_size(uint32_t &total_size) const { | ||||||
|   ProtoSize::add_string_field(total_size, 1, this->object_id, false); |   ProtoSize::add_string_field(total_size, 1, this->object_id, false); | ||||||
| @@ -3048,7 +3106,7 @@ void ListEntitiesSwitchResponse::calculate_size(uint32_t &total_size) const { | |||||||
|   ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false); |   ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false); | ||||||
|   ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false); |   ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false); | ||||||
|   ProtoSize::add_string_field(total_size, 1, this->device_class, false); |   ProtoSize::add_string_field(total_size, 1, this->device_class, false); | ||||||
|   ProtoSize::add_uint32_field(total_size, 1, this->device_uid, false); |   ProtoSize::add_uint32_field(total_size, 1, this->device_id, false); | ||||||
| } | } | ||||||
| #ifdef HAS_PROTO_MESSAGE_DUMP | #ifdef HAS_PROTO_MESSAGE_DUMP | ||||||
| void ListEntitiesSwitchResponse::dump_to(std::string &out) const { | void ListEntitiesSwitchResponse::dump_to(std::string &out) const { | ||||||
| @@ -3091,8 +3149,8 @@ void ListEntitiesSwitchResponse::dump_to(std::string &out) const { | |||||||
|   out.append("'").append(this->device_class).append("'"); |   out.append("'").append(this->device_class).append("'"); | ||||||
|   out.append("\n"); |   out.append("\n"); | ||||||
|  |  | ||||||
|   out.append("  device_uid: "); |   out.append("  device_id: "); | ||||||
|   sprintf(buffer, "%" PRIu32, this->device_uid); |   sprintf(buffer, "%" PRIu32, this->device_id); | ||||||
|   out.append(buffer); |   out.append(buffer); | ||||||
|   out.append("\n"); |   out.append("\n"); | ||||||
|   out.append("}"); |   out.append("}"); | ||||||
| @@ -3195,7 +3253,7 @@ bool ListEntitiesTextSensorResponse::decode_varint(uint32_t field_id, ProtoVarIn | |||||||
|       return true; |       return true; | ||||||
|     } |     } | ||||||
|     case 9: { |     case 9: { | ||||||
|       this->device_uid = value.as_uint32(); |       this->device_id = value.as_uint32(); | ||||||
|       return true; |       return true; | ||||||
|     } |     } | ||||||
|     default: |     default: | ||||||
| @@ -3247,7 +3305,7 @@ void ListEntitiesTextSensorResponse::encode(ProtoWriteBuffer buffer) const { | |||||||
|   buffer.encode_bool(6, this->disabled_by_default); |   buffer.encode_bool(6, this->disabled_by_default); | ||||||
|   buffer.encode_enum<enums::EntityCategory>(7, this->entity_category); |   buffer.encode_enum<enums::EntityCategory>(7, this->entity_category); | ||||||
|   buffer.encode_string(8, this->device_class); |   buffer.encode_string(8, this->device_class); | ||||||
|   buffer.encode_uint32(9, this->device_uid); |   buffer.encode_uint32(9, this->device_id); | ||||||
| } | } | ||||||
| void ListEntitiesTextSensorResponse::calculate_size(uint32_t &total_size) const { | void ListEntitiesTextSensorResponse::calculate_size(uint32_t &total_size) const { | ||||||
|   ProtoSize::add_string_field(total_size, 1, this->object_id, false); |   ProtoSize::add_string_field(total_size, 1, this->object_id, false); | ||||||
| @@ -3258,7 +3316,7 @@ void ListEntitiesTextSensorResponse::calculate_size(uint32_t &total_size) const | |||||||
|   ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false); |   ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false); | ||||||
|   ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false); |   ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false); | ||||||
|   ProtoSize::add_string_field(total_size, 1, this->device_class, false); |   ProtoSize::add_string_field(total_size, 1, this->device_class, false); | ||||||
|   ProtoSize::add_uint32_field(total_size, 1, this->device_uid, false); |   ProtoSize::add_uint32_field(total_size, 1, this->device_id, false); | ||||||
| } | } | ||||||
| #ifdef HAS_PROTO_MESSAGE_DUMP | #ifdef HAS_PROTO_MESSAGE_DUMP | ||||||
| void ListEntitiesTextSensorResponse::dump_to(std::string &out) const { | void ListEntitiesTextSensorResponse::dump_to(std::string &out) const { | ||||||
| @@ -3297,8 +3355,8 @@ void ListEntitiesTextSensorResponse::dump_to(std::string &out) const { | |||||||
|   out.append("'").append(this->device_class).append("'"); |   out.append("'").append(this->device_class).append("'"); | ||||||
|   out.append("\n"); |   out.append("\n"); | ||||||
|  |  | ||||||
|   out.append("  device_uid: "); |   out.append("  device_id: "); | ||||||
|   sprintf(buffer, "%" PRIu32, this->device_uid); |   sprintf(buffer, "%" PRIu32, this->device_id); | ||||||
|   out.append(buffer); |   out.append(buffer); | ||||||
|   out.append("\n"); |   out.append("\n"); | ||||||
|   out.append("}"); |   out.append("}"); | ||||||
| @@ -4067,7 +4125,7 @@ bool ListEntitiesCameraResponse::decode_varint(uint32_t field_id, ProtoVarInt va | |||||||
|       return true; |       return true; | ||||||
|     } |     } | ||||||
|     case 8: { |     case 8: { | ||||||
|       this->device_uid = value.as_uint32(); |       this->device_id = value.as_uint32(); | ||||||
|       return true; |       return true; | ||||||
|     } |     } | ||||||
|     default: |     default: | ||||||
| @@ -4114,7 +4172,7 @@ void ListEntitiesCameraResponse::encode(ProtoWriteBuffer buffer) const { | |||||||
|   buffer.encode_bool(5, this->disabled_by_default); |   buffer.encode_bool(5, this->disabled_by_default); | ||||||
|   buffer.encode_string(6, this->icon); |   buffer.encode_string(6, this->icon); | ||||||
|   buffer.encode_enum<enums::EntityCategory>(7, this->entity_category); |   buffer.encode_enum<enums::EntityCategory>(7, this->entity_category); | ||||||
|   buffer.encode_uint32(8, this->device_uid); |   buffer.encode_uint32(8, this->device_id); | ||||||
| } | } | ||||||
| void ListEntitiesCameraResponse::calculate_size(uint32_t &total_size) const { | void ListEntitiesCameraResponse::calculate_size(uint32_t &total_size) const { | ||||||
|   ProtoSize::add_string_field(total_size, 1, this->object_id, false); |   ProtoSize::add_string_field(total_size, 1, this->object_id, false); | ||||||
| @@ -4124,7 +4182,7 @@ void ListEntitiesCameraResponse::calculate_size(uint32_t &total_size) const { | |||||||
|   ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false); |   ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false); | ||||||
|   ProtoSize::add_string_field(total_size, 1, this->icon, false); |   ProtoSize::add_string_field(total_size, 1, this->icon, false); | ||||||
|   ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false); |   ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false); | ||||||
|   ProtoSize::add_uint32_field(total_size, 1, this->device_uid, false); |   ProtoSize::add_uint32_field(total_size, 1, this->device_id, false); | ||||||
| } | } | ||||||
| #ifdef HAS_PROTO_MESSAGE_DUMP | #ifdef HAS_PROTO_MESSAGE_DUMP | ||||||
| void ListEntitiesCameraResponse::dump_to(std::string &out) const { | void ListEntitiesCameraResponse::dump_to(std::string &out) const { | ||||||
| @@ -4159,8 +4217,8 @@ void ListEntitiesCameraResponse::dump_to(std::string &out) const { | |||||||
|   out.append(proto_enum_to_string<enums::EntityCategory>(this->entity_category)); |   out.append(proto_enum_to_string<enums::EntityCategory>(this->entity_category)); | ||||||
|   out.append("\n"); |   out.append("\n"); | ||||||
|  |  | ||||||
|   out.append("  device_uid: "); |   out.append("  device_id: "); | ||||||
|   sprintf(buffer, "%" PRIu32, this->device_uid); |   sprintf(buffer, "%" PRIu32, this->device_id); | ||||||
|   out.append(buffer); |   out.append(buffer); | ||||||
|   out.append("\n"); |   out.append("\n"); | ||||||
|   out.append("}"); |   out.append("}"); | ||||||
| @@ -4312,7 +4370,7 @@ bool ListEntitiesClimateResponse::decode_varint(uint32_t field_id, ProtoVarInt v | |||||||
|       return true; |       return true; | ||||||
|     } |     } | ||||||
|     case 26: { |     case 26: { | ||||||
|       this->device_uid = value.as_uint32(); |       this->device_id = value.as_uint32(); | ||||||
|       return true; |       return true; | ||||||
|     } |     } | ||||||
|     default: |     default: | ||||||
| @@ -4421,7 +4479,7 @@ void ListEntitiesClimateResponse::encode(ProtoWriteBuffer buffer) const { | |||||||
|   buffer.encode_bool(23, this->supports_target_humidity); |   buffer.encode_bool(23, this->supports_target_humidity); | ||||||
|   buffer.encode_float(24, this->visual_min_humidity); |   buffer.encode_float(24, this->visual_min_humidity); | ||||||
|   buffer.encode_float(25, this->visual_max_humidity); |   buffer.encode_float(25, this->visual_max_humidity); | ||||||
|   buffer.encode_uint32(26, this->device_uid); |   buffer.encode_uint32(26, this->device_id); | ||||||
| } | } | ||||||
| void ListEntitiesClimateResponse::calculate_size(uint32_t &total_size) const { | void ListEntitiesClimateResponse::calculate_size(uint32_t &total_size) const { | ||||||
|   ProtoSize::add_string_field(total_size, 1, this->object_id, false); |   ProtoSize::add_string_field(total_size, 1, this->object_id, false); | ||||||
| @@ -4473,7 +4531,7 @@ void ListEntitiesClimateResponse::calculate_size(uint32_t &total_size) const { | |||||||
|   ProtoSize::add_bool_field(total_size, 2, this->supports_target_humidity, false); |   ProtoSize::add_bool_field(total_size, 2, this->supports_target_humidity, false); | ||||||
|   ProtoSize::add_fixed_field<4>(total_size, 2, this->visual_min_humidity != 0.0f, false); |   ProtoSize::add_fixed_field<4>(total_size, 2, this->visual_min_humidity != 0.0f, false); | ||||||
|   ProtoSize::add_fixed_field<4>(total_size, 2, this->visual_max_humidity != 0.0f, false); |   ProtoSize::add_fixed_field<4>(total_size, 2, this->visual_max_humidity != 0.0f, false); | ||||||
|   ProtoSize::add_uint32_field(total_size, 2, this->device_uid, false); |   ProtoSize::add_uint32_field(total_size, 2, this->device_id, false); | ||||||
| } | } | ||||||
| #ifdef HAS_PROTO_MESSAGE_DUMP | #ifdef HAS_PROTO_MESSAGE_DUMP | ||||||
| void ListEntitiesClimateResponse::dump_to(std::string &out) const { | void ListEntitiesClimateResponse::dump_to(std::string &out) const { | ||||||
| @@ -4598,8 +4656,8 @@ void ListEntitiesClimateResponse::dump_to(std::string &out) const { | |||||||
|   out.append(buffer); |   out.append(buffer); | ||||||
|   out.append("\n"); |   out.append("\n"); | ||||||
|  |  | ||||||
|   out.append("  device_uid: "); |   out.append("  device_id: "); | ||||||
|   sprintf(buffer, "%" PRIu32, this->device_uid); |   sprintf(buffer, "%" PRIu32, this->device_id); | ||||||
|   out.append(buffer); |   out.append(buffer); | ||||||
|   out.append("\n"); |   out.append("\n"); | ||||||
|   out.append("}"); |   out.append("}"); | ||||||
| @@ -5068,7 +5126,7 @@ bool ListEntitiesNumberResponse::decode_varint(uint32_t field_id, ProtoVarInt va | |||||||
|       return true; |       return true; | ||||||
|     } |     } | ||||||
|     case 14: { |     case 14: { | ||||||
|       this->device_uid = value.as_uint32(); |       this->device_id = value.as_uint32(); | ||||||
|       return true; |       return true; | ||||||
|     } |     } | ||||||
|     default: |     default: | ||||||
| @@ -5141,7 +5199,7 @@ void ListEntitiesNumberResponse::encode(ProtoWriteBuffer buffer) const { | |||||||
|   buffer.encode_string(11, this->unit_of_measurement); |   buffer.encode_string(11, this->unit_of_measurement); | ||||||
|   buffer.encode_enum<enums::NumberMode>(12, this->mode); |   buffer.encode_enum<enums::NumberMode>(12, this->mode); | ||||||
|   buffer.encode_string(13, this->device_class); |   buffer.encode_string(13, this->device_class); | ||||||
|   buffer.encode_uint32(14, this->device_uid); |   buffer.encode_uint32(14, this->device_id); | ||||||
| } | } | ||||||
| void ListEntitiesNumberResponse::calculate_size(uint32_t &total_size) const { | void ListEntitiesNumberResponse::calculate_size(uint32_t &total_size) const { | ||||||
|   ProtoSize::add_string_field(total_size, 1, this->object_id, false); |   ProtoSize::add_string_field(total_size, 1, this->object_id, false); | ||||||
| @@ -5157,7 +5215,7 @@ void ListEntitiesNumberResponse::calculate_size(uint32_t &total_size) const { | |||||||
|   ProtoSize::add_string_field(total_size, 1, this->unit_of_measurement, false); |   ProtoSize::add_string_field(total_size, 1, this->unit_of_measurement, false); | ||||||
|   ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->mode), false); |   ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->mode), false); | ||||||
|   ProtoSize::add_string_field(total_size, 1, this->device_class, false); |   ProtoSize::add_string_field(total_size, 1, this->device_class, false); | ||||||
|   ProtoSize::add_uint32_field(total_size, 1, this->device_uid, false); |   ProtoSize::add_uint32_field(total_size, 1, this->device_id, false); | ||||||
| } | } | ||||||
| #ifdef HAS_PROTO_MESSAGE_DUMP | #ifdef HAS_PROTO_MESSAGE_DUMP | ||||||
| void ListEntitiesNumberResponse::dump_to(std::string &out) const { | void ListEntitiesNumberResponse::dump_to(std::string &out) const { | ||||||
| @@ -5219,8 +5277,8 @@ void ListEntitiesNumberResponse::dump_to(std::string &out) const { | |||||||
|   out.append("'").append(this->device_class).append("'"); |   out.append("'").append(this->device_class).append("'"); | ||||||
|   out.append("\n"); |   out.append("\n"); | ||||||
|  |  | ||||||
|   out.append("  device_uid: "); |   out.append("  device_id: "); | ||||||
|   sprintf(buffer, "%" PRIu32, this->device_uid); |   sprintf(buffer, "%" PRIu32, this->device_id); | ||||||
|   out.append(buffer); |   out.append(buffer); | ||||||
|   out.append("\n"); |   out.append("\n"); | ||||||
|   out.append("}"); |   out.append("}"); | ||||||
| @@ -5329,7 +5387,7 @@ bool ListEntitiesSelectResponse::decode_varint(uint32_t field_id, ProtoVarInt va | |||||||
|       return true; |       return true; | ||||||
|     } |     } | ||||||
|     case 9: { |     case 9: { | ||||||
|       this->device_uid = value.as_uint32(); |       this->device_id = value.as_uint32(); | ||||||
|       return true; |       return true; | ||||||
|     } |     } | ||||||
|     default: |     default: | ||||||
| @@ -5383,7 +5441,7 @@ void ListEntitiesSelectResponse::encode(ProtoWriteBuffer buffer) const { | |||||||
|   } |   } | ||||||
|   buffer.encode_bool(7, this->disabled_by_default); |   buffer.encode_bool(7, this->disabled_by_default); | ||||||
|   buffer.encode_enum<enums::EntityCategory>(8, this->entity_category); |   buffer.encode_enum<enums::EntityCategory>(8, this->entity_category); | ||||||
|   buffer.encode_uint32(9, this->device_uid); |   buffer.encode_uint32(9, this->device_id); | ||||||
| } | } | ||||||
| void ListEntitiesSelectResponse::calculate_size(uint32_t &total_size) const { | void ListEntitiesSelectResponse::calculate_size(uint32_t &total_size) const { | ||||||
|   ProtoSize::add_string_field(total_size, 1, this->object_id, false); |   ProtoSize::add_string_field(total_size, 1, this->object_id, false); | ||||||
| @@ -5398,7 +5456,7 @@ void ListEntitiesSelectResponse::calculate_size(uint32_t &total_size) const { | |||||||
|   } |   } | ||||||
|   ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false); |   ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false); | ||||||
|   ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false); |   ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false); | ||||||
|   ProtoSize::add_uint32_field(total_size, 1, this->device_uid, false); |   ProtoSize::add_uint32_field(total_size, 1, this->device_id, false); | ||||||
| } | } | ||||||
| #ifdef HAS_PROTO_MESSAGE_DUMP | #ifdef HAS_PROTO_MESSAGE_DUMP | ||||||
| void ListEntitiesSelectResponse::dump_to(std::string &out) const { | void ListEntitiesSelectResponse::dump_to(std::string &out) const { | ||||||
| @@ -5439,8 +5497,8 @@ void ListEntitiesSelectResponse::dump_to(std::string &out) const { | |||||||
|   out.append(proto_enum_to_string<enums::EntityCategory>(this->entity_category)); |   out.append(proto_enum_to_string<enums::EntityCategory>(this->entity_category)); | ||||||
|   out.append("\n"); |   out.append("\n"); | ||||||
|  |  | ||||||
|   out.append("  device_uid: "); |   out.append("  device_id: "); | ||||||
|   sprintf(buffer, "%" PRIu32, this->device_uid); |   sprintf(buffer, "%" PRIu32, this->device_id); | ||||||
|   out.append(buffer); |   out.append(buffer); | ||||||
|   out.append("\n"); |   out.append("\n"); | ||||||
|   out.append("}"); |   out.append("}"); | ||||||
| @@ -5872,7 +5930,7 @@ bool ListEntitiesLockResponse::decode_varint(uint32_t field_id, ProtoVarInt valu | |||||||
|       return true; |       return true; | ||||||
|     } |     } | ||||||
|     case 12: { |     case 12: { | ||||||
|       this->device_uid = value.as_uint32(); |       this->device_id = value.as_uint32(); | ||||||
|       return true; |       return true; | ||||||
|     } |     } | ||||||
|     default: |     default: | ||||||
| @@ -5927,7 +5985,7 @@ void ListEntitiesLockResponse::encode(ProtoWriteBuffer buffer) const { | |||||||
|   buffer.encode_bool(9, this->supports_open); |   buffer.encode_bool(9, this->supports_open); | ||||||
|   buffer.encode_bool(10, this->requires_code); |   buffer.encode_bool(10, this->requires_code); | ||||||
|   buffer.encode_string(11, this->code_format); |   buffer.encode_string(11, this->code_format); | ||||||
|   buffer.encode_uint32(12, this->device_uid); |   buffer.encode_uint32(12, this->device_id); | ||||||
| } | } | ||||||
| void ListEntitiesLockResponse::calculate_size(uint32_t &total_size) const { | void ListEntitiesLockResponse::calculate_size(uint32_t &total_size) const { | ||||||
|   ProtoSize::add_string_field(total_size, 1, this->object_id, false); |   ProtoSize::add_string_field(total_size, 1, this->object_id, false); | ||||||
| @@ -5941,7 +5999,7 @@ void ListEntitiesLockResponse::calculate_size(uint32_t &total_size) const { | |||||||
|   ProtoSize::add_bool_field(total_size, 1, this->supports_open, false); |   ProtoSize::add_bool_field(total_size, 1, this->supports_open, false); | ||||||
|   ProtoSize::add_bool_field(total_size, 1, this->requires_code, false); |   ProtoSize::add_bool_field(total_size, 1, this->requires_code, false); | ||||||
|   ProtoSize::add_string_field(total_size, 1, this->code_format, false); |   ProtoSize::add_string_field(total_size, 1, this->code_format, false); | ||||||
|   ProtoSize::add_uint32_field(total_size, 1, this->device_uid, false); |   ProtoSize::add_uint32_field(total_size, 1, this->device_id, false); | ||||||
| } | } | ||||||
| #ifdef HAS_PROTO_MESSAGE_DUMP | #ifdef HAS_PROTO_MESSAGE_DUMP | ||||||
| void ListEntitiesLockResponse::dump_to(std::string &out) const { | void ListEntitiesLockResponse::dump_to(std::string &out) const { | ||||||
| @@ -5992,8 +6050,8 @@ void ListEntitiesLockResponse::dump_to(std::string &out) const { | |||||||
|   out.append("'").append(this->code_format).append("'"); |   out.append("'").append(this->code_format).append("'"); | ||||||
|   out.append("\n"); |   out.append("\n"); | ||||||
|  |  | ||||||
|   out.append("  device_uid: "); |   out.append("  device_id: "); | ||||||
|   sprintf(buffer, "%" PRIu32, this->device_uid); |   sprintf(buffer, "%" PRIu32, this->device_id); | ||||||
|   out.append(buffer); |   out.append(buffer); | ||||||
|   out.append("\n"); |   out.append("\n"); | ||||||
|   out.append("}"); |   out.append("}"); | ||||||
| @@ -6122,7 +6180,7 @@ bool ListEntitiesButtonResponse::decode_varint(uint32_t field_id, ProtoVarInt va | |||||||
|       return true; |       return true; | ||||||
|     } |     } | ||||||
|     case 9: { |     case 9: { | ||||||
|       this->device_uid = value.as_uint32(); |       this->device_id = value.as_uint32(); | ||||||
|       return true; |       return true; | ||||||
|     } |     } | ||||||
|     default: |     default: | ||||||
| @@ -6174,7 +6232,7 @@ void ListEntitiesButtonResponse::encode(ProtoWriteBuffer buffer) const { | |||||||
|   buffer.encode_bool(6, this->disabled_by_default); |   buffer.encode_bool(6, this->disabled_by_default); | ||||||
|   buffer.encode_enum<enums::EntityCategory>(7, this->entity_category); |   buffer.encode_enum<enums::EntityCategory>(7, this->entity_category); | ||||||
|   buffer.encode_string(8, this->device_class); |   buffer.encode_string(8, this->device_class); | ||||||
|   buffer.encode_uint32(9, this->device_uid); |   buffer.encode_uint32(9, this->device_id); | ||||||
| } | } | ||||||
| void ListEntitiesButtonResponse::calculate_size(uint32_t &total_size) const { | void ListEntitiesButtonResponse::calculate_size(uint32_t &total_size) const { | ||||||
|   ProtoSize::add_string_field(total_size, 1, this->object_id, false); |   ProtoSize::add_string_field(total_size, 1, this->object_id, false); | ||||||
| @@ -6185,7 +6243,7 @@ void ListEntitiesButtonResponse::calculate_size(uint32_t &total_size) const { | |||||||
|   ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false); |   ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false); | ||||||
|   ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false); |   ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false); | ||||||
|   ProtoSize::add_string_field(total_size, 1, this->device_class, false); |   ProtoSize::add_string_field(total_size, 1, this->device_class, false); | ||||||
|   ProtoSize::add_uint32_field(total_size, 1, this->device_uid, false); |   ProtoSize::add_uint32_field(total_size, 1, this->device_id, false); | ||||||
| } | } | ||||||
| #ifdef HAS_PROTO_MESSAGE_DUMP | #ifdef HAS_PROTO_MESSAGE_DUMP | ||||||
| void ListEntitiesButtonResponse::dump_to(std::string &out) const { | void ListEntitiesButtonResponse::dump_to(std::string &out) const { | ||||||
| @@ -6224,8 +6282,8 @@ void ListEntitiesButtonResponse::dump_to(std::string &out) const { | |||||||
|   out.append("'").append(this->device_class).append("'"); |   out.append("'").append(this->device_class).append("'"); | ||||||
|   out.append("\n"); |   out.append("\n"); | ||||||
|  |  | ||||||
|   out.append("  device_uid: "); |   out.append("  device_id: "); | ||||||
|   sprintf(buffer, "%" PRIu32, this->device_uid); |   sprintf(buffer, "%" PRIu32, this->device_id); | ||||||
|   out.append(buffer); |   out.append(buffer); | ||||||
|   out.append("\n"); |   out.append("\n"); | ||||||
|   out.append("}"); |   out.append("}"); | ||||||
| @@ -6346,7 +6404,7 @@ bool ListEntitiesMediaPlayerResponse::decode_varint(uint32_t field_id, ProtoVarI | |||||||
|       return true; |       return true; | ||||||
|     } |     } | ||||||
|     case 10: { |     case 10: { | ||||||
|       this->device_uid = value.as_uint32(); |       this->device_id = value.as_uint32(); | ||||||
|       return true; |       return true; | ||||||
|     } |     } | ||||||
|     default: |     default: | ||||||
| @@ -6401,7 +6459,7 @@ void ListEntitiesMediaPlayerResponse::encode(ProtoWriteBuffer buffer) const { | |||||||
|   for (auto &it : this->supported_formats) { |   for (auto &it : this->supported_formats) { | ||||||
|     buffer.encode_message<MediaPlayerSupportedFormat>(9, it, true); |     buffer.encode_message<MediaPlayerSupportedFormat>(9, it, true); | ||||||
|   } |   } | ||||||
|   buffer.encode_uint32(10, this->device_uid); |   buffer.encode_uint32(10, this->device_id); | ||||||
| } | } | ||||||
| void ListEntitiesMediaPlayerResponse::calculate_size(uint32_t &total_size) const { | void ListEntitiesMediaPlayerResponse::calculate_size(uint32_t &total_size) const { | ||||||
|   ProtoSize::add_string_field(total_size, 1, this->object_id, false); |   ProtoSize::add_string_field(total_size, 1, this->object_id, false); | ||||||
| @@ -6413,7 +6471,7 @@ void ListEntitiesMediaPlayerResponse::calculate_size(uint32_t &total_size) const | |||||||
|   ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false); |   ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false); | ||||||
|   ProtoSize::add_bool_field(total_size, 1, this->supports_pause, false); |   ProtoSize::add_bool_field(total_size, 1, this->supports_pause, false); | ||||||
|   ProtoSize::add_repeated_message(total_size, 1, this->supported_formats); |   ProtoSize::add_repeated_message(total_size, 1, this->supported_formats); | ||||||
|   ProtoSize::add_uint32_field(total_size, 1, this->device_uid, false); |   ProtoSize::add_uint32_field(total_size, 1, this->device_id, false); | ||||||
| } | } | ||||||
| #ifdef HAS_PROTO_MESSAGE_DUMP | #ifdef HAS_PROTO_MESSAGE_DUMP | ||||||
| void ListEntitiesMediaPlayerResponse::dump_to(std::string &out) const { | void ListEntitiesMediaPlayerResponse::dump_to(std::string &out) const { | ||||||
| @@ -6458,8 +6516,8 @@ void ListEntitiesMediaPlayerResponse::dump_to(std::string &out) const { | |||||||
|     out.append("\n"); |     out.append("\n"); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   out.append("  device_uid: "); |   out.append("  device_id: "); | ||||||
|   sprintf(buffer, "%" PRIu32, this->device_uid); |   sprintf(buffer, "%" PRIu32, this->device_id); | ||||||
|   out.append(buffer); |   out.append(buffer); | ||||||
|   out.append("\n"); |   out.append("\n"); | ||||||
|   out.append("}"); |   out.append("}"); | ||||||
| @@ -8773,7 +8831,7 @@ bool ListEntitiesAlarmControlPanelResponse::decode_varint(uint32_t field_id, Pro | |||||||
|       return true; |       return true; | ||||||
|     } |     } | ||||||
|     case 11: { |     case 11: { | ||||||
|       this->device_uid = value.as_uint32(); |       this->device_id = value.as_uint32(); | ||||||
|       return true; |       return true; | ||||||
|     } |     } | ||||||
|     default: |     default: | ||||||
| @@ -8823,7 +8881,7 @@ void ListEntitiesAlarmControlPanelResponse::encode(ProtoWriteBuffer buffer) cons | |||||||
|   buffer.encode_uint32(8, this->supported_features); |   buffer.encode_uint32(8, this->supported_features); | ||||||
|   buffer.encode_bool(9, this->requires_code); |   buffer.encode_bool(9, this->requires_code); | ||||||
|   buffer.encode_bool(10, this->requires_code_to_arm); |   buffer.encode_bool(10, this->requires_code_to_arm); | ||||||
|   buffer.encode_uint32(11, this->device_uid); |   buffer.encode_uint32(11, this->device_id); | ||||||
| } | } | ||||||
| void ListEntitiesAlarmControlPanelResponse::calculate_size(uint32_t &total_size) const { | void ListEntitiesAlarmControlPanelResponse::calculate_size(uint32_t &total_size) const { | ||||||
|   ProtoSize::add_string_field(total_size, 1, this->object_id, false); |   ProtoSize::add_string_field(total_size, 1, this->object_id, false); | ||||||
| @@ -8836,7 +8894,7 @@ void ListEntitiesAlarmControlPanelResponse::calculate_size(uint32_t &total_size) | |||||||
|   ProtoSize::add_uint32_field(total_size, 1, this->supported_features, false); |   ProtoSize::add_uint32_field(total_size, 1, this->supported_features, false); | ||||||
|   ProtoSize::add_bool_field(total_size, 1, this->requires_code, false); |   ProtoSize::add_bool_field(total_size, 1, this->requires_code, false); | ||||||
|   ProtoSize::add_bool_field(total_size, 1, this->requires_code_to_arm, false); |   ProtoSize::add_bool_field(total_size, 1, this->requires_code_to_arm, false); | ||||||
|   ProtoSize::add_uint32_field(total_size, 1, this->device_uid, false); |   ProtoSize::add_uint32_field(total_size, 1, this->device_id, false); | ||||||
| } | } | ||||||
| #ifdef HAS_PROTO_MESSAGE_DUMP | #ifdef HAS_PROTO_MESSAGE_DUMP | ||||||
| void ListEntitiesAlarmControlPanelResponse::dump_to(std::string &out) const { | void ListEntitiesAlarmControlPanelResponse::dump_to(std::string &out) const { | ||||||
| @@ -8884,8 +8942,8 @@ void ListEntitiesAlarmControlPanelResponse::dump_to(std::string &out) const { | |||||||
|   out.append(YESNO(this->requires_code_to_arm)); |   out.append(YESNO(this->requires_code_to_arm)); | ||||||
|   out.append("\n"); |   out.append("\n"); | ||||||
|  |  | ||||||
|   out.append("  device_uid: "); |   out.append("  device_id: "); | ||||||
|   sprintf(buffer, "%" PRIu32, this->device_uid); |   sprintf(buffer, "%" PRIu32, this->device_id); | ||||||
|   out.append(buffer); |   out.append(buffer); | ||||||
|   out.append("\n"); |   out.append("\n"); | ||||||
|   out.append("}"); |   out.append("}"); | ||||||
| @@ -9016,7 +9074,7 @@ bool ListEntitiesTextResponse::decode_varint(uint32_t field_id, ProtoVarInt valu | |||||||
|       return true; |       return true; | ||||||
|     } |     } | ||||||
|     case 12: { |     case 12: { | ||||||
|       this->device_uid = value.as_uint32(); |       this->device_id = value.as_uint32(); | ||||||
|       return true; |       return true; | ||||||
|     } |     } | ||||||
|     default: |     default: | ||||||
| @@ -9071,7 +9129,7 @@ void ListEntitiesTextResponse::encode(ProtoWriteBuffer buffer) const { | |||||||
|   buffer.encode_uint32(9, this->max_length); |   buffer.encode_uint32(9, this->max_length); | ||||||
|   buffer.encode_string(10, this->pattern); |   buffer.encode_string(10, this->pattern); | ||||||
|   buffer.encode_enum<enums::TextMode>(11, this->mode); |   buffer.encode_enum<enums::TextMode>(11, this->mode); | ||||||
|   buffer.encode_uint32(12, this->device_uid); |   buffer.encode_uint32(12, this->device_id); | ||||||
| } | } | ||||||
| void ListEntitiesTextResponse::calculate_size(uint32_t &total_size) const { | void ListEntitiesTextResponse::calculate_size(uint32_t &total_size) const { | ||||||
|   ProtoSize::add_string_field(total_size, 1, this->object_id, false); |   ProtoSize::add_string_field(total_size, 1, this->object_id, false); | ||||||
| @@ -9085,7 +9143,7 @@ void ListEntitiesTextResponse::calculate_size(uint32_t &total_size) const { | |||||||
|   ProtoSize::add_uint32_field(total_size, 1, this->max_length, false); |   ProtoSize::add_uint32_field(total_size, 1, this->max_length, false); | ||||||
|   ProtoSize::add_string_field(total_size, 1, this->pattern, false); |   ProtoSize::add_string_field(total_size, 1, this->pattern, false); | ||||||
|   ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->mode), false); |   ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->mode), false); | ||||||
|   ProtoSize::add_uint32_field(total_size, 1, this->device_uid, false); |   ProtoSize::add_uint32_field(total_size, 1, this->device_id, false); | ||||||
| } | } | ||||||
| #ifdef HAS_PROTO_MESSAGE_DUMP | #ifdef HAS_PROTO_MESSAGE_DUMP | ||||||
| void ListEntitiesTextResponse::dump_to(std::string &out) const { | void ListEntitiesTextResponse::dump_to(std::string &out) const { | ||||||
| @@ -9138,8 +9196,8 @@ void ListEntitiesTextResponse::dump_to(std::string &out) const { | |||||||
|   out.append(proto_enum_to_string<enums::TextMode>(this->mode)); |   out.append(proto_enum_to_string<enums::TextMode>(this->mode)); | ||||||
|   out.append("\n"); |   out.append("\n"); | ||||||
|  |  | ||||||
|   out.append("  device_uid: "); |   out.append("  device_id: "); | ||||||
|   sprintf(buffer, "%" PRIu32, this->device_uid); |   sprintf(buffer, "%" PRIu32, this->device_id); | ||||||
|   out.append(buffer); |   out.append(buffer); | ||||||
|   out.append("\n"); |   out.append("\n"); | ||||||
|   out.append("}"); |   out.append("}"); | ||||||
| @@ -9258,7 +9316,7 @@ bool ListEntitiesDateResponse::decode_varint(uint32_t field_id, ProtoVarInt valu | |||||||
|       return true; |       return true; | ||||||
|     } |     } | ||||||
|     case 8: { |     case 8: { | ||||||
|       this->device_uid = value.as_uint32(); |       this->device_id = value.as_uint32(); | ||||||
|       return true; |       return true; | ||||||
|     } |     } | ||||||
|     default: |     default: | ||||||
| @@ -9305,7 +9363,7 @@ void ListEntitiesDateResponse::encode(ProtoWriteBuffer buffer) const { | |||||||
|   buffer.encode_string(5, this->icon); |   buffer.encode_string(5, this->icon); | ||||||
|   buffer.encode_bool(6, this->disabled_by_default); |   buffer.encode_bool(6, this->disabled_by_default); | ||||||
|   buffer.encode_enum<enums::EntityCategory>(7, this->entity_category); |   buffer.encode_enum<enums::EntityCategory>(7, this->entity_category); | ||||||
|   buffer.encode_uint32(8, this->device_uid); |   buffer.encode_uint32(8, this->device_id); | ||||||
| } | } | ||||||
| void ListEntitiesDateResponse::calculate_size(uint32_t &total_size) const { | void ListEntitiesDateResponse::calculate_size(uint32_t &total_size) const { | ||||||
|   ProtoSize::add_string_field(total_size, 1, this->object_id, false); |   ProtoSize::add_string_field(total_size, 1, this->object_id, false); | ||||||
| @@ -9315,7 +9373,7 @@ void ListEntitiesDateResponse::calculate_size(uint32_t &total_size) const { | |||||||
|   ProtoSize::add_string_field(total_size, 1, this->icon, false); |   ProtoSize::add_string_field(total_size, 1, this->icon, false); | ||||||
|   ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false); |   ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false); | ||||||
|   ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false); |   ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false); | ||||||
|   ProtoSize::add_uint32_field(total_size, 1, this->device_uid, false); |   ProtoSize::add_uint32_field(total_size, 1, this->device_id, false); | ||||||
| } | } | ||||||
| #ifdef HAS_PROTO_MESSAGE_DUMP | #ifdef HAS_PROTO_MESSAGE_DUMP | ||||||
| void ListEntitiesDateResponse::dump_to(std::string &out) const { | void ListEntitiesDateResponse::dump_to(std::string &out) const { | ||||||
| @@ -9350,8 +9408,8 @@ void ListEntitiesDateResponse::dump_to(std::string &out) const { | |||||||
|   out.append(proto_enum_to_string<enums::EntityCategory>(this->entity_category)); |   out.append(proto_enum_to_string<enums::EntityCategory>(this->entity_category)); | ||||||
|   out.append("\n"); |   out.append("\n"); | ||||||
|  |  | ||||||
|   out.append("  device_uid: "); |   out.append("  device_id: "); | ||||||
|   sprintf(buffer, "%" PRIu32, this->device_uid); |   sprintf(buffer, "%" PRIu32, this->device_id); | ||||||
|   out.append(buffer); |   out.append(buffer); | ||||||
|   out.append("\n"); |   out.append("\n"); | ||||||
|   out.append("}"); |   out.append("}"); | ||||||
| @@ -9510,7 +9568,7 @@ bool ListEntitiesTimeResponse::decode_varint(uint32_t field_id, ProtoVarInt valu | |||||||
|       return true; |       return true; | ||||||
|     } |     } | ||||||
|     case 8: { |     case 8: { | ||||||
|       this->device_uid = value.as_uint32(); |       this->device_id = value.as_uint32(); | ||||||
|       return true; |       return true; | ||||||
|     } |     } | ||||||
|     default: |     default: | ||||||
| @@ -9557,7 +9615,7 @@ void ListEntitiesTimeResponse::encode(ProtoWriteBuffer buffer) const { | |||||||
|   buffer.encode_string(5, this->icon); |   buffer.encode_string(5, this->icon); | ||||||
|   buffer.encode_bool(6, this->disabled_by_default); |   buffer.encode_bool(6, this->disabled_by_default); | ||||||
|   buffer.encode_enum<enums::EntityCategory>(7, this->entity_category); |   buffer.encode_enum<enums::EntityCategory>(7, this->entity_category); | ||||||
|   buffer.encode_uint32(8, this->device_uid); |   buffer.encode_uint32(8, this->device_id); | ||||||
| } | } | ||||||
| void ListEntitiesTimeResponse::calculate_size(uint32_t &total_size) const { | void ListEntitiesTimeResponse::calculate_size(uint32_t &total_size) const { | ||||||
|   ProtoSize::add_string_field(total_size, 1, this->object_id, false); |   ProtoSize::add_string_field(total_size, 1, this->object_id, false); | ||||||
| @@ -9567,7 +9625,7 @@ void ListEntitiesTimeResponse::calculate_size(uint32_t &total_size) const { | |||||||
|   ProtoSize::add_string_field(total_size, 1, this->icon, false); |   ProtoSize::add_string_field(total_size, 1, this->icon, false); | ||||||
|   ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false); |   ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false); | ||||||
|   ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false); |   ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false); | ||||||
|   ProtoSize::add_uint32_field(total_size, 1, this->device_uid, false); |   ProtoSize::add_uint32_field(total_size, 1, this->device_id, false); | ||||||
| } | } | ||||||
| #ifdef HAS_PROTO_MESSAGE_DUMP | #ifdef HAS_PROTO_MESSAGE_DUMP | ||||||
| void ListEntitiesTimeResponse::dump_to(std::string &out) const { | void ListEntitiesTimeResponse::dump_to(std::string &out) const { | ||||||
| @@ -9602,8 +9660,8 @@ void ListEntitiesTimeResponse::dump_to(std::string &out) const { | |||||||
|   out.append(proto_enum_to_string<enums::EntityCategory>(this->entity_category)); |   out.append(proto_enum_to_string<enums::EntityCategory>(this->entity_category)); | ||||||
|   out.append("\n"); |   out.append("\n"); | ||||||
|  |  | ||||||
|   out.append("  device_uid: "); |   out.append("  device_id: "); | ||||||
|   sprintf(buffer, "%" PRIu32, this->device_uid); |   sprintf(buffer, "%" PRIu32, this->device_id); | ||||||
|   out.append(buffer); |   out.append(buffer); | ||||||
|   out.append("\n"); |   out.append("\n"); | ||||||
|   out.append("}"); |   out.append("}"); | ||||||
| @@ -9762,7 +9820,7 @@ bool ListEntitiesEventResponse::decode_varint(uint32_t field_id, ProtoVarInt val | |||||||
|       return true; |       return true; | ||||||
|     } |     } | ||||||
|     case 10: { |     case 10: { | ||||||
|       this->device_uid = value.as_uint32(); |       this->device_id = value.as_uint32(); | ||||||
|       return true; |       return true; | ||||||
|     } |     } | ||||||
|     default: |     default: | ||||||
| @@ -9821,7 +9879,7 @@ void ListEntitiesEventResponse::encode(ProtoWriteBuffer buffer) const { | |||||||
|   for (auto &it : this->event_types) { |   for (auto &it : this->event_types) { | ||||||
|     buffer.encode_string(9, it, true); |     buffer.encode_string(9, it, true); | ||||||
|   } |   } | ||||||
|   buffer.encode_uint32(10, this->device_uid); |   buffer.encode_uint32(10, this->device_id); | ||||||
| } | } | ||||||
| void ListEntitiesEventResponse::calculate_size(uint32_t &total_size) const { | void ListEntitiesEventResponse::calculate_size(uint32_t &total_size) const { | ||||||
|   ProtoSize::add_string_field(total_size, 1, this->object_id, false); |   ProtoSize::add_string_field(total_size, 1, this->object_id, false); | ||||||
| @@ -9837,7 +9895,7 @@ void ListEntitiesEventResponse::calculate_size(uint32_t &total_size) const { | |||||||
|       ProtoSize::add_string_field(total_size, 1, it, true); |       ProtoSize::add_string_field(total_size, 1, it, true); | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
|   ProtoSize::add_uint32_field(total_size, 1, this->device_uid, false); |   ProtoSize::add_uint32_field(total_size, 1, this->device_id, false); | ||||||
| } | } | ||||||
| #ifdef HAS_PROTO_MESSAGE_DUMP | #ifdef HAS_PROTO_MESSAGE_DUMP | ||||||
| void ListEntitiesEventResponse::dump_to(std::string &out) const { | void ListEntitiesEventResponse::dump_to(std::string &out) const { | ||||||
| @@ -9882,8 +9940,8 @@ void ListEntitiesEventResponse::dump_to(std::string &out) const { | |||||||
|     out.append("\n"); |     out.append("\n"); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   out.append("  device_uid: "); |   out.append("  device_id: "); | ||||||
|   sprintf(buffer, "%" PRIu32, this->device_uid); |   sprintf(buffer, "%" PRIu32, this->device_id); | ||||||
|   out.append(buffer); |   out.append(buffer); | ||||||
|   out.append("\n"); |   out.append("\n"); | ||||||
|   out.append("}"); |   out.append("}"); | ||||||
| @@ -9955,7 +10013,7 @@ bool ListEntitiesValveResponse::decode_varint(uint32_t field_id, ProtoVarInt val | |||||||
|       return true; |       return true; | ||||||
|     } |     } | ||||||
|     case 12: { |     case 12: { | ||||||
|       this->device_uid = value.as_uint32(); |       this->device_id = value.as_uint32(); | ||||||
|       return true; |       return true; | ||||||
|     } |     } | ||||||
|     default: |     default: | ||||||
| @@ -10010,7 +10068,7 @@ void ListEntitiesValveResponse::encode(ProtoWriteBuffer buffer) const { | |||||||
|   buffer.encode_bool(9, this->assumed_state); |   buffer.encode_bool(9, this->assumed_state); | ||||||
|   buffer.encode_bool(10, this->supports_position); |   buffer.encode_bool(10, this->supports_position); | ||||||
|   buffer.encode_bool(11, this->supports_stop); |   buffer.encode_bool(11, this->supports_stop); | ||||||
|   buffer.encode_uint32(12, this->device_uid); |   buffer.encode_uint32(12, this->device_id); | ||||||
| } | } | ||||||
| void ListEntitiesValveResponse::calculate_size(uint32_t &total_size) const { | void ListEntitiesValveResponse::calculate_size(uint32_t &total_size) const { | ||||||
|   ProtoSize::add_string_field(total_size, 1, this->object_id, false); |   ProtoSize::add_string_field(total_size, 1, this->object_id, false); | ||||||
| @@ -10024,7 +10082,7 @@ void ListEntitiesValveResponse::calculate_size(uint32_t &total_size) const { | |||||||
|   ProtoSize::add_bool_field(total_size, 1, this->assumed_state, false); |   ProtoSize::add_bool_field(total_size, 1, this->assumed_state, false); | ||||||
|   ProtoSize::add_bool_field(total_size, 1, this->supports_position, false); |   ProtoSize::add_bool_field(total_size, 1, this->supports_position, false); | ||||||
|   ProtoSize::add_bool_field(total_size, 1, this->supports_stop, false); |   ProtoSize::add_bool_field(total_size, 1, this->supports_stop, false); | ||||||
|   ProtoSize::add_uint32_field(total_size, 1, this->device_uid, false); |   ProtoSize::add_uint32_field(total_size, 1, this->device_id, false); | ||||||
| } | } | ||||||
| #ifdef HAS_PROTO_MESSAGE_DUMP | #ifdef HAS_PROTO_MESSAGE_DUMP | ||||||
| void ListEntitiesValveResponse::dump_to(std::string &out) const { | void ListEntitiesValveResponse::dump_to(std::string &out) const { | ||||||
| @@ -10075,8 +10133,8 @@ void ListEntitiesValveResponse::dump_to(std::string &out) const { | |||||||
|   out.append(YESNO(this->supports_stop)); |   out.append(YESNO(this->supports_stop)); | ||||||
|   out.append("\n"); |   out.append("\n"); | ||||||
|  |  | ||||||
|   out.append("  device_uid: "); |   out.append("  device_id: "); | ||||||
|   sprintf(buffer, "%" PRIu32, this->device_uid); |   sprintf(buffer, "%" PRIu32, this->device_id); | ||||||
|   out.append(buffer); |   out.append(buffer); | ||||||
|   out.append("\n"); |   out.append("\n"); | ||||||
|   out.append("}"); |   out.append("}"); | ||||||
| @@ -10211,7 +10269,7 @@ bool ListEntitiesDateTimeResponse::decode_varint(uint32_t field_id, ProtoVarInt | |||||||
|       return true; |       return true; | ||||||
|     } |     } | ||||||
|     case 8: { |     case 8: { | ||||||
|       this->device_uid = value.as_uint32(); |       this->device_id = value.as_uint32(); | ||||||
|       return true; |       return true; | ||||||
|     } |     } | ||||||
|     default: |     default: | ||||||
| @@ -10258,7 +10316,7 @@ void ListEntitiesDateTimeResponse::encode(ProtoWriteBuffer buffer) const { | |||||||
|   buffer.encode_string(5, this->icon); |   buffer.encode_string(5, this->icon); | ||||||
|   buffer.encode_bool(6, this->disabled_by_default); |   buffer.encode_bool(6, this->disabled_by_default); | ||||||
|   buffer.encode_enum<enums::EntityCategory>(7, this->entity_category); |   buffer.encode_enum<enums::EntityCategory>(7, this->entity_category); | ||||||
|   buffer.encode_uint32(8, this->device_uid); |   buffer.encode_uint32(8, this->device_id); | ||||||
| } | } | ||||||
| void ListEntitiesDateTimeResponse::calculate_size(uint32_t &total_size) const { | void ListEntitiesDateTimeResponse::calculate_size(uint32_t &total_size) const { | ||||||
|   ProtoSize::add_string_field(total_size, 1, this->object_id, false); |   ProtoSize::add_string_field(total_size, 1, this->object_id, false); | ||||||
| @@ -10268,7 +10326,7 @@ void ListEntitiesDateTimeResponse::calculate_size(uint32_t &total_size) const { | |||||||
|   ProtoSize::add_string_field(total_size, 1, this->icon, false); |   ProtoSize::add_string_field(total_size, 1, this->icon, false); | ||||||
|   ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false); |   ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false); | ||||||
|   ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false); |   ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false); | ||||||
|   ProtoSize::add_uint32_field(total_size, 1, this->device_uid, false); |   ProtoSize::add_uint32_field(total_size, 1, this->device_id, false); | ||||||
| } | } | ||||||
| #ifdef HAS_PROTO_MESSAGE_DUMP | #ifdef HAS_PROTO_MESSAGE_DUMP | ||||||
| void ListEntitiesDateTimeResponse::dump_to(std::string &out) const { | void ListEntitiesDateTimeResponse::dump_to(std::string &out) const { | ||||||
| @@ -10303,8 +10361,8 @@ void ListEntitiesDateTimeResponse::dump_to(std::string &out) const { | |||||||
|   out.append(proto_enum_to_string<enums::EntityCategory>(this->entity_category)); |   out.append(proto_enum_to_string<enums::EntityCategory>(this->entity_category)); | ||||||
|   out.append("\n"); |   out.append("\n"); | ||||||
|  |  | ||||||
|   out.append("  device_uid: "); |   out.append("  device_id: "); | ||||||
|   sprintf(buffer, "%" PRIu32, this->device_uid); |   sprintf(buffer, "%" PRIu32, this->device_id); | ||||||
|   out.append(buffer); |   out.append(buffer); | ||||||
|   out.append("\n"); |   out.append("\n"); | ||||||
|   out.append("}"); |   out.append("}"); | ||||||
| @@ -10413,7 +10471,7 @@ bool ListEntitiesUpdateResponse::decode_varint(uint32_t field_id, ProtoVarInt va | |||||||
|       return true; |       return true; | ||||||
|     } |     } | ||||||
|     case 9: { |     case 9: { | ||||||
|       this->device_uid = value.as_uint32(); |       this->device_id = value.as_uint32(); | ||||||
|       return true; |       return true; | ||||||
|     } |     } | ||||||
|     default: |     default: | ||||||
| @@ -10465,7 +10523,7 @@ void ListEntitiesUpdateResponse::encode(ProtoWriteBuffer buffer) const { | |||||||
|   buffer.encode_bool(6, this->disabled_by_default); |   buffer.encode_bool(6, this->disabled_by_default); | ||||||
|   buffer.encode_enum<enums::EntityCategory>(7, this->entity_category); |   buffer.encode_enum<enums::EntityCategory>(7, this->entity_category); | ||||||
|   buffer.encode_string(8, this->device_class); |   buffer.encode_string(8, this->device_class); | ||||||
|   buffer.encode_uint32(9, this->device_uid); |   buffer.encode_uint32(9, this->device_id); | ||||||
| } | } | ||||||
| void ListEntitiesUpdateResponse::calculate_size(uint32_t &total_size) const { | void ListEntitiesUpdateResponse::calculate_size(uint32_t &total_size) const { | ||||||
|   ProtoSize::add_string_field(total_size, 1, this->object_id, false); |   ProtoSize::add_string_field(total_size, 1, this->object_id, false); | ||||||
| @@ -10476,7 +10534,7 @@ void ListEntitiesUpdateResponse::calculate_size(uint32_t &total_size) const { | |||||||
|   ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false); |   ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false); | ||||||
|   ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false); |   ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false); | ||||||
|   ProtoSize::add_string_field(total_size, 1, this->device_class, false); |   ProtoSize::add_string_field(total_size, 1, this->device_class, false); | ||||||
|   ProtoSize::add_uint32_field(total_size, 1, this->device_uid, false); |   ProtoSize::add_uint32_field(total_size, 1, this->device_id, false); | ||||||
| } | } | ||||||
| #ifdef HAS_PROTO_MESSAGE_DUMP | #ifdef HAS_PROTO_MESSAGE_DUMP | ||||||
| void ListEntitiesUpdateResponse::dump_to(std::string &out) const { | void ListEntitiesUpdateResponse::dump_to(std::string &out) const { | ||||||
| @@ -10515,8 +10573,8 @@ void ListEntitiesUpdateResponse::dump_to(std::string &out) const { | |||||||
|   out.append("'").append(this->device_class).append("'"); |   out.append("'").append(this->device_class).append("'"); | ||||||
|   out.append("\n"); |   out.append("\n"); | ||||||
|  |  | ||||||
|   out.append("  device_uid: "); |   out.append("  device_id: "); | ||||||
|   sprintf(buffer, "%" PRIu32, this->device_uid); |   sprintf(buffer, "%" PRIu32, this->device_id); | ||||||
|   out.append(buffer); |   out.append(buffer); | ||||||
|   out.append("\n"); |   out.append("\n"); | ||||||
|   out.append("}"); |   out.append("}"); | ||||||
|   | |||||||
| @@ -415,11 +415,25 @@ class DeviceInfoRequest : public ProtoMessage { | |||||||
|  |  | ||||||
|  protected: |  protected: | ||||||
| }; | }; | ||||||
|  | class SubAreaInfo : public ProtoMessage { | ||||||
|  |  public: | ||||||
|  |   uint32_t area_id{0}; | ||||||
|  |   std::string name{}; | ||||||
|  |   void encode(ProtoWriteBuffer buffer) const override; | ||||||
|  |   void calculate_size(uint32_t &total_size) const override; | ||||||
|  | #ifdef HAS_PROTO_MESSAGE_DUMP | ||||||
|  |   void dump_to(std::string &out) const override; | ||||||
|  | #endif | ||||||
|  |  | ||||||
|  |  protected: | ||||||
|  |   bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override; | ||||||
|  |   bool decode_varint(uint32_t field_id, ProtoVarInt value) override; | ||||||
|  | }; | ||||||
| class SubDeviceInfo : public ProtoMessage { | class SubDeviceInfo : public ProtoMessage { | ||||||
|  public: |  public: | ||||||
|   uint32_t uid{0}; |   uint32_t device_id{0}; | ||||||
|   std::string name{}; |   std::string name{}; | ||||||
|   std::string suggested_area{}; |   uint32_t area_id{0}; | ||||||
|   void encode(ProtoWriteBuffer buffer) const override; |   void encode(ProtoWriteBuffer buffer) const override; | ||||||
|   void calculate_size(uint32_t &total_size) const override; |   void calculate_size(uint32_t &total_size) const override; | ||||||
| #ifdef HAS_PROTO_MESSAGE_DUMP | #ifdef HAS_PROTO_MESSAGE_DUMP | ||||||
| @@ -433,7 +447,7 @@ class SubDeviceInfo : public ProtoMessage { | |||||||
| class DeviceInfoResponse : public ProtoMessage { | class DeviceInfoResponse : public ProtoMessage { | ||||||
|  public: |  public: | ||||||
|   static constexpr uint16_t MESSAGE_TYPE = 10; |   static constexpr uint16_t MESSAGE_TYPE = 10; | ||||||
|   static constexpr uint16_t ESTIMATED_SIZE = 165; |   static constexpr uint16_t ESTIMATED_SIZE = 201; | ||||||
| #ifdef HAS_PROTO_MESSAGE_DUMP | #ifdef HAS_PROTO_MESSAGE_DUMP | ||||||
|   static constexpr const char *message_name() { return "device_info_response"; } |   static constexpr const char *message_name() { return "device_info_response"; } | ||||||
| #endif | #endif | ||||||
| @@ -457,6 +471,7 @@ class DeviceInfoResponse : public ProtoMessage { | |||||||
|   std::string bluetooth_mac_address{}; |   std::string bluetooth_mac_address{}; | ||||||
|   bool api_encryption_supported{false}; |   bool api_encryption_supported{false}; | ||||||
|   std::vector<SubDeviceInfo> sub_devices{}; |   std::vector<SubDeviceInfo> sub_devices{}; | ||||||
|  |   std::vector<SubAreaInfo> sub_areas{}; | ||||||
|   void encode(ProtoWriteBuffer buffer) const override; |   void encode(ProtoWriteBuffer buffer) const override; | ||||||
|   void calculate_size(uint32_t &total_size) const override; |   void calculate_size(uint32_t &total_size) const override; | ||||||
| #ifdef HAS_PROTO_MESSAGE_DUMP | #ifdef HAS_PROTO_MESSAGE_DUMP | ||||||
| @@ -515,7 +530,7 @@ class ListEntitiesBinarySensorResponse : public InfoResponseProtoMessage { | |||||||
| #endif | #endif | ||||||
|   std::string device_class{}; |   std::string device_class{}; | ||||||
|   bool is_status_binary_sensor{false}; |   bool is_status_binary_sensor{false}; | ||||||
|   uint32_t device_uid{0}; |   uint32_t device_id{0}; | ||||||
|   void encode(ProtoWriteBuffer buffer) const override; |   void encode(ProtoWriteBuffer buffer) const override; | ||||||
|   void calculate_size(uint32_t &total_size) const override; |   void calculate_size(uint32_t &total_size) const override; | ||||||
| #ifdef HAS_PROTO_MESSAGE_DUMP | #ifdef HAS_PROTO_MESSAGE_DUMP | ||||||
| @@ -558,7 +573,7 @@ class ListEntitiesCoverResponse : public InfoResponseProtoMessage { | |||||||
|   bool supports_tilt{false}; |   bool supports_tilt{false}; | ||||||
|   std::string device_class{}; |   std::string device_class{}; | ||||||
|   bool supports_stop{false}; |   bool supports_stop{false}; | ||||||
|   uint32_t device_uid{0}; |   uint32_t device_id{0}; | ||||||
|   void encode(ProtoWriteBuffer buffer) const override; |   void encode(ProtoWriteBuffer buffer) const override; | ||||||
|   void calculate_size(uint32_t &total_size) const override; |   void calculate_size(uint32_t &total_size) const override; | ||||||
| #ifdef HAS_PROTO_MESSAGE_DUMP | #ifdef HAS_PROTO_MESSAGE_DUMP | ||||||
| @@ -628,7 +643,7 @@ class ListEntitiesFanResponse : public InfoResponseProtoMessage { | |||||||
|   bool supports_direction{false}; |   bool supports_direction{false}; | ||||||
|   int32_t supported_speed_count{0}; |   int32_t supported_speed_count{0}; | ||||||
|   std::vector<std::string> supported_preset_modes{}; |   std::vector<std::string> supported_preset_modes{}; | ||||||
|   uint32_t device_uid{0}; |   uint32_t device_id{0}; | ||||||
|   void encode(ProtoWriteBuffer buffer) const override; |   void encode(ProtoWriteBuffer buffer) const override; | ||||||
|   void calculate_size(uint32_t &total_size) const override; |   void calculate_size(uint32_t &total_size) const override; | ||||||
| #ifdef HAS_PROTO_MESSAGE_DUMP | #ifdef HAS_PROTO_MESSAGE_DUMP | ||||||
| @@ -710,7 +725,7 @@ class ListEntitiesLightResponse : public InfoResponseProtoMessage { | |||||||
|   float min_mireds{0.0f}; |   float min_mireds{0.0f}; | ||||||
|   float max_mireds{0.0f}; |   float max_mireds{0.0f}; | ||||||
|   std::vector<std::string> effects{}; |   std::vector<std::string> effects{}; | ||||||
|   uint32_t device_uid{0}; |   uint32_t device_id{0}; | ||||||
|   void encode(ProtoWriteBuffer buffer) const override; |   void encode(ProtoWriteBuffer buffer) const override; | ||||||
|   void calculate_size(uint32_t &total_size) const override; |   void calculate_size(uint32_t &total_size) const override; | ||||||
| #ifdef HAS_PROTO_MESSAGE_DUMP | #ifdef HAS_PROTO_MESSAGE_DUMP | ||||||
| @@ -810,7 +825,7 @@ class ListEntitiesSensorResponse : public InfoResponseProtoMessage { | |||||||
|   std::string device_class{}; |   std::string device_class{}; | ||||||
|   enums::SensorStateClass state_class{}; |   enums::SensorStateClass state_class{}; | ||||||
|   enums::SensorLastResetType legacy_last_reset_type{}; |   enums::SensorLastResetType legacy_last_reset_type{}; | ||||||
|   uint32_t device_uid{0}; |   uint32_t device_id{0}; | ||||||
|   void encode(ProtoWriteBuffer buffer) const override; |   void encode(ProtoWriteBuffer buffer) const override; | ||||||
|   void calculate_size(uint32_t &total_size) const override; |   void calculate_size(uint32_t &total_size) const override; | ||||||
| #ifdef HAS_PROTO_MESSAGE_DUMP | #ifdef HAS_PROTO_MESSAGE_DUMP | ||||||
| @@ -850,7 +865,7 @@ class ListEntitiesSwitchResponse : public InfoResponseProtoMessage { | |||||||
| #endif | #endif | ||||||
|   bool assumed_state{false}; |   bool assumed_state{false}; | ||||||
|   std::string device_class{}; |   std::string device_class{}; | ||||||
|   uint32_t device_uid{0}; |   uint32_t device_id{0}; | ||||||
|   void encode(ProtoWriteBuffer buffer) const override; |   void encode(ProtoWriteBuffer buffer) const override; | ||||||
|   void calculate_size(uint32_t &total_size) const override; |   void calculate_size(uint32_t &total_size) const override; | ||||||
| #ifdef HAS_PROTO_MESSAGE_DUMP | #ifdef HAS_PROTO_MESSAGE_DUMP | ||||||
| @@ -907,7 +922,7 @@ class ListEntitiesTextSensorResponse : public InfoResponseProtoMessage { | |||||||
|   static constexpr const char *message_name() { return "list_entities_text_sensor_response"; } |   static constexpr const char *message_name() { return "list_entities_text_sensor_response"; } | ||||||
| #endif | #endif | ||||||
|   std::string device_class{}; |   std::string device_class{}; | ||||||
|   uint32_t device_uid{0}; |   uint32_t device_id{0}; | ||||||
|   void encode(ProtoWriteBuffer buffer) const override; |   void encode(ProtoWriteBuffer buffer) const override; | ||||||
|   void calculate_size(uint32_t &total_size) const override; |   void calculate_size(uint32_t &total_size) const override; | ||||||
| #ifdef HAS_PROTO_MESSAGE_DUMP | #ifdef HAS_PROTO_MESSAGE_DUMP | ||||||
| @@ -1223,7 +1238,7 @@ class ListEntitiesCameraResponse : public InfoResponseProtoMessage { | |||||||
| #ifdef HAS_PROTO_MESSAGE_DUMP | #ifdef HAS_PROTO_MESSAGE_DUMP | ||||||
|   static constexpr const char *message_name() { return "list_entities_camera_response"; } |   static constexpr const char *message_name() { return "list_entities_camera_response"; } | ||||||
| #endif | #endif | ||||||
|   uint32_t device_uid{0}; |   uint32_t device_id{0}; | ||||||
|   void encode(ProtoWriteBuffer buffer) const override; |   void encode(ProtoWriteBuffer buffer) const override; | ||||||
|   void calculate_size(uint32_t &total_size) const override; |   void calculate_size(uint32_t &total_size) const override; | ||||||
| #ifdef HAS_PROTO_MESSAGE_DUMP | #ifdef HAS_PROTO_MESSAGE_DUMP | ||||||
| @@ -1299,7 +1314,7 @@ class ListEntitiesClimateResponse : public InfoResponseProtoMessage { | |||||||
|   bool supports_target_humidity{false}; |   bool supports_target_humidity{false}; | ||||||
|   float visual_min_humidity{0.0f}; |   float visual_min_humidity{0.0f}; | ||||||
|   float visual_max_humidity{0.0f}; |   float visual_max_humidity{0.0f}; | ||||||
|   uint32_t device_uid{0}; |   uint32_t device_id{0}; | ||||||
|   void encode(ProtoWriteBuffer buffer) const override; |   void encode(ProtoWriteBuffer buffer) const override; | ||||||
|   void calculate_size(uint32_t &total_size) const override; |   void calculate_size(uint32_t &total_size) const override; | ||||||
| #ifdef HAS_PROTO_MESSAGE_DUMP | #ifdef HAS_PROTO_MESSAGE_DUMP | ||||||
| @@ -1397,7 +1412,7 @@ class ListEntitiesNumberResponse : public InfoResponseProtoMessage { | |||||||
|   std::string unit_of_measurement{}; |   std::string unit_of_measurement{}; | ||||||
|   enums::NumberMode mode{}; |   enums::NumberMode mode{}; | ||||||
|   std::string device_class{}; |   std::string device_class{}; | ||||||
|   uint32_t device_uid{0}; |   uint32_t device_id{0}; | ||||||
|   void encode(ProtoWriteBuffer buffer) const override; |   void encode(ProtoWriteBuffer buffer) const override; | ||||||
|   void calculate_size(uint32_t &total_size) const override; |   void calculate_size(uint32_t &total_size) const override; | ||||||
| #ifdef HAS_PROTO_MESSAGE_DUMP | #ifdef HAS_PROTO_MESSAGE_DUMP | ||||||
| @@ -1454,7 +1469,7 @@ class ListEntitiesSelectResponse : public InfoResponseProtoMessage { | |||||||
|   static constexpr const char *message_name() { return "list_entities_select_response"; } |   static constexpr const char *message_name() { return "list_entities_select_response"; } | ||||||
| #endif | #endif | ||||||
|   std::vector<std::string> options{}; |   std::vector<std::string> options{}; | ||||||
|   uint32_t device_uid{0}; |   uint32_t device_id{0}; | ||||||
|   void encode(ProtoWriteBuffer buffer) const override; |   void encode(ProtoWriteBuffer buffer) const override; | ||||||
|   void calculate_size(uint32_t &total_size) const override; |   void calculate_size(uint32_t &total_size) const override; | ||||||
| #ifdef HAS_PROTO_MESSAGE_DUMP | #ifdef HAS_PROTO_MESSAGE_DUMP | ||||||
| @@ -1582,7 +1597,7 @@ class ListEntitiesLockResponse : public InfoResponseProtoMessage { | |||||||
|   bool supports_open{false}; |   bool supports_open{false}; | ||||||
|   bool requires_code{false}; |   bool requires_code{false}; | ||||||
|   std::string code_format{}; |   std::string code_format{}; | ||||||
|   uint32_t device_uid{0}; |   uint32_t device_id{0}; | ||||||
|   void encode(ProtoWriteBuffer buffer) const override; |   void encode(ProtoWriteBuffer buffer) const override; | ||||||
|   void calculate_size(uint32_t &total_size) const override; |   void calculate_size(uint32_t &total_size) const override; | ||||||
| #ifdef HAS_PROTO_MESSAGE_DUMP | #ifdef HAS_PROTO_MESSAGE_DUMP | ||||||
| @@ -1642,7 +1657,7 @@ class ListEntitiesButtonResponse : public InfoResponseProtoMessage { | |||||||
|   static constexpr const char *message_name() { return "list_entities_button_response"; } |   static constexpr const char *message_name() { return "list_entities_button_response"; } | ||||||
| #endif | #endif | ||||||
|   std::string device_class{}; |   std::string device_class{}; | ||||||
|   uint32_t device_uid{0}; |   uint32_t device_id{0}; | ||||||
|   void encode(ProtoWriteBuffer buffer) const override; |   void encode(ProtoWriteBuffer buffer) const override; | ||||||
|   void calculate_size(uint32_t &total_size) const override; |   void calculate_size(uint32_t &total_size) const override; | ||||||
| #ifdef HAS_PROTO_MESSAGE_DUMP | #ifdef HAS_PROTO_MESSAGE_DUMP | ||||||
| @@ -1697,7 +1712,7 @@ class ListEntitiesMediaPlayerResponse : public InfoResponseProtoMessage { | |||||||
| #endif | #endif | ||||||
|   bool supports_pause{false}; |   bool supports_pause{false}; | ||||||
|   std::vector<MediaPlayerSupportedFormat> supported_formats{}; |   std::vector<MediaPlayerSupportedFormat> supported_formats{}; | ||||||
|   uint32_t device_uid{0}; |   uint32_t device_id{0}; | ||||||
|   void encode(ProtoWriteBuffer buffer) const override; |   void encode(ProtoWriteBuffer buffer) const override; | ||||||
|   void calculate_size(uint32_t &total_size) const override; |   void calculate_size(uint32_t &total_size) const override; | ||||||
| #ifdef HAS_PROTO_MESSAGE_DUMP | #ifdef HAS_PROTO_MESSAGE_DUMP | ||||||
| @@ -2569,7 +2584,7 @@ class ListEntitiesAlarmControlPanelResponse : public InfoResponseProtoMessage { | |||||||
|   uint32_t supported_features{0}; |   uint32_t supported_features{0}; | ||||||
|   bool requires_code{false}; |   bool requires_code{false}; | ||||||
|   bool requires_code_to_arm{false}; |   bool requires_code_to_arm{false}; | ||||||
|   uint32_t device_uid{0}; |   uint32_t device_id{0}; | ||||||
|   void encode(ProtoWriteBuffer buffer) const override; |   void encode(ProtoWriteBuffer buffer) const override; | ||||||
|   void calculate_size(uint32_t &total_size) const override; |   void calculate_size(uint32_t &total_size) const override; | ||||||
| #ifdef HAS_PROTO_MESSAGE_DUMP | #ifdef HAS_PROTO_MESSAGE_DUMP | ||||||
| @@ -2631,7 +2646,7 @@ class ListEntitiesTextResponse : public InfoResponseProtoMessage { | |||||||
|   uint32_t max_length{0}; |   uint32_t max_length{0}; | ||||||
|   std::string pattern{}; |   std::string pattern{}; | ||||||
|   enums::TextMode mode{}; |   enums::TextMode mode{}; | ||||||
|   uint32_t device_uid{0}; |   uint32_t device_id{0}; | ||||||
|   void encode(ProtoWriteBuffer buffer) const override; |   void encode(ProtoWriteBuffer buffer) const override; | ||||||
|   void calculate_size(uint32_t &total_size) const override; |   void calculate_size(uint32_t &total_size) const override; | ||||||
| #ifdef HAS_PROTO_MESSAGE_DUMP | #ifdef HAS_PROTO_MESSAGE_DUMP | ||||||
| @@ -2689,7 +2704,7 @@ class ListEntitiesDateResponse : public InfoResponseProtoMessage { | |||||||
| #ifdef HAS_PROTO_MESSAGE_DUMP | #ifdef HAS_PROTO_MESSAGE_DUMP | ||||||
|   static constexpr const char *message_name() { return "list_entities_date_response"; } |   static constexpr const char *message_name() { return "list_entities_date_response"; } | ||||||
| #endif | #endif | ||||||
|   uint32_t device_uid{0}; |   uint32_t device_id{0}; | ||||||
|   void encode(ProtoWriteBuffer buffer) const override; |   void encode(ProtoWriteBuffer buffer) const override; | ||||||
|   void calculate_size(uint32_t &total_size) const override; |   void calculate_size(uint32_t &total_size) const override; | ||||||
| #ifdef HAS_PROTO_MESSAGE_DUMP | #ifdef HAS_PROTO_MESSAGE_DUMP | ||||||
| @@ -2750,7 +2765,7 @@ class ListEntitiesTimeResponse : public InfoResponseProtoMessage { | |||||||
| #ifdef HAS_PROTO_MESSAGE_DUMP | #ifdef HAS_PROTO_MESSAGE_DUMP | ||||||
|   static constexpr const char *message_name() { return "list_entities_time_response"; } |   static constexpr const char *message_name() { return "list_entities_time_response"; } | ||||||
| #endif | #endif | ||||||
|   uint32_t device_uid{0}; |   uint32_t device_id{0}; | ||||||
|   void encode(ProtoWriteBuffer buffer) const override; |   void encode(ProtoWriteBuffer buffer) const override; | ||||||
|   void calculate_size(uint32_t &total_size) const override; |   void calculate_size(uint32_t &total_size) const override; | ||||||
| #ifdef HAS_PROTO_MESSAGE_DUMP | #ifdef HAS_PROTO_MESSAGE_DUMP | ||||||
| @@ -2813,7 +2828,7 @@ class ListEntitiesEventResponse : public InfoResponseProtoMessage { | |||||||
| #endif | #endif | ||||||
|   std::string device_class{}; |   std::string device_class{}; | ||||||
|   std::vector<std::string> event_types{}; |   std::vector<std::string> event_types{}; | ||||||
|   uint32_t device_uid{0}; |   uint32_t device_id{0}; | ||||||
|   void encode(ProtoWriteBuffer buffer) const override; |   void encode(ProtoWriteBuffer buffer) const override; | ||||||
|   void calculate_size(uint32_t &total_size) const override; |   void calculate_size(uint32_t &total_size) const override; | ||||||
| #ifdef HAS_PROTO_MESSAGE_DUMP | #ifdef HAS_PROTO_MESSAGE_DUMP | ||||||
| @@ -2854,7 +2869,7 @@ class ListEntitiesValveResponse : public InfoResponseProtoMessage { | |||||||
|   bool assumed_state{false}; |   bool assumed_state{false}; | ||||||
|   bool supports_position{false}; |   bool supports_position{false}; | ||||||
|   bool supports_stop{false}; |   bool supports_stop{false}; | ||||||
|   uint32_t device_uid{0}; |   uint32_t device_id{0}; | ||||||
|   void encode(ProtoWriteBuffer buffer) const override; |   void encode(ProtoWriteBuffer buffer) const override; | ||||||
|   void calculate_size(uint32_t &total_size) const override; |   void calculate_size(uint32_t &total_size) const override; | ||||||
| #ifdef HAS_PROTO_MESSAGE_DUMP | #ifdef HAS_PROTO_MESSAGE_DUMP | ||||||
| @@ -2913,7 +2928,7 @@ class ListEntitiesDateTimeResponse : public InfoResponseProtoMessage { | |||||||
| #ifdef HAS_PROTO_MESSAGE_DUMP | #ifdef HAS_PROTO_MESSAGE_DUMP | ||||||
|   static constexpr const char *message_name() { return "list_entities_date_time_response"; } |   static constexpr const char *message_name() { return "list_entities_date_time_response"; } | ||||||
| #endif | #endif | ||||||
|   uint32_t device_uid{0}; |   uint32_t device_id{0}; | ||||||
|   void encode(ProtoWriteBuffer buffer) const override; |   void encode(ProtoWriteBuffer buffer) const override; | ||||||
|   void calculate_size(uint32_t &total_size) const override; |   void calculate_size(uint32_t &total_size) const override; | ||||||
| #ifdef HAS_PROTO_MESSAGE_DUMP | #ifdef HAS_PROTO_MESSAGE_DUMP | ||||||
| @@ -2970,7 +2985,7 @@ class ListEntitiesUpdateResponse : public InfoResponseProtoMessage { | |||||||
|   static constexpr const char *message_name() { return "list_entities_update_response"; } |   static constexpr const char *message_name() { return "list_entities_update_response"; } | ||||||
| #endif | #endif | ||||||
|   std::string device_class{}; |   std::string device_class{}; | ||||||
|   uint32_t device_uid{0}; |   uint32_t device_id{0}; | ||||||
|   void encode(ProtoWriteBuffer buffer) const override; |   void encode(ProtoWriteBuffer buffer) const override; | ||||||
|   void calculate_size(uint32_t &total_size) const override; |   void calculate_size(uint32_t &total_size) const override; | ||||||
| #ifdef HAS_PROTO_MESSAGE_DUMP | #ifdef HAS_PROTO_MESSAGE_DUMP | ||||||
|   | |||||||
| @@ -56,6 +56,7 @@ CONF_AP = "ap" | |||||||
| CONF_APPARENT_POWER = "apparent_power" | CONF_APPARENT_POWER = "apparent_power" | ||||||
| CONF_ARDUINO_VERSION = "arduino_version" | CONF_ARDUINO_VERSION = "arduino_version" | ||||||
| CONF_AREA = "area" | CONF_AREA = "area" | ||||||
|  | CONF_AREA_ID = "area_id" | ||||||
| CONF_ARGS = "args" | CONF_ARGS = "args" | ||||||
| CONF_ASSUMED_STATE = "assumed_state" | CONF_ASSUMED_STATE = "assumed_state" | ||||||
| CONF_AT = "at" | CONF_AT = "at" | ||||||
| @@ -843,6 +844,7 @@ CONF_STILL_THRESHOLD = "still_threshold" | |||||||
| CONF_STOP = "stop" | CONF_STOP = "stop" | ||||||
| CONF_STOP_ACTION = "stop_action" | CONF_STOP_ACTION = "stop_action" | ||||||
| CONF_STORE_BASELINE = "store_baseline" | CONF_STORE_BASELINE = "store_baseline" | ||||||
|  | CONF_SUB_AREAS = "sub_areas" | ||||||
| CONF_SUB_DEVICES = "sub_devices" | CONF_SUB_DEVICES = "sub_devices" | ||||||
| CONF_SUBNET = "subnet" | CONF_SUBNET = "subnet" | ||||||
| CONF_SUBSCRIBE_QOS = "subscribe_qos" | CONF_SUBSCRIBE_QOS = "subscribe_qos" | ||||||
|   | |||||||
| @@ -11,6 +11,7 @@ | |||||||
|  |  | ||||||
| #ifdef USE_SUB_DEVICE | #ifdef USE_SUB_DEVICE | ||||||
| #include "esphome/core/sub_device.h" | #include "esphome/core/sub_device.h" | ||||||
|  | #include "esphome/core/sub_area.h" | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| #ifdef USE_SOCKET_SELECT_SUPPORT | #ifdef USE_SOCKET_SELECT_SUPPORT | ||||||
| @@ -114,6 +115,9 @@ class Application { | |||||||
| #ifdef USE_SUB_DEVICE | #ifdef USE_SUB_DEVICE | ||||||
|   void register_sub_device(SubDevice *sub_device) { this->sub_devices_.push_back(sub_device); } |   void register_sub_device(SubDevice *sub_device) { this->sub_devices_.push_back(sub_device); } | ||||||
| #endif | #endif | ||||||
|  | #ifdef USE_SUB_DEVICE | ||||||
|  |   void register_area(SubArea *area) { this->areas_.push_back(area); } | ||||||
|  | #endif | ||||||
|  |  | ||||||
|   void set_current_component(Component *component) { this->current_component_ = component; } |   void set_current_component(Component *component) { this->current_component_ = component; } | ||||||
|   Component *get_current_component() { return this->current_component_; } |   Component *get_current_component() { return this->current_component_; } | ||||||
| @@ -344,15 +348,7 @@ class Application { | |||||||
|  |  | ||||||
| #ifdef USE_SUB_DEVICE | #ifdef USE_SUB_DEVICE | ||||||
|   const std::vector<SubDevice *> &get_sub_devices() { return this->sub_devices_; } |   const std::vector<SubDevice *> &get_sub_devices() { return this->sub_devices_; } | ||||||
|   // /* Very likely no need for get_sub_device_by_key as it only seem to be used when requesting update from API |   const std::vector<SubArea *> &get_areas() { return this->areas_; } | ||||||
|   //    and the sub_devices shaould only be sent once at connection. */ |  | ||||||
|   // SubDevice *get_sub_device_by_key(uint32_t key, bool include_internal = false) { |  | ||||||
|   //   for (auto *obj : this->sub_devices_) { |  | ||||||
|   //     if (obj->get_object_id_hash() == key && (include_internal || !obj->is_internal())) |  | ||||||
|   //       return obj; |  | ||||||
|   //   } |  | ||||||
|   //   return nullptr; |  | ||||||
|   // } |  | ||||||
| #endif | #endif | ||||||
| #ifdef USE_BINARY_SENSOR | #ifdef USE_BINARY_SENSOR | ||||||
|   const std::vector<binary_sensor::BinarySensor *> &get_binary_sensors() { return this->binary_sensors_; } |   const std::vector<binary_sensor::BinarySensor *> &get_binary_sensors() { return this->binary_sensors_; } | ||||||
| @@ -632,6 +628,7 @@ class Application { | |||||||
|  |  | ||||||
| #ifdef USE_SUB_DEVICE | #ifdef USE_SUB_DEVICE | ||||||
|   std::vector<SubDevice *> sub_devices_{}; |   std::vector<SubDevice *> sub_devices_{}; | ||||||
|  |   std::vector<SubArea *> areas_{}; | ||||||
| #endif | #endif | ||||||
| #ifdef USE_BINARY_SENSOR | #ifdef USE_BINARY_SENSOR | ||||||
|   std::vector<binary_sensor::BinarySensor *> binary_sensors_{}; |   std::vector<binary_sensor::BinarySensor *> binary_sensors_{}; | ||||||
|   | |||||||
| @@ -7,6 +7,7 @@ import esphome.codegen as cg | |||||||
| import esphome.config_validation as cv | import esphome.config_validation as cv | ||||||
| from esphome.const import ( | from esphome.const import ( | ||||||
|     CONF_AREA, |     CONF_AREA, | ||||||
|  |     CONF_AREA_ID, | ||||||
|     CONF_BUILD_PATH, |     CONF_BUILD_PATH, | ||||||
|     CONF_COMMENT, |     CONF_COMMENT, | ||||||
|     CONF_COMPILE_PROCESS_LIMIT, |     CONF_COMPILE_PROCESS_LIMIT, | ||||||
| @@ -27,6 +28,7 @@ from esphome.const import ( | |||||||
|     CONF_PLATFORMIO_OPTIONS, |     CONF_PLATFORMIO_OPTIONS, | ||||||
|     CONF_PRIORITY, |     CONF_PRIORITY, | ||||||
|     CONF_PROJECT, |     CONF_PROJECT, | ||||||
|  |     CONF_SUB_AREAS, | ||||||
|     CONF_SUB_DEVICES, |     CONF_SUB_DEVICES, | ||||||
|     CONF_TRIGGER_ID, |     CONF_TRIGGER_ID, | ||||||
|     CONF_VERSION, |     CONF_VERSION, | ||||||
| @@ -56,6 +58,7 @@ ProjectUpdateTrigger = cg.esphome_ns.class_( | |||||||
|     "ProjectUpdateTrigger", cg.Component, automation.Trigger.template(cg.std_string) |     "ProjectUpdateTrigger", cg.Component, automation.Trigger.template(cg.std_string) | ||||||
| ) | ) | ||||||
| SubDevice = cg.esphome_ns.class_("SubDevice") | SubDevice = cg.esphome_ns.class_("SubDevice") | ||||||
|  | SubArea = cg.esphome_ns.class_("SubArea") | ||||||
|  |  | ||||||
| VALID_INCLUDE_EXTS = {".h", ".hpp", ".tcc", ".ino", ".cpp", ".c"} | VALID_INCLUDE_EXTS = {".h", ".hpp", ".tcc", ".ino", ".cpp", ".c"} | ||||||
|  |  | ||||||
| @@ -174,12 +177,20 @@ CONFIG_SCHEMA = cv.All( | |||||||
|             cv.Optional( |             cv.Optional( | ||||||
|                 CONF_COMPILE_PROCESS_LIMIT, default=_compile_process_limit_default |                 CONF_COMPILE_PROCESS_LIMIT, default=_compile_process_limit_default | ||||||
|             ): cv.int_range(min=1, max=get_usable_cpu_count()), |             ): cv.int_range(min=1, max=get_usable_cpu_count()), | ||||||
|  |             cv.Optional(CONF_SUB_AREAS, default=[]): cv.ensure_list( | ||||||
|  |                 cv.Schema( | ||||||
|  |                     { | ||||||
|  |                         cv.GenerateID(CONF_ID): cv.declare_id(SubArea), | ||||||
|  |                         cv.Required(CONF_NAME): cv.string, | ||||||
|  |                     } | ||||||
|  |                 ), | ||||||
|  |             ), | ||||||
|             cv.Optional(CONF_SUB_DEVICES, default=[]): cv.ensure_list( |             cv.Optional(CONF_SUB_DEVICES, default=[]): cv.ensure_list( | ||||||
|                 cv.Schema( |                 cv.Schema( | ||||||
|                     { |                     { | ||||||
|                         cv.GenerateID(CONF_ID): cv.declare_id(SubDevice), |                         cv.GenerateID(CONF_ID): cv.declare_id(SubDevice), | ||||||
|                         cv.Required(CONF_NAME): cv.string, |                         cv.Required(CONF_NAME): cv.string, | ||||||
|                         cv.Optional(CONF_AREA, default=""): cv.string, |                         cv.Optional(CONF_AREA_ID): cv.use_id(SubArea), | ||||||
|                     } |                     } | ||||||
|                 ), |                 ), | ||||||
|             ), |             ), | ||||||
| @@ -434,11 +445,26 @@ async def to_code(config): | |||||||
|     if config[CONF_PLATFORMIO_OPTIONS]: |     if config[CONF_PLATFORMIO_OPTIONS]: | ||||||
|         CORE.add_job(_add_platformio_options, config[CONF_PLATFORMIO_OPTIONS]) |         CORE.add_job(_add_platformio_options, config[CONF_PLATFORMIO_OPTIONS]) | ||||||
|  |  | ||||||
|     if config[CONF_SUB_DEVICES]: |     # Process sub-devices and areas | ||||||
|         for dev_conf in config[CONF_SUB_DEVICES]: |     if sub_devices := config.get(CONF_SUB_DEVICES): | ||||||
|  |         # Process areas first | ||||||
|  |         if sub_areas := config.get(CONF_SUB_AREAS): | ||||||
|  |             for area_conf in sub_areas: | ||||||
|  |                 area = cg.new_Pvariable(area_conf[CONF_ID]) | ||||||
|  |                 area_id = fnv1a_32bit_hash(str(area_conf[CONF_ID])) | ||||||
|  |                 cg.add(area.set_area_id(area_id)) | ||||||
|  |                 cg.add(area.set_name(area_conf[CONF_NAME])) | ||||||
|  |                 cg.add(cg.App.register_area(area)) | ||||||
|  |  | ||||||
|  |         # Process sub-devices | ||||||
|  |         for dev_conf in sub_devices: | ||||||
|             dev = cg.new_Pvariable(dev_conf[CONF_ID]) |             dev = cg.new_Pvariable(dev_conf[CONF_ID]) | ||||||
|             cg.add(dev.set_uid(fnv1a_32bit_hash(str(dev_conf[CONF_ID])))) |             cg.add(dev.set_device_id(fnv1a_32bit_hash(str(dev_conf[CONF_ID])))) | ||||||
|             cg.add(dev.set_name(dev_conf[CONF_NAME])) |             cg.add(dev.set_name(dev_conf[CONF_NAME])) | ||||||
|             cg.add(dev.set_area(dev_conf[CONF_AREA])) |             if CONF_AREA_ID in dev_conf: | ||||||
|  |                 # The area_id in dev_conf is already the ID reference from cv.use_id | ||||||
|  |                 # We need to get the hash of that area's ID | ||||||
|  |                 area_id = fnv1a_32bit_hash(str(dev_conf[CONF_AREA_ID])) | ||||||
|  |                 cg.add(dev.set_area_id(area_id)) | ||||||
|             cg.add(cg.App.register_sub_device(dev)) |             cg.add(cg.App.register_sub_device(dev)) | ||||||
|         cg.add_define("USE_SUB_DEVICE") |         cg.add_define("USE_SUB_DEVICE") | ||||||
|   | |||||||
| @@ -51,9 +51,11 @@ class EntityBase { | |||||||
|   std::string get_icon() const; |   std::string get_icon() const; | ||||||
|   void set_icon(const char *icon); |   void set_icon(const char *icon); | ||||||
|  |  | ||||||
|  | #ifdef USE_SUB_DEVICE | ||||||
|   // Get/set this entity's device id |   // Get/set this entity's device id | ||||||
|   uint32_t get_device_uid() const { return this->device_uid_; } |   uint32_t get_device_id() const { return this->device_id_; } | ||||||
|   void set_device_uid(const uint32_t device_uid) { this->device_uid_ = device_uid; } |   void set_device_id(const uint32_t device_id) { this->device_id_ = device_id; } | ||||||
|  | #endif | ||||||
|  |  | ||||||
|   // Check if this entity has state |   // Check if this entity has state | ||||||
|   bool has_state() const { return this->flags_.has_state; } |   bool has_state() const { return this->flags_.has_state; } | ||||||
| @@ -71,7 +73,9 @@ class EntityBase { | |||||||
|   const char *object_id_c_str_{nullptr}; |   const char *object_id_c_str_{nullptr}; | ||||||
|   const char *icon_c_str_{nullptr}; |   const char *icon_c_str_{nullptr}; | ||||||
|   uint32_t object_id_hash_{}; |   uint32_t object_id_hash_{}; | ||||||
|   uint32_t device_uid_{}; | #ifdef USE_SUB_DEVICE | ||||||
|  |   uint32_t device_id_{}; | ||||||
|  | #endif | ||||||
|  |  | ||||||
|   // Bit-packed flags to save memory (1 byte instead of 5) |   // Bit-packed flags to save memory (1 byte instead of 5) | ||||||
|   struct EntityFlags { |   struct EntityFlags { | ||||||
|   | |||||||
							
								
								
									
										20
									
								
								esphome/core/sub_area.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								esphome/core/sub_area.h
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,20 @@ | |||||||
|  | #pragma once | ||||||
|  |  | ||||||
|  | #include <string> | ||||||
|  | #include <cstdint> | ||||||
|  |  | ||||||
|  | namespace esphome { | ||||||
|  |  | ||||||
|  | class SubArea { | ||||||
|  |  public: | ||||||
|  |   void set_area_id(uint32_t area_id) { area_id_ = area_id; } | ||||||
|  |   uint32_t get_area_id() { return area_id_; } | ||||||
|  |   void set_name(std::string name) { name_ = std::move(name); } | ||||||
|  |   std::string get_name() { return name_; } | ||||||
|  |  | ||||||
|  |  protected: | ||||||
|  |   uint32_t area_id_{}; | ||||||
|  |   std::string name_ = ""; | ||||||
|  | }; | ||||||
|  |  | ||||||
|  | }  // namespace esphome | ||||||
| @@ -6,17 +6,17 @@ namespace esphome { | |||||||
|  |  | ||||||
| class SubDevice { | class SubDevice { | ||||||
|  public: |  public: | ||||||
|   void set_uid(uint32_t uid) { uid_ = uid; } |   void set_device_id(uint32_t device_id) { device_id_ = device_id; } | ||||||
|   uint32_t get_uid() { return uid_; } |   uint32_t get_device_id() { return device_id_; } | ||||||
|   void set_name(std::string name) { name_ = std::move(name); } |   void set_name(std::string name) { name_ = std::move(name); } | ||||||
|   std::string get_name() { return name_; } |   std::string get_name() { return name_; } | ||||||
|   void set_area(std::string area) { area_ = std::move(area); } |   void set_area_id(uint32_t area_id) { area_id_ = area_id; } | ||||||
|   std::string get_area() { return area_; } |   uint32_t get_area_id() { return area_id_; } | ||||||
|  |  | ||||||
|  protected: |  protected: | ||||||
|   uint32_t uid_{}; |   uint32_t device_id_{}; | ||||||
|  |   uint32_t area_id_{}; | ||||||
|   std::string name_ = ""; |   std::string name_ = ""; | ||||||
|   std::string area_ = ""; |  | ||||||
| }; | }; | ||||||
|  |  | ||||||
| }  // namespace esphome | }  // namespace esphome | ||||||
|   | |||||||
| @@ -113,7 +113,7 @@ async def setup_entity(var, config): | |||||||
|         add(var.set_entity_category(config[CONF_ENTITY_CATEGORY])) |         add(var.set_entity_category(config[CONF_ENTITY_CATEGORY])) | ||||||
|     if CONF_DEVICE_ID in config: |     if CONF_DEVICE_ID in config: | ||||||
|         device = await get_variable(config[CONF_DEVICE_ID]) |         device = await get_variable(config[CONF_DEVICE_ID]) | ||||||
|         add(var.set_device_uid(fnv1a_32bit_hash(str(device)))) |         add(var.set_device_id(fnv1a_32bit_hash(str(device)))) | ||||||
|  |  | ||||||
|  |  | ||||||
| def extract_registry_entry_config( | def extract_registry_entry_config( | ||||||
|   | |||||||
| @@ -17,10 +17,13 @@ esphome: | |||||||
|     version: "1.1" |     version: "1.1" | ||||||
|     on_update: |     on_update: | ||||||
|       logger.log: on_update |       logger.log: on_update | ||||||
|  |   sub_areas: | ||||||
|  |     - id: another_area | ||||||
|  |       name: Another area | ||||||
|   sub_devices: |   sub_devices: | ||||||
|     - id: other_device |     - id: other_device | ||||||
|       name: Another device |       name: Another device | ||||||
|       area: Another area |       area_id: another_area | ||||||
|  |  | ||||||
| binary_sensor: | binary_sensor: | ||||||
|   - platform: template |   - platform: template | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user