mirror of
https://github.com/esphome/esphome.git
synced 2025-09-13 08:42:18 +01:00
Attempt to replace device_id:str with device_uid:uint32
This commit is contained in:
@@ -188,7 +188,7 @@ message DeviceInfoRequest {
|
||||
}
|
||||
|
||||
message SubDeviceInfo {
|
||||
string id = 1;
|
||||
uint32 uid = 1;
|
||||
string name = 2;
|
||||
string suggested_area = 3;
|
||||
}
|
||||
@@ -286,7 +286,7 @@ message ListEntitiesBinarySensorResponse {
|
||||
bool disabled_by_default = 7;
|
||||
string icon = 8;
|
||||
EntityCategory entity_category = 9;
|
||||
string device_id = 10;
|
||||
uint32 device_uid = 10;
|
||||
}
|
||||
message BinarySensorStateResponse {
|
||||
option (id) = 21;
|
||||
@@ -320,7 +320,7 @@ message ListEntitiesCoverResponse {
|
||||
string icon = 10;
|
||||
EntityCategory entity_category = 11;
|
||||
bool supports_stop = 12;
|
||||
string device_id = 13;
|
||||
uint32 device_uid = 13;
|
||||
}
|
||||
|
||||
enum LegacyCoverState {
|
||||
@@ -392,7 +392,7 @@ message ListEntitiesFanResponse {
|
||||
string icon = 10;
|
||||
EntityCategory entity_category = 11;
|
||||
repeated string supported_preset_modes = 12;
|
||||
string device_id = 13;
|
||||
uint32 device_uid = 13;
|
||||
}
|
||||
enum FanSpeed {
|
||||
FAN_SPEED_LOW = 0;
|
||||
@@ -473,7 +473,7 @@ message ListEntitiesLightResponse {
|
||||
bool disabled_by_default = 13;
|
||||
string icon = 14;
|
||||
EntityCategory entity_category = 15;
|
||||
string device_id = 16;
|
||||
uint32 device_uid = 16;
|
||||
}
|
||||
message LightStateResponse {
|
||||
option (id) = 24;
|
||||
@@ -564,7 +564,7 @@ message ListEntitiesSensorResponse {
|
||||
SensorLastResetType legacy_last_reset_type = 11;
|
||||
bool disabled_by_default = 12;
|
||||
EntityCategory entity_category = 13;
|
||||
string device_id = 14;
|
||||
uint32 device_uid = 14;
|
||||
}
|
||||
message SensorStateResponse {
|
||||
option (id) = 25;
|
||||
@@ -595,7 +595,7 @@ message ListEntitiesSwitchResponse {
|
||||
bool disabled_by_default = 7;
|
||||
EntityCategory entity_category = 8;
|
||||
string device_class = 9;
|
||||
string device_id = 10;
|
||||
uint32 device_uid = 10;
|
||||
}
|
||||
message SwitchStateResponse {
|
||||
option (id) = 26;
|
||||
@@ -631,7 +631,7 @@ message ListEntitiesTextSensorResponse {
|
||||
bool disabled_by_default = 6;
|
||||
EntityCategory entity_category = 7;
|
||||
string device_class = 8;
|
||||
string device_id = 9;
|
||||
uint32 device_uid = 9;
|
||||
}
|
||||
message TextSensorStateResponse {
|
||||
option (id) = 27;
|
||||
@@ -812,7 +812,7 @@ message ListEntitiesCameraResponse {
|
||||
bool disabled_by_default = 5;
|
||||
string icon = 6;
|
||||
EntityCategory entity_category = 7;
|
||||
string device_id = 8;
|
||||
uint32 device_uid = 8;
|
||||
}
|
||||
|
||||
message CameraImageResponse {
|
||||
@@ -914,7 +914,7 @@ message ListEntitiesClimateResponse {
|
||||
bool supports_target_humidity = 23;
|
||||
float visual_min_humidity = 24;
|
||||
float visual_max_humidity = 25;
|
||||
string device_id = 26;
|
||||
uint32 device_uid = 26;
|
||||
}
|
||||
message ClimateStateResponse {
|
||||
option (id) = 47;
|
||||
@@ -994,7 +994,7 @@ message ListEntitiesNumberResponse {
|
||||
string unit_of_measurement = 11;
|
||||
NumberMode mode = 12;
|
||||
string device_class = 13;
|
||||
string device_id = 14;
|
||||
uint32 device_uid = 14;
|
||||
}
|
||||
message NumberStateResponse {
|
||||
option (id) = 50;
|
||||
@@ -1033,7 +1033,7 @@ message ListEntitiesSelectResponse {
|
||||
repeated string options = 6;
|
||||
bool disabled_by_default = 7;
|
||||
EntityCategory entity_category = 8;
|
||||
string device_id = 9;
|
||||
uint32 device_uid = 9;
|
||||
}
|
||||
message SelectStateResponse {
|
||||
option (id) = 53;
|
||||
@@ -1092,7 +1092,7 @@ message ListEntitiesLockResponse {
|
||||
|
||||
// Not yet implemented:
|
||||
string code_format = 11;
|
||||
string device_id = 12;
|
||||
uint32 device_uid = 12;
|
||||
}
|
||||
message LockStateResponse {
|
||||
option (id) = 59;
|
||||
@@ -1130,7 +1130,7 @@ message ListEntitiesButtonResponse {
|
||||
bool disabled_by_default = 6;
|
||||
EntityCategory entity_category = 7;
|
||||
string device_class = 8;
|
||||
string device_id = 9;
|
||||
uint32 device_uid = 9;
|
||||
}
|
||||
message ButtonCommandRequest {
|
||||
option (id) = 62;
|
||||
@@ -1186,7 +1186,7 @@ message ListEntitiesMediaPlayerResponse {
|
||||
|
||||
repeated MediaPlayerSupportedFormat supported_formats = 9;
|
||||
|
||||
string device_id = 10;
|
||||
uint32 device_uid = 10;
|
||||
}
|
||||
message MediaPlayerStateResponse {
|
||||
option (id) = 64;
|
||||
@@ -1724,7 +1724,7 @@ message ListEntitiesAlarmControlPanelResponse {
|
||||
uint32 supported_features = 8;
|
||||
bool requires_code = 9;
|
||||
bool requires_code_to_arm = 10;
|
||||
string device_id = 11;
|
||||
uint32 device_uid = 11;
|
||||
}
|
||||
|
||||
message AlarmControlPanelStateResponse {
|
||||
@@ -1768,7 +1768,7 @@ message ListEntitiesTextResponse {
|
||||
uint32 max_length = 9;
|
||||
string pattern = 10;
|
||||
TextMode mode = 11;
|
||||
string device_id = 12;
|
||||
uint32 device_uid = 12;
|
||||
}
|
||||
message TextStateResponse {
|
||||
option (id) = 98;
|
||||
@@ -1807,7 +1807,7 @@ message ListEntitiesDateResponse {
|
||||
string icon = 5;
|
||||
bool disabled_by_default = 6;
|
||||
EntityCategory entity_category = 7;
|
||||
string device_id = 8;
|
||||
uint32 device_uid = 8;
|
||||
}
|
||||
message DateStateResponse {
|
||||
option (id) = 101;
|
||||
@@ -1849,7 +1849,7 @@ message ListEntitiesTimeResponse {
|
||||
string icon = 5;
|
||||
bool disabled_by_default = 6;
|
||||
EntityCategory entity_category = 7;
|
||||
string device_id = 8;
|
||||
uint32 device_uid = 8;
|
||||
}
|
||||
message TimeStateResponse {
|
||||
option (id) = 104;
|
||||
@@ -1894,7 +1894,7 @@ message ListEntitiesEventResponse {
|
||||
string device_class = 8;
|
||||
|
||||
repeated string event_types = 9;
|
||||
string device_id = 10;
|
||||
uint32 device_uid = 10;
|
||||
}
|
||||
message EventResponse {
|
||||
option (id) = 108;
|
||||
@@ -1924,7 +1924,7 @@ message ListEntitiesValveResponse {
|
||||
bool assumed_state = 9;
|
||||
bool supports_position = 10;
|
||||
bool supports_stop = 11;
|
||||
string device_id = 12;
|
||||
uint32 device_uid = 12;
|
||||
}
|
||||
|
||||
enum ValveOperation {
|
||||
@@ -1969,7 +1969,7 @@ message ListEntitiesDateTimeResponse {
|
||||
string icon = 5;
|
||||
bool disabled_by_default = 6;
|
||||
EntityCategory entity_category = 7;
|
||||
string device_id = 8;
|
||||
uint32 device_uid = 8;
|
||||
}
|
||||
message DateTimeStateResponse {
|
||||
option (id) = 113;
|
||||
@@ -2008,7 +2008,7 @@ message ListEntitiesUpdateResponse {
|
||||
bool disabled_by_default = 6;
|
||||
EntityCategory entity_category = 7;
|
||||
string device_class = 8;
|
||||
string device_id = 9;
|
||||
uint32 device_uid = 9;
|
||||
}
|
||||
message UpdateStateResponse {
|
||||
option (id) = 117;
|
||||
|
@@ -287,7 +287,7 @@ bool APIConnection::try_send_binary_sensor_info(APIConnection *api, void *v_bina
|
||||
msg.disabled_by_default = binary_sensor->is_disabled_by_default();
|
||||
msg.icon = binary_sensor->get_icon();
|
||||
msg.entity_category = static_cast<enums::EntityCategory>(binary_sensor->get_entity_category());
|
||||
msg.device_id = binary_sensor->get_device_id();
|
||||
msg.device_uid = binary_sensor->get_device_uid();
|
||||
return api->send_list_entities_binary_sensor_response(msg);
|
||||
}
|
||||
#endif
|
||||
@@ -338,7 +338,7 @@ bool APIConnection::try_send_cover_info(APIConnection *api, void *v_cover) {
|
||||
msg.disabled_by_default = cover->is_disabled_by_default();
|
||||
msg.icon = cover->get_icon();
|
||||
msg.entity_category = static_cast<enums::EntityCategory>(cover->get_entity_category());
|
||||
msg.device_id = cover->get_device_id();
|
||||
msg.device_uid = cover->get_device_uid();
|
||||
return api->send_list_entities_cover_response(msg);
|
||||
}
|
||||
void APIConnection::cover_command(const CoverCommandRequest &msg) {
|
||||
@@ -421,6 +421,7 @@ bool APIConnection::try_send_fan_info(APIConnection *api, void *v_fan) {
|
||||
msg.disabled_by_default = fan->is_disabled_by_default();
|
||||
msg.icon = fan->get_icon();
|
||||
msg.entity_category = static_cast<enums::EntityCategory>(fan->get_entity_category());
|
||||
msg.device_uid = fan->get_device_uid();
|
||||
return api->send_list_entities_fan_response(msg);
|
||||
}
|
||||
void APIConnection::fan_command(const FanCommandRequest &msg) {
|
||||
@@ -518,6 +519,7 @@ bool APIConnection::try_send_light_info(APIConnection *api, void *v_light) {
|
||||
for (auto *effect : light->get_effects())
|
||||
msg.effects.push_back(effect->get_name());
|
||||
}
|
||||
msg.device_uid = light->get_device_uid();
|
||||
return api->send_list_entities_light_response(msg);
|
||||
}
|
||||
void APIConnection::light_command(const LightCommandRequest &msg) {
|
||||
@@ -602,6 +604,7 @@ bool APIConnection::try_send_sensor_info(APIConnection *api, void *v_sensor) {
|
||||
msg.state_class = static_cast<enums::SensorStateClass>(sensor->get_state_class());
|
||||
msg.disabled_by_default = sensor->is_disabled_by_default();
|
||||
msg.entity_category = static_cast<enums::EntityCategory>(sensor->get_entity_category());
|
||||
msg.device_uid = sensor->get_device_uid();
|
||||
return api->send_list_entities_sensor_response(msg);
|
||||
}
|
||||
#endif
|
||||
@@ -645,6 +648,7 @@ bool APIConnection::try_send_switch_info(APIConnection *api, void *v_a_switch) {
|
||||
msg.disabled_by_default = a_switch->is_disabled_by_default();
|
||||
msg.entity_category = static_cast<enums::EntityCategory>(a_switch->get_entity_category());
|
||||
msg.device_class = a_switch->get_device_class();
|
||||
msg.device_uid = a_switch->get_device_uid();
|
||||
return api->send_list_entities_switch_response(msg);
|
||||
}
|
||||
void APIConnection::switch_command(const SwitchCommandRequest &msg) {
|
||||
@@ -701,6 +705,7 @@ bool APIConnection::try_send_text_sensor_info(APIConnection *api, void *v_text_s
|
||||
msg.disabled_by_default = text_sensor->is_disabled_by_default();
|
||||
msg.entity_category = static_cast<enums::EntityCategory>(text_sensor->get_entity_category());
|
||||
msg.device_class = text_sensor->get_device_class();
|
||||
msg.device_uid = text_sensor->get_device_uid();
|
||||
return api->send_list_entities_text_sensor_response(msg);
|
||||
}
|
||||
#endif
|
||||
@@ -795,6 +800,7 @@ bool APIConnection::try_send_climate_info(APIConnection *api, void *v_climate) {
|
||||
msg.supported_custom_presets.push_back(custom_preset);
|
||||
for (auto swing_mode : traits.get_supported_swing_modes())
|
||||
msg.supported_swing_modes.push_back(static_cast<enums::ClimateSwingMode>(swing_mode));
|
||||
msg.device_uid = climate->get_device_uid();
|
||||
return api->send_list_entities_climate_response(msg);
|
||||
}
|
||||
void APIConnection::climate_command(const ClimateCommandRequest &msg) {
|
||||
@@ -873,6 +879,8 @@ bool APIConnection::try_send_number_info(APIConnection *api, void *v_number) {
|
||||
msg.max_value = number->traits.get_max_value();
|
||||
msg.step = number->traits.get_step();
|
||||
|
||||
msg.device_uid = number->get_device_uid();
|
||||
|
||||
return api->send_list_entities_number_response(msg);
|
||||
}
|
||||
void APIConnection::number_command(const NumberCommandRequest &msg) {
|
||||
@@ -923,6 +931,7 @@ bool APIConnection::try_send_date_info(APIConnection *api, void *v_date) {
|
||||
msg.icon = date->get_icon();
|
||||
msg.disabled_by_default = date->is_disabled_by_default();
|
||||
msg.entity_category = static_cast<enums::EntityCategory>(date->get_entity_category());
|
||||
msg.device_uid = date->get_device_uid();
|
||||
|
||||
return api->send_list_entities_date_response(msg);
|
||||
}
|
||||
@@ -974,6 +983,7 @@ bool APIConnection::try_send_time_info(APIConnection *api, void *v_time) {
|
||||
msg.icon = time->get_icon();
|
||||
msg.disabled_by_default = time->is_disabled_by_default();
|
||||
msg.entity_category = static_cast<enums::EntityCategory>(time->get_entity_category());
|
||||
msg.device_uid = time->get_device_uid();
|
||||
|
||||
return api->send_list_entities_time_response(msg);
|
||||
}
|
||||
@@ -1026,6 +1036,7 @@ bool APIConnection::try_send_datetime_info(APIConnection *api, void *v_datetime)
|
||||
msg.icon = datetime->get_icon();
|
||||
msg.disabled_by_default = datetime->is_disabled_by_default();
|
||||
msg.entity_category = static_cast<enums::EntityCategory>(datetime->get_entity_category());
|
||||
msg.device_uid = datetime->get_device_uid();
|
||||
|
||||
return api->send_list_entities_date_time_response(msg);
|
||||
}
|
||||
@@ -1081,6 +1092,7 @@ bool APIConnection::try_send_text_info(APIConnection *api, void *v_text) {
|
||||
msg.min_length = text->traits.get_min_length();
|
||||
msg.max_length = text->traits.get_max_length();
|
||||
msg.pattern = text->traits.get_pattern();
|
||||
msg.device_uid = text->get_device_uid();
|
||||
|
||||
return api->send_list_entities_text_response(msg);
|
||||
}
|
||||
@@ -1136,6 +1148,7 @@ bool APIConnection::try_send_select_info(APIConnection *api, void *v_select) {
|
||||
|
||||
for (const auto &option : select->traits.get_options())
|
||||
msg.options.push_back(option);
|
||||
msg.device_uid = select->get_device_uid();
|
||||
|
||||
return api->send_list_entities_select_response(msg);
|
||||
}
|
||||
@@ -1168,6 +1181,7 @@ bool APIConnection::try_send_button_info(APIConnection *api, void *v_button) {
|
||||
msg.disabled_by_default = button->is_disabled_by_default();
|
||||
msg.entity_category = static_cast<enums::EntityCategory>(button->get_entity_category());
|
||||
msg.device_class = button->get_device_class();
|
||||
msg.device_uid = button->get_device_uid();
|
||||
return api->send_list_entities_button_response(msg);
|
||||
}
|
||||
void APIConnection::button_command(const ButtonCommandRequest &msg) {
|
||||
@@ -1219,6 +1233,7 @@ bool APIConnection::try_send_lock_info(APIConnection *api, void *v_a_lock) {
|
||||
msg.entity_category = static_cast<enums::EntityCategory>(a_lock->get_entity_category());
|
||||
msg.supports_open = a_lock->traits.get_supports_open();
|
||||
msg.requires_code = a_lock->traits.get_requires_code();
|
||||
msg.device_uid = a_lock->get_device_uid();
|
||||
return api->send_list_entities_lock_response(msg);
|
||||
}
|
||||
void APIConnection::lock_command(const LockCommandRequest &msg) {
|
||||
@@ -1280,6 +1295,7 @@ bool APIConnection::try_send_valve_info(APIConnection *api, void *v_valve) {
|
||||
msg.assumed_state = traits.get_is_assumed_state();
|
||||
msg.supports_position = traits.get_supports_position();
|
||||
msg.supports_stop = traits.get_supports_stop();
|
||||
msg.device_uid = valve->get_device_uid();
|
||||
return api->send_list_entities_valve_response(msg);
|
||||
}
|
||||
void APIConnection::valve_command(const ValveCommandRequest &msg) {
|
||||
@@ -1349,6 +1365,7 @@ bool APIConnection::try_send_media_player_info(APIConnection *api, void *v_media
|
||||
media_format.sample_bytes = supported_format.sample_bytes;
|
||||
msg.supported_formats.push_back(media_format);
|
||||
}
|
||||
msg.device_uid = media_player->get_device_uid();
|
||||
|
||||
return api->send_list_entities_media_player_response(msg);
|
||||
}
|
||||
@@ -1400,6 +1417,7 @@ bool APIConnection::try_send_camera_info(APIConnection *api, void *v_camera) {
|
||||
msg.disabled_by_default = camera->is_disabled_by_default();
|
||||
msg.icon = camera->get_icon();
|
||||
msg.entity_category = static_cast<enums::EntityCategory>(camera->get_entity_category());
|
||||
msg.device_uid = camera->get_device_uid();
|
||||
return api->send_list_entities_camera_response(msg);
|
||||
}
|
||||
void APIConnection::camera_image(const CameraImageRequest &msg) {
|
||||
@@ -1625,6 +1643,7 @@ bool APIConnection::try_send_alarm_control_panel_info(APIConnection *api, void *
|
||||
msg.supported_features = a_alarm_control_panel->get_supported_features();
|
||||
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.device_uid = a_alarm_control_panel->get_device_uid();
|
||||
return api->send_list_entities_alarm_control_panel_response(msg);
|
||||
}
|
||||
void APIConnection::alarm_control_panel_command(const AlarmControlPanelCommandRequest &msg) {
|
||||
@@ -1696,6 +1715,7 @@ bool APIConnection::try_send_event_info(APIConnection *api, void *v_event) {
|
||||
msg.device_class = event->get_device_class();
|
||||
for (const auto &event_type : event->get_event_types())
|
||||
msg.event_types.push_back(event_type);
|
||||
msg.device_uid = event->get_device_uid();
|
||||
return api->send_list_entities_event_response(msg);
|
||||
}
|
||||
#endif
|
||||
@@ -1748,6 +1768,7 @@ bool APIConnection::try_send_update_info(APIConnection *api, void *v_update) {
|
||||
msg.disabled_by_default = update->is_disabled_by_default();
|
||||
msg.entity_category = static_cast<enums::EntityCategory>(update->get_entity_category());
|
||||
msg.device_class = update->get_device_class();
|
||||
msg.device_uid = update->get_device_uid();
|
||||
return api->send_list_entities_update_response(msg);
|
||||
}
|
||||
void APIConnection::update_command(const UpdateCommandRequest &msg) {
|
||||
@@ -1865,6 +1886,15 @@ DeviceInfoResponse APIConnection::device_info(const DeviceInfoRequest &msg) {
|
||||
#endif
|
||||
#ifdef USE_API_NOISE
|
||||
resp.api_encryption_supported = true;
|
||||
#endif
|
||||
#ifdef USE_SUB_DEVICE
|
||||
for (auto const &sub_device : App.get_sub_devices()) {
|
||||
SubDeviceInfo sub_device_info;
|
||||
sub_device_info.uid = sub_device->get_uid();
|
||||
sub_device_info.name = sub_device->get_name();
|
||||
sub_device_info.suggested_area = sub_device->get_area();
|
||||
resp.sub_devices.push_back(sub_device_info);
|
||||
}
|
||||
#endif
|
||||
return resp;
|
||||
}
|
||||
|
@@ -796,10 +796,6 @@ void DeviceInfoRequest::dump_to(std::string &out) const { out.append("DeviceInfo
|
||||
#endif
|
||||
bool SubDeviceInfo::decode_length(uint32_t field_id, ProtoLengthDelimited value) {
|
||||
switch (field_id) {
|
||||
case 1: {
|
||||
this->id = value.as_string();
|
||||
return true;
|
||||
}
|
||||
case 2: {
|
||||
this->name = value.as_string();
|
||||
return true;
|
||||
@@ -813,7 +809,7 @@ bool SubDeviceInfo::decode_length(uint32_t field_id, ProtoLengthDelimited value)
|
||||
}
|
||||
}
|
||||
void SubDeviceInfo::encode(ProtoWriteBuffer buffer) const {
|
||||
buffer.encode_string(1, this->id);
|
||||
buffer.encode_fixed32(1, this->uid);
|
||||
buffer.encode_string(2, this->name);
|
||||
buffer.encode_string(3, this->suggested_area);
|
||||
}
|
||||
@@ -821,8 +817,9 @@ void SubDeviceInfo::encode(ProtoWriteBuffer buffer) const {
|
||||
void SubDeviceInfo::dump_to(std::string &out) const {
|
||||
__attribute__((unused)) char buffer[64];
|
||||
out.append("SubDeviceInfo {\n");
|
||||
out.append(" id: ");
|
||||
out.append("'").append(this->id).append("'");
|
||||
out.append(" uid: ");
|
||||
sprintf(buffer, "%" PRIu32, this->uid);
|
||||
out.append(buffer);
|
||||
out.append("\n");
|
||||
|
||||
out.append(" name: ");
|
||||
@@ -1096,10 +1093,6 @@ bool ListEntitiesBinarySensorResponse::decode_length(uint32_t field_id, ProtoLen
|
||||
this->icon = value.as_string();
|
||||
return true;
|
||||
}
|
||||
case 10: {
|
||||
this->device_id = value.as_string();
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
@@ -1124,7 +1117,7 @@ void ListEntitiesBinarySensorResponse::encode(ProtoWriteBuffer buffer) const {
|
||||
buffer.encode_bool(7, this->disabled_by_default);
|
||||
buffer.encode_string(8, this->icon);
|
||||
buffer.encode_enum<enums::EntityCategory>(9, this->entity_category);
|
||||
buffer.encode_string(10, this->device_id);
|
||||
buffer.encode_fixed32(10, this->device_uid);
|
||||
}
|
||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||
void ListEntitiesBinarySensorResponse::dump_to(std::string &out) const {
|
||||
@@ -1167,8 +1160,9 @@ void ListEntitiesBinarySensorResponse::dump_to(std::string &out) const {
|
||||
out.append(proto_enum_to_string<enums::EntityCategory>(this->entity_category));
|
||||
out.append("\n");
|
||||
|
||||
out.append(" device_id: ");
|
||||
out.append("'").append(this->device_id).append("'");
|
||||
out.append(" device_uid: ");
|
||||
sprintf(buffer, "%" PRIu32, this->device_uid);
|
||||
out.append(buffer);
|
||||
out.append("\n");
|
||||
out.append("}");
|
||||
}
|
||||
@@ -1273,10 +1267,6 @@ bool ListEntitiesCoverResponse::decode_length(uint32_t field_id, ProtoLengthDeli
|
||||
this->icon = value.as_string();
|
||||
return true;
|
||||
}
|
||||
case 13: {
|
||||
this->device_id = value.as_string();
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
@@ -1304,7 +1294,7 @@ void ListEntitiesCoverResponse::encode(ProtoWriteBuffer buffer) const {
|
||||
buffer.encode_string(10, this->icon);
|
||||
buffer.encode_enum<enums::EntityCategory>(11, this->entity_category);
|
||||
buffer.encode_bool(12, this->supports_stop);
|
||||
buffer.encode_string(13, this->device_id);
|
||||
buffer.encode_fixed32(13, this->device_uid);
|
||||
}
|
||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||
void ListEntitiesCoverResponse::dump_to(std::string &out) const {
|
||||
@@ -1359,8 +1349,9 @@ void ListEntitiesCoverResponse::dump_to(std::string &out) const {
|
||||
out.append(YESNO(this->supports_stop));
|
||||
out.append("\n");
|
||||
|
||||
out.append(" device_id: ");
|
||||
out.append("'").append(this->device_id).append("'");
|
||||
out.append(" device_uid: ");
|
||||
sprintf(buffer, "%" PRIu32, this->device_uid);
|
||||
out.append(buffer);
|
||||
out.append("\n");
|
||||
out.append("}");
|
||||
}
|
||||
@@ -1580,10 +1571,6 @@ bool ListEntitiesFanResponse::decode_length(uint32_t field_id, ProtoLengthDelimi
|
||||
this->supported_preset_modes.push_back(value.as_string());
|
||||
return true;
|
||||
}
|
||||
case 13: {
|
||||
this->device_id = value.as_string();
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
@@ -1613,7 +1600,7 @@ void ListEntitiesFanResponse::encode(ProtoWriteBuffer buffer) const {
|
||||
for (auto &it : this->supported_preset_modes) {
|
||||
buffer.encode_string(12, it, true);
|
||||
}
|
||||
buffer.encode_string(13, this->device_id);
|
||||
buffer.encode_fixed32(13, this->device_uid);
|
||||
}
|
||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||
void ListEntitiesFanResponse::dump_to(std::string &out) const {
|
||||
@@ -1671,8 +1658,9 @@ void ListEntitiesFanResponse::dump_to(std::string &out) const {
|
||||
out.append("\n");
|
||||
}
|
||||
|
||||
out.append(" device_id: ");
|
||||
out.append("'").append(this->device_id).append("'");
|
||||
out.append(" device_uid: ");
|
||||
sprintf(buffer, "%" PRIu32, this->device_uid);
|
||||
out.append(buffer);
|
||||
out.append("\n");
|
||||
out.append("}");
|
||||
}
|
||||
@@ -1969,10 +1957,6 @@ bool ListEntitiesLightResponse::decode_length(uint32_t field_id, ProtoLengthDeli
|
||||
this->icon = value.as_string();
|
||||
return true;
|
||||
}
|
||||
case 16: {
|
||||
this->device_id = value.as_string();
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
@@ -2015,7 +1999,7 @@ void ListEntitiesLightResponse::encode(ProtoWriteBuffer buffer) const {
|
||||
buffer.encode_bool(13, this->disabled_by_default);
|
||||
buffer.encode_string(14, this->icon);
|
||||
buffer.encode_enum<enums::EntityCategory>(15, this->entity_category);
|
||||
buffer.encode_string(16, this->device_id);
|
||||
buffer.encode_fixed32(16, this->device_uid);
|
||||
}
|
||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||
void ListEntitiesLightResponse::dump_to(std::string &out) const {
|
||||
@@ -2088,8 +2072,9 @@ void ListEntitiesLightResponse::dump_to(std::string &out) const {
|
||||
out.append(proto_enum_to_string<enums::EntityCategory>(this->entity_category));
|
||||
out.append("\n");
|
||||
|
||||
out.append(" device_id: ");
|
||||
out.append("'").append(this->device_id).append("'");
|
||||
out.append(" device_uid: ");
|
||||
sprintf(buffer, "%" PRIu32, this->device_uid);
|
||||
out.append(buffer);
|
||||
out.append("\n");
|
||||
out.append("}");
|
||||
}
|
||||
@@ -2584,10 +2569,6 @@ bool ListEntitiesSensorResponse::decode_length(uint32_t field_id, ProtoLengthDel
|
||||
this->device_class = value.as_string();
|
||||
return true;
|
||||
}
|
||||
case 14: {
|
||||
this->device_id = value.as_string();
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
@@ -2616,7 +2597,7 @@ void ListEntitiesSensorResponse::encode(ProtoWriteBuffer buffer) const {
|
||||
buffer.encode_enum<enums::SensorLastResetType>(11, this->legacy_last_reset_type);
|
||||
buffer.encode_bool(12, this->disabled_by_default);
|
||||
buffer.encode_enum<enums::EntityCategory>(13, this->entity_category);
|
||||
buffer.encode_string(14, this->device_id);
|
||||
buffer.encode_fixed32(14, this->device_uid);
|
||||
}
|
||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||
void ListEntitiesSensorResponse::dump_to(std::string &out) const {
|
||||
@@ -2676,8 +2657,9 @@ void ListEntitiesSensorResponse::dump_to(std::string &out) const {
|
||||
out.append(proto_enum_to_string<enums::EntityCategory>(this->entity_category));
|
||||
out.append("\n");
|
||||
|
||||
out.append(" device_id: ");
|
||||
out.append("'").append(this->device_id).append("'");
|
||||
out.append(" device_uid: ");
|
||||
sprintf(buffer, "%" PRIu32, this->device_uid);
|
||||
out.append(buffer);
|
||||
out.append("\n");
|
||||
out.append("}");
|
||||
}
|
||||
@@ -2771,10 +2753,6 @@ bool ListEntitiesSwitchResponse::decode_length(uint32_t field_id, ProtoLengthDel
|
||||
this->device_class = value.as_string();
|
||||
return true;
|
||||
}
|
||||
case 10: {
|
||||
this->device_id = value.as_string();
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
@@ -2799,7 +2777,7 @@ void ListEntitiesSwitchResponse::encode(ProtoWriteBuffer buffer) const {
|
||||
buffer.encode_bool(7, this->disabled_by_default);
|
||||
buffer.encode_enum<enums::EntityCategory>(8, this->entity_category);
|
||||
buffer.encode_string(9, this->device_class);
|
||||
buffer.encode_string(10, this->device_id);
|
||||
buffer.encode_fixed32(10, this->device_uid);
|
||||
}
|
||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||
void ListEntitiesSwitchResponse::dump_to(std::string &out) const {
|
||||
@@ -2842,8 +2820,9 @@ void ListEntitiesSwitchResponse::dump_to(std::string &out) const {
|
||||
out.append("'").append(this->device_class).append("'");
|
||||
out.append("\n");
|
||||
|
||||
out.append(" device_id: ");
|
||||
out.append("'").append(this->device_id).append("'");
|
||||
out.append(" device_uid: ");
|
||||
sprintf(buffer, "%" PRIu32, this->device_uid);
|
||||
out.append(buffer);
|
||||
out.append("\n");
|
||||
out.append("}");
|
||||
}
|
||||
@@ -2962,10 +2941,6 @@ bool ListEntitiesTextSensorResponse::decode_length(uint32_t field_id, ProtoLengt
|
||||
this->device_class = value.as_string();
|
||||
return true;
|
||||
}
|
||||
case 9: {
|
||||
this->device_id = value.as_string();
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
@@ -2989,7 +2964,7 @@ void ListEntitiesTextSensorResponse::encode(ProtoWriteBuffer buffer) const {
|
||||
buffer.encode_bool(6, this->disabled_by_default);
|
||||
buffer.encode_enum<enums::EntityCategory>(7, this->entity_category);
|
||||
buffer.encode_string(8, this->device_class);
|
||||
buffer.encode_string(9, this->device_id);
|
||||
buffer.encode_fixed32(9, this->device_uid);
|
||||
}
|
||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||
void ListEntitiesTextSensorResponse::dump_to(std::string &out) const {
|
||||
@@ -3028,8 +3003,9 @@ void ListEntitiesTextSensorResponse::dump_to(std::string &out) const {
|
||||
out.append("'").append(this->device_class).append("'");
|
||||
out.append("\n");
|
||||
|
||||
out.append(" device_id: ");
|
||||
out.append("'").append(this->device_id).append("'");
|
||||
out.append(" device_uid: ");
|
||||
sprintf(buffer, "%" PRIu32, this->device_uid);
|
||||
out.append(buffer);
|
||||
out.append("\n");
|
||||
out.append("}");
|
||||
}
|
||||
@@ -3737,10 +3713,6 @@ bool ListEntitiesCameraResponse::decode_length(uint32_t field_id, ProtoLengthDel
|
||||
this->icon = value.as_string();
|
||||
return true;
|
||||
}
|
||||
case 8: {
|
||||
this->device_id = value.as_string();
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
@@ -3763,7 +3735,7 @@ void ListEntitiesCameraResponse::encode(ProtoWriteBuffer buffer) const {
|
||||
buffer.encode_bool(5, this->disabled_by_default);
|
||||
buffer.encode_string(6, this->icon);
|
||||
buffer.encode_enum<enums::EntityCategory>(7, this->entity_category);
|
||||
buffer.encode_string(8, this->device_id);
|
||||
buffer.encode_fixed32(8, this->device_uid);
|
||||
}
|
||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||
void ListEntitiesCameraResponse::dump_to(std::string &out) const {
|
||||
@@ -3798,8 +3770,9 @@ void ListEntitiesCameraResponse::dump_to(std::string &out) const {
|
||||
out.append(proto_enum_to_string<enums::EntityCategory>(this->entity_category));
|
||||
out.append("\n");
|
||||
|
||||
out.append(" device_id: ");
|
||||
out.append("'").append(this->device_id).append("'");
|
||||
out.append(" device_uid: ");
|
||||
sprintf(buffer, "%" PRIu32, this->device_uid);
|
||||
out.append(buffer);
|
||||
out.append("\n");
|
||||
out.append("}");
|
||||
}
|
||||
@@ -3970,10 +3943,6 @@ bool ListEntitiesClimateResponse::decode_length(uint32_t field_id, ProtoLengthDe
|
||||
this->icon = value.as_string();
|
||||
return true;
|
||||
}
|
||||
case 26: {
|
||||
this->device_id = value.as_string();
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
@@ -4050,7 +4019,7 @@ void ListEntitiesClimateResponse::encode(ProtoWriteBuffer buffer) const {
|
||||
buffer.encode_bool(23, this->supports_target_humidity);
|
||||
buffer.encode_float(24, this->visual_min_humidity);
|
||||
buffer.encode_float(25, this->visual_max_humidity);
|
||||
buffer.encode_string(26, this->device_id);
|
||||
buffer.encode_fixed32(26, this->device_uid);
|
||||
}
|
||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||
void ListEntitiesClimateResponse::dump_to(std::string &out) const {
|
||||
@@ -4175,8 +4144,9 @@ void ListEntitiesClimateResponse::dump_to(std::string &out) const {
|
||||
out.append(buffer);
|
||||
out.append("\n");
|
||||
|
||||
out.append(" device_id: ");
|
||||
out.append("'").append(this->device_id).append("'");
|
||||
out.append(" device_uid: ");
|
||||
sprintf(buffer, "%" PRIu32, this->device_uid);
|
||||
out.append(buffer);
|
||||
out.append("\n");
|
||||
out.append("}");
|
||||
}
|
||||
@@ -4631,10 +4601,6 @@ bool ListEntitiesNumberResponse::decode_length(uint32_t field_id, ProtoLengthDel
|
||||
this->device_class = value.as_string();
|
||||
return true;
|
||||
}
|
||||
case 14: {
|
||||
this->device_id = value.as_string();
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
@@ -4675,7 +4641,7 @@ void ListEntitiesNumberResponse::encode(ProtoWriteBuffer buffer) const {
|
||||
buffer.encode_string(11, this->unit_of_measurement);
|
||||
buffer.encode_enum<enums::NumberMode>(12, this->mode);
|
||||
buffer.encode_string(13, this->device_class);
|
||||
buffer.encode_string(14, this->device_id);
|
||||
buffer.encode_fixed32(14, this->device_uid);
|
||||
}
|
||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||
void ListEntitiesNumberResponse::dump_to(std::string &out) const {
|
||||
@@ -4737,8 +4703,9 @@ void ListEntitiesNumberResponse::dump_to(std::string &out) const {
|
||||
out.append("'").append(this->device_class).append("'");
|
||||
out.append("\n");
|
||||
|
||||
out.append(" device_id: ");
|
||||
out.append("'").append(this->device_id).append("'");
|
||||
out.append(" device_uid: ");
|
||||
sprintf(buffer, "%" PRIu32, this->device_uid);
|
||||
out.append(buffer);
|
||||
out.append("\n");
|
||||
out.append("}");
|
||||
}
|
||||
@@ -4862,10 +4829,6 @@ bool ListEntitiesSelectResponse::decode_length(uint32_t field_id, ProtoLengthDel
|
||||
this->options.push_back(value.as_string());
|
||||
return true;
|
||||
}
|
||||
case 9: {
|
||||
this->device_id = value.as_string();
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
@@ -4891,7 +4854,7 @@ void ListEntitiesSelectResponse::encode(ProtoWriteBuffer buffer) const {
|
||||
}
|
||||
buffer.encode_bool(7, this->disabled_by_default);
|
||||
buffer.encode_enum<enums::EntityCategory>(8, this->entity_category);
|
||||
buffer.encode_string(9, this->device_id);
|
||||
buffer.encode_fixed32(9, this->device_uid);
|
||||
}
|
||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||
void ListEntitiesSelectResponse::dump_to(std::string &out) const {
|
||||
@@ -4932,8 +4895,9 @@ void ListEntitiesSelectResponse::dump_to(std::string &out) const {
|
||||
out.append(proto_enum_to_string<enums::EntityCategory>(this->entity_category));
|
||||
out.append("\n");
|
||||
|
||||
out.append(" device_id: ");
|
||||
out.append("'").append(this->device_id).append("'");
|
||||
out.append(" device_uid: ");
|
||||
sprintf(buffer, "%" PRIu32, this->device_uid);
|
||||
out.append(buffer);
|
||||
out.append("\n");
|
||||
out.append("}");
|
||||
}
|
||||
@@ -5079,10 +5043,6 @@ bool ListEntitiesLockResponse::decode_length(uint32_t field_id, ProtoLengthDelim
|
||||
this->code_format = value.as_string();
|
||||
return true;
|
||||
}
|
||||
case 12: {
|
||||
this->device_id = value.as_string();
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
@@ -5109,7 +5069,7 @@ void ListEntitiesLockResponse::encode(ProtoWriteBuffer buffer) const {
|
||||
buffer.encode_bool(9, this->supports_open);
|
||||
buffer.encode_bool(10, this->requires_code);
|
||||
buffer.encode_string(11, this->code_format);
|
||||
buffer.encode_string(12, this->device_id);
|
||||
buffer.encode_fixed32(12, this->device_uid);
|
||||
}
|
||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||
void ListEntitiesLockResponse::dump_to(std::string &out) const {
|
||||
@@ -5160,8 +5120,9 @@ void ListEntitiesLockResponse::dump_to(std::string &out) const {
|
||||
out.append("'").append(this->code_format).append("'");
|
||||
out.append("\n");
|
||||
|
||||
out.append(" device_id: ");
|
||||
out.append("'").append(this->device_id).append("'");
|
||||
out.append(" device_uid: ");
|
||||
sprintf(buffer, "%" PRIu32, this->device_uid);
|
||||
out.append(buffer);
|
||||
out.append("\n");
|
||||
out.append("}");
|
||||
}
|
||||
@@ -5304,10 +5265,6 @@ bool ListEntitiesButtonResponse::decode_length(uint32_t field_id, ProtoLengthDel
|
||||
this->device_class = value.as_string();
|
||||
return true;
|
||||
}
|
||||
case 9: {
|
||||
this->device_id = value.as_string();
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
@@ -5331,7 +5288,7 @@ void ListEntitiesButtonResponse::encode(ProtoWriteBuffer buffer) const {
|
||||
buffer.encode_bool(6, this->disabled_by_default);
|
||||
buffer.encode_enum<enums::EntityCategory>(7, this->entity_category);
|
||||
buffer.encode_string(8, this->device_class);
|
||||
buffer.encode_string(9, this->device_id);
|
||||
buffer.encode_fixed32(9, this->device_uid);
|
||||
}
|
||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||
void ListEntitiesButtonResponse::dump_to(std::string &out) const {
|
||||
@@ -5370,8 +5327,9 @@ void ListEntitiesButtonResponse::dump_to(std::string &out) const {
|
||||
out.append("'").append(this->device_class).append("'");
|
||||
out.append("\n");
|
||||
|
||||
out.append(" device_id: ");
|
||||
out.append("'").append(this->device_id).append("'");
|
||||
out.append(" device_uid: ");
|
||||
sprintf(buffer, "%" PRIu32, this->device_uid);
|
||||
out.append(buffer);
|
||||
out.append("\n");
|
||||
out.append("}");
|
||||
}
|
||||
@@ -5506,10 +5464,6 @@ bool ListEntitiesMediaPlayerResponse::decode_length(uint32_t field_id, ProtoLeng
|
||||
this->supported_formats.push_back(value.as_message<MediaPlayerSupportedFormat>());
|
||||
return true;
|
||||
}
|
||||
case 10: {
|
||||
this->device_id = value.as_string();
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
@@ -5536,7 +5490,7 @@ void ListEntitiesMediaPlayerResponse::encode(ProtoWriteBuffer buffer) const {
|
||||
for (auto &it : this->supported_formats) {
|
||||
buffer.encode_message<MediaPlayerSupportedFormat>(9, it, true);
|
||||
}
|
||||
buffer.encode_string(10, this->device_id);
|
||||
buffer.encode_fixed32(10, this->device_uid);
|
||||
}
|
||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||
void ListEntitiesMediaPlayerResponse::dump_to(std::string &out) const {
|
||||
@@ -5581,8 +5535,9 @@ void ListEntitiesMediaPlayerResponse::dump_to(std::string &out) const {
|
||||
out.append("\n");
|
||||
}
|
||||
|
||||
out.append(" device_id: ");
|
||||
out.append("'").append(this->device_id).append("'");
|
||||
out.append(" device_uid: ");
|
||||
sprintf(buffer, "%" PRIu32, this->device_uid);
|
||||
out.append(buffer);
|
||||
out.append("\n");
|
||||
out.append("}");
|
||||
}
|
||||
@@ -7667,10 +7622,6 @@ bool ListEntitiesAlarmControlPanelResponse::decode_length(uint32_t field_id, Pro
|
||||
this->icon = value.as_string();
|
||||
return true;
|
||||
}
|
||||
case 11: {
|
||||
this->device_id = value.as_string();
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
@@ -7696,7 +7647,7 @@ void ListEntitiesAlarmControlPanelResponse::encode(ProtoWriteBuffer buffer) cons
|
||||
buffer.encode_uint32(8, this->supported_features);
|
||||
buffer.encode_bool(9, this->requires_code);
|
||||
buffer.encode_bool(10, this->requires_code_to_arm);
|
||||
buffer.encode_string(11, this->device_id);
|
||||
buffer.encode_fixed32(11, this->device_uid);
|
||||
}
|
||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||
void ListEntitiesAlarmControlPanelResponse::dump_to(std::string &out) const {
|
||||
@@ -7744,8 +7695,9 @@ void ListEntitiesAlarmControlPanelResponse::dump_to(std::string &out) const {
|
||||
out.append(YESNO(this->requires_code_to_arm));
|
||||
out.append("\n");
|
||||
|
||||
out.append(" device_id: ");
|
||||
out.append("'").append(this->device_id).append("'");
|
||||
out.append(" device_uid: ");
|
||||
sprintf(buffer, "%" PRIu32, this->device_uid);
|
||||
out.append(buffer);
|
||||
out.append("\n");
|
||||
out.append("}");
|
||||
}
|
||||
@@ -7891,10 +7843,6 @@ bool ListEntitiesTextResponse::decode_length(uint32_t field_id, ProtoLengthDelim
|
||||
this->pattern = value.as_string();
|
||||
return true;
|
||||
}
|
||||
case 12: {
|
||||
this->device_id = value.as_string();
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
@@ -7921,7 +7869,7 @@ void ListEntitiesTextResponse::encode(ProtoWriteBuffer buffer) const {
|
||||
buffer.encode_uint32(9, this->max_length);
|
||||
buffer.encode_string(10, this->pattern);
|
||||
buffer.encode_enum<enums::TextMode>(11, this->mode);
|
||||
buffer.encode_string(12, this->device_id);
|
||||
buffer.encode_fixed32(12, this->device_uid);
|
||||
}
|
||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||
void ListEntitiesTextResponse::dump_to(std::string &out) const {
|
||||
@@ -7974,8 +7922,9 @@ void ListEntitiesTextResponse::dump_to(std::string &out) const {
|
||||
out.append(proto_enum_to_string<enums::TextMode>(this->mode));
|
||||
out.append("\n");
|
||||
|
||||
out.append(" device_id: ");
|
||||
out.append("'").append(this->device_id).append("'");
|
||||
out.append(" device_uid: ");
|
||||
sprintf(buffer, "%" PRIu32, this->device_uid);
|
||||
out.append(buffer);
|
||||
out.append("\n");
|
||||
out.append("}");
|
||||
}
|
||||
@@ -8105,10 +8054,6 @@ bool ListEntitiesDateResponse::decode_length(uint32_t field_id, ProtoLengthDelim
|
||||
this->icon = value.as_string();
|
||||
return true;
|
||||
}
|
||||
case 8: {
|
||||
this->device_id = value.as_string();
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
@@ -8131,7 +8076,7 @@ void ListEntitiesDateResponse::encode(ProtoWriteBuffer buffer) const {
|
||||
buffer.encode_string(5, this->icon);
|
||||
buffer.encode_bool(6, this->disabled_by_default);
|
||||
buffer.encode_enum<enums::EntityCategory>(7, this->entity_category);
|
||||
buffer.encode_string(8, this->device_id);
|
||||
buffer.encode_fixed32(8, this->device_uid);
|
||||
}
|
||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||
void ListEntitiesDateResponse::dump_to(std::string &out) const {
|
||||
@@ -8166,8 +8111,9 @@ void ListEntitiesDateResponse::dump_to(std::string &out) const {
|
||||
out.append(proto_enum_to_string<enums::EntityCategory>(this->entity_category));
|
||||
out.append("\n");
|
||||
|
||||
out.append(" device_id: ");
|
||||
out.append("'").append(this->device_id).append("'");
|
||||
out.append(" device_uid: ");
|
||||
sprintf(buffer, "%" PRIu32, this->device_uid);
|
||||
out.append(buffer);
|
||||
out.append("\n");
|
||||
out.append("}");
|
||||
}
|
||||
@@ -8333,10 +8279,6 @@ bool ListEntitiesTimeResponse::decode_length(uint32_t field_id, ProtoLengthDelim
|
||||
this->icon = value.as_string();
|
||||
return true;
|
||||
}
|
||||
case 8: {
|
||||
this->device_id = value.as_string();
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
@@ -8359,7 +8301,7 @@ void ListEntitiesTimeResponse::encode(ProtoWriteBuffer buffer) const {
|
||||
buffer.encode_string(5, this->icon);
|
||||
buffer.encode_bool(6, this->disabled_by_default);
|
||||
buffer.encode_enum<enums::EntityCategory>(7, this->entity_category);
|
||||
buffer.encode_string(8, this->device_id);
|
||||
buffer.encode_fixed32(8, this->device_uid);
|
||||
}
|
||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||
void ListEntitiesTimeResponse::dump_to(std::string &out) const {
|
||||
@@ -8394,8 +8336,9 @@ void ListEntitiesTimeResponse::dump_to(std::string &out) const {
|
||||
out.append(proto_enum_to_string<enums::EntityCategory>(this->entity_category));
|
||||
out.append("\n");
|
||||
|
||||
out.append(" device_id: ");
|
||||
out.append("'").append(this->device_id).append("'");
|
||||
out.append(" device_uid: ");
|
||||
sprintf(buffer, "%" PRIu32, this->device_uid);
|
||||
out.append(buffer);
|
||||
out.append("\n");
|
||||
out.append("}");
|
||||
}
|
||||
@@ -8569,10 +8512,6 @@ bool ListEntitiesEventResponse::decode_length(uint32_t field_id, ProtoLengthDeli
|
||||
this->event_types.push_back(value.as_string());
|
||||
return true;
|
||||
}
|
||||
case 10: {
|
||||
this->device_id = value.as_string();
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
@@ -8599,7 +8538,7 @@ void ListEntitiesEventResponse::encode(ProtoWriteBuffer buffer) const {
|
||||
for (auto &it : this->event_types) {
|
||||
buffer.encode_string(9, it, true);
|
||||
}
|
||||
buffer.encode_string(10, this->device_id);
|
||||
buffer.encode_fixed32(10, this->device_uid);
|
||||
}
|
||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||
void ListEntitiesEventResponse::dump_to(std::string &out) const {
|
||||
@@ -8644,8 +8583,9 @@ void ListEntitiesEventResponse::dump_to(std::string &out) const {
|
||||
out.append("\n");
|
||||
}
|
||||
|
||||
out.append(" device_id: ");
|
||||
out.append("'").append(this->device_id).append("'");
|
||||
out.append(" device_uid: ");
|
||||
sprintf(buffer, "%" PRIu32, this->device_uid);
|
||||
out.append(buffer);
|
||||
out.append("\n");
|
||||
out.append("}");
|
||||
}
|
||||
@@ -8737,10 +8677,6 @@ bool ListEntitiesValveResponse::decode_length(uint32_t field_id, ProtoLengthDeli
|
||||
this->device_class = value.as_string();
|
||||
return true;
|
||||
}
|
||||
case 12: {
|
||||
this->device_id = value.as_string();
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
@@ -8767,7 +8703,7 @@ void ListEntitiesValveResponse::encode(ProtoWriteBuffer buffer) const {
|
||||
buffer.encode_bool(9, this->assumed_state);
|
||||
buffer.encode_bool(10, this->supports_position);
|
||||
buffer.encode_bool(11, this->supports_stop);
|
||||
buffer.encode_string(12, this->device_id);
|
||||
buffer.encode_fixed32(12, this->device_uid);
|
||||
}
|
||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||
void ListEntitiesValveResponse::dump_to(std::string &out) const {
|
||||
@@ -8818,8 +8754,9 @@ void ListEntitiesValveResponse::dump_to(std::string &out) const {
|
||||
out.append(YESNO(this->supports_stop));
|
||||
out.append("\n");
|
||||
|
||||
out.append(" device_id: ");
|
||||
out.append("'").append(this->device_id).append("'");
|
||||
out.append(" device_uid: ");
|
||||
sprintf(buffer, "%" PRIu32, this->device_uid);
|
||||
out.append(buffer);
|
||||
out.append("\n");
|
||||
out.append("}");
|
||||
}
|
||||
@@ -8963,10 +8900,6 @@ bool ListEntitiesDateTimeResponse::decode_length(uint32_t field_id, ProtoLengthD
|
||||
this->icon = value.as_string();
|
||||
return true;
|
||||
}
|
||||
case 8: {
|
||||
this->device_id = value.as_string();
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
@@ -8989,7 +8922,7 @@ void ListEntitiesDateTimeResponse::encode(ProtoWriteBuffer buffer) const {
|
||||
buffer.encode_string(5, this->icon);
|
||||
buffer.encode_bool(6, this->disabled_by_default);
|
||||
buffer.encode_enum<enums::EntityCategory>(7, this->entity_category);
|
||||
buffer.encode_string(8, this->device_id);
|
||||
buffer.encode_fixed32(8, this->device_uid);
|
||||
}
|
||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||
void ListEntitiesDateTimeResponse::dump_to(std::string &out) const {
|
||||
@@ -9024,8 +8957,9 @@ void ListEntitiesDateTimeResponse::dump_to(std::string &out) const {
|
||||
out.append(proto_enum_to_string<enums::EntityCategory>(this->entity_category));
|
||||
out.append("\n");
|
||||
|
||||
out.append(" device_id: ");
|
||||
out.append("'").append(this->device_id).append("'");
|
||||
out.append(" device_uid: ");
|
||||
sprintf(buffer, "%" PRIu32, this->device_uid);
|
||||
out.append(buffer);
|
||||
out.append("\n");
|
||||
out.append("}");
|
||||
}
|
||||
@@ -9149,10 +9083,6 @@ bool ListEntitiesUpdateResponse::decode_length(uint32_t field_id, ProtoLengthDel
|
||||
this->device_class = value.as_string();
|
||||
return true;
|
||||
}
|
||||
case 9: {
|
||||
this->device_id = value.as_string();
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
@@ -9176,7 +9106,7 @@ void ListEntitiesUpdateResponse::encode(ProtoWriteBuffer buffer) const {
|
||||
buffer.encode_bool(6, this->disabled_by_default);
|
||||
buffer.encode_enum<enums::EntityCategory>(7, this->entity_category);
|
||||
buffer.encode_string(8, this->device_class);
|
||||
buffer.encode_string(9, this->device_id);
|
||||
buffer.encode_fixed32(9, this->device_uid);
|
||||
}
|
||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||
void ListEntitiesUpdateResponse::dump_to(std::string &out) const {
|
||||
@@ -9215,8 +9145,9 @@ void ListEntitiesUpdateResponse::dump_to(std::string &out) const {
|
||||
out.append("'").append(this->device_class).append("'");
|
||||
out.append("\n");
|
||||
|
||||
out.append(" device_id: ");
|
||||
out.append("'").append(this->device_id).append("'");
|
||||
out.append(" device_uid: ");
|
||||
sprintf(buffer, "%" PRIu32, this->device_uid);
|
||||
out.append(buffer);
|
||||
out.append("\n");
|
||||
out.append("}");
|
||||
}
|
||||
|
@@ -349,7 +349,7 @@ class DeviceInfoRequest : public ProtoMessage {
|
||||
};
|
||||
class SubDeviceInfo : public ProtoMessage {
|
||||
public:
|
||||
std::string id{};
|
||||
uint32_t uid{};
|
||||
std::string name{};
|
||||
std::string suggested_area{};
|
||||
void encode(ProtoWriteBuffer buffer) const override;
|
||||
@@ -429,7 +429,7 @@ class ListEntitiesBinarySensorResponse : public ProtoMessage {
|
||||
bool disabled_by_default{false};
|
||||
std::string icon{};
|
||||
enums::EntityCategory entity_category{};
|
||||
std::string device_id{};
|
||||
uint32_t device_uid{};
|
||||
void encode(ProtoWriteBuffer buffer) const override;
|
||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||
void dump_to(std::string &out) const override;
|
||||
@@ -468,7 +468,7 @@ class ListEntitiesCoverResponse : public ProtoMessage {
|
||||
std::string icon{};
|
||||
enums::EntityCategory entity_category{};
|
||||
bool supports_stop{false};
|
||||
std::string device_id{};
|
||||
uint32_t device_uid{};
|
||||
void encode(ProtoWriteBuffer buffer) const override;
|
||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||
void dump_to(std::string &out) const override;
|
||||
@@ -528,7 +528,7 @@ class ListEntitiesFanResponse : public ProtoMessage {
|
||||
std::string icon{};
|
||||
enums::EntityCategory entity_category{};
|
||||
std::vector<std::string> supported_preset_modes{};
|
||||
std::string device_id{};
|
||||
uint32_t device_uid{};
|
||||
void encode(ProtoWriteBuffer buffer) const override;
|
||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||
void dump_to(std::string &out) const override;
|
||||
@@ -600,7 +600,7 @@ class ListEntitiesLightResponse : public ProtoMessage {
|
||||
bool disabled_by_default{false};
|
||||
std::string icon{};
|
||||
enums::EntityCategory entity_category{};
|
||||
std::string device_id{};
|
||||
uint32_t device_uid{};
|
||||
void encode(ProtoWriteBuffer buffer) const override;
|
||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||
void dump_to(std::string &out) const override;
|
||||
@@ -690,7 +690,7 @@ class ListEntitiesSensorResponse : public ProtoMessage {
|
||||
enums::SensorLastResetType legacy_last_reset_type{};
|
||||
bool disabled_by_default{false};
|
||||
enums::EntityCategory entity_category{};
|
||||
std::string device_id{};
|
||||
uint32_t device_uid{};
|
||||
void encode(ProtoWriteBuffer buffer) const override;
|
||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||
void dump_to(std::string &out) const override;
|
||||
@@ -726,7 +726,7 @@ class ListEntitiesSwitchResponse : public ProtoMessage {
|
||||
bool disabled_by_default{false};
|
||||
enums::EntityCategory entity_category{};
|
||||
std::string device_class{};
|
||||
std::string device_id{};
|
||||
uint32_t device_uid{};
|
||||
void encode(ProtoWriteBuffer buffer) const override;
|
||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||
void dump_to(std::string &out) const override;
|
||||
@@ -773,7 +773,7 @@ class ListEntitiesTextSensorResponse : public ProtoMessage {
|
||||
bool disabled_by_default{false};
|
||||
enums::EntityCategory entity_category{};
|
||||
std::string device_class{};
|
||||
std::string device_id{};
|
||||
uint32_t device_uid{};
|
||||
void encode(ProtoWriteBuffer buffer) const override;
|
||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||
void dump_to(std::string &out) const override;
|
||||
@@ -1010,7 +1010,7 @@ class ListEntitiesCameraResponse : public ProtoMessage {
|
||||
bool disabled_by_default{false};
|
||||
std::string icon{};
|
||||
enums::EntityCategory entity_category{};
|
||||
std::string device_id{};
|
||||
uint32_t device_uid{};
|
||||
void encode(ProtoWriteBuffer buffer) const override;
|
||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||
void dump_to(std::string &out) const override;
|
||||
@@ -1075,7 +1075,7 @@ class ListEntitiesClimateResponse : public ProtoMessage {
|
||||
bool supports_target_humidity{false};
|
||||
float visual_min_humidity{0.0f};
|
||||
float visual_max_humidity{0.0f};
|
||||
std::string device_id{};
|
||||
uint32_t device_uid{};
|
||||
void encode(ProtoWriteBuffer buffer) const override;
|
||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||
void dump_to(std::string &out) const override;
|
||||
@@ -1163,7 +1163,7 @@ class ListEntitiesNumberResponse : public ProtoMessage {
|
||||
std::string unit_of_measurement{};
|
||||
enums::NumberMode mode{};
|
||||
std::string device_class{};
|
||||
std::string device_id{};
|
||||
uint32_t device_uid{};
|
||||
void encode(ProtoWriteBuffer buffer) const override;
|
||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||
void dump_to(std::string &out) const override;
|
||||
@@ -1210,7 +1210,7 @@ class ListEntitiesSelectResponse : public ProtoMessage {
|
||||
std::vector<std::string> options{};
|
||||
bool disabled_by_default{false};
|
||||
enums::EntityCategory entity_category{};
|
||||
std::string device_id{};
|
||||
uint32_t device_uid{};
|
||||
void encode(ProtoWriteBuffer buffer) const override;
|
||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||
void dump_to(std::string &out) const override;
|
||||
@@ -1262,7 +1262,7 @@ class ListEntitiesLockResponse : public ProtoMessage {
|
||||
bool supports_open{false};
|
||||
bool requires_code{false};
|
||||
std::string code_format{};
|
||||
std::string device_id{};
|
||||
uint32_t device_uid{};
|
||||
void encode(ProtoWriteBuffer buffer) const override;
|
||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||
void dump_to(std::string &out) const override;
|
||||
@@ -1312,7 +1312,7 @@ class ListEntitiesButtonResponse : public ProtoMessage {
|
||||
bool disabled_by_default{false};
|
||||
enums::EntityCategory entity_category{};
|
||||
std::string device_class{};
|
||||
std::string device_id{};
|
||||
uint32_t device_uid{};
|
||||
void encode(ProtoWriteBuffer buffer) const override;
|
||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||
void dump_to(std::string &out) const override;
|
||||
@@ -1361,7 +1361,7 @@ class ListEntitiesMediaPlayerResponse : public ProtoMessage {
|
||||
enums::EntityCategory entity_category{};
|
||||
bool supports_pause{false};
|
||||
std::vector<MediaPlayerSupportedFormat> supported_formats{};
|
||||
std::string device_id{};
|
||||
uint32_t device_uid{};
|
||||
void encode(ProtoWriteBuffer buffer) const override;
|
||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||
void dump_to(std::string &out) const override;
|
||||
@@ -1999,7 +1999,7 @@ class ListEntitiesAlarmControlPanelResponse : public ProtoMessage {
|
||||
uint32_t supported_features{0};
|
||||
bool requires_code{false};
|
||||
bool requires_code_to_arm{false};
|
||||
std::string device_id{};
|
||||
uint32_t device_uid{};
|
||||
void encode(ProtoWriteBuffer buffer) const override;
|
||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||
void dump_to(std::string &out) const override;
|
||||
@@ -2051,7 +2051,7 @@ class ListEntitiesTextResponse : public ProtoMessage {
|
||||
uint32_t max_length{0};
|
||||
std::string pattern{};
|
||||
enums::TextMode mode{};
|
||||
std::string device_id{};
|
||||
uint32_t device_uid{};
|
||||
void encode(ProtoWriteBuffer buffer) const override;
|
||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||
void dump_to(std::string &out) const override;
|
||||
@@ -2099,7 +2099,7 @@ class ListEntitiesDateResponse : public ProtoMessage {
|
||||
std::string icon{};
|
||||
bool disabled_by_default{false};
|
||||
enums::EntityCategory entity_category{};
|
||||
std::string device_id{};
|
||||
uint32_t device_uid{};
|
||||
void encode(ProtoWriteBuffer buffer) const override;
|
||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||
void dump_to(std::string &out) const override;
|
||||
@@ -2150,7 +2150,7 @@ class ListEntitiesTimeResponse : public ProtoMessage {
|
||||
std::string icon{};
|
||||
bool disabled_by_default{false};
|
||||
enums::EntityCategory entity_category{};
|
||||
std::string device_id{};
|
||||
uint32_t device_uid{};
|
||||
void encode(ProtoWriteBuffer buffer) const override;
|
||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||
void dump_to(std::string &out) const override;
|
||||
@@ -2203,7 +2203,7 @@ class ListEntitiesEventResponse : public ProtoMessage {
|
||||
enums::EntityCategory entity_category{};
|
||||
std::string device_class{};
|
||||
std::vector<std::string> event_types{};
|
||||
std::string device_id{};
|
||||
uint32_t device_uid{};
|
||||
void encode(ProtoWriteBuffer buffer) const override;
|
||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||
void dump_to(std::string &out) const override;
|
||||
@@ -2240,7 +2240,7 @@ class ListEntitiesValveResponse : public ProtoMessage {
|
||||
bool assumed_state{false};
|
||||
bool supports_position{false};
|
||||
bool supports_stop{false};
|
||||
std::string device_id{};
|
||||
uint32_t device_uid{};
|
||||
void encode(ProtoWriteBuffer buffer) const override;
|
||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||
void dump_to(std::string &out) const override;
|
||||
@@ -2289,7 +2289,7 @@ class ListEntitiesDateTimeResponse : public ProtoMessage {
|
||||
std::string icon{};
|
||||
bool disabled_by_default{false};
|
||||
enums::EntityCategory entity_category{};
|
||||
std::string device_id{};
|
||||
uint32_t device_uid{};
|
||||
void encode(ProtoWriteBuffer buffer) const override;
|
||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||
void dump_to(std::string &out) const override;
|
||||
@@ -2336,7 +2336,7 @@ class ListEntitiesUpdateResponse : public ProtoMessage {
|
||||
bool disabled_by_default{false};
|
||||
enums::EntityCategory entity_category{};
|
||||
std::string device_class{};
|
||||
std::string device_id{};
|
||||
uint32_t device_uid{};
|
||||
void encode(ProtoWriteBuffer buffer) const override;
|
||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||
void dump_to(std::string &out) const override;
|
||||
|
@@ -19,7 +19,7 @@ CONFIG_SCHEMA = cv.Schema(
|
||||
|
||||
async def to_code(config):
|
||||
dev = cg.new_Pvariable(config[CONF_ID])
|
||||
cg.add(dev.set_id(str(config[CONF_ID])))
|
||||
cg.add(dev.set_uid(hash(str(config[CONF_ID])) % 0xFFFFFFFF))
|
||||
cg.add(dev.set_name(config[CONF_NAME]))
|
||||
cg.add(dev.set_area(config[CONF_AREA]))
|
||||
cg.add(cg.App.register_sub_device(dev))
|
||||
|
@@ -7,15 +7,15 @@ namespace devices {
|
||||
|
||||
class SubDevice {
|
||||
public:
|
||||
void set_id(std::string id) { id_ = std::move(id); }
|
||||
std::string get_id() { return id_; }
|
||||
void set_uid(uint32_t uid) { uid_ = uid; }
|
||||
uint32_t get_uid() { return uid_; }
|
||||
void set_name(std::string name) { name_ = std::move(name); }
|
||||
std::string get_name() { return name_; }
|
||||
void set_area(std::string area) { area_ = std::move(area); }
|
||||
std::string get_area() { return area_; }
|
||||
|
||||
protected:
|
||||
std::string id_ = "";
|
||||
uint32_t uid_{};
|
||||
std::string name_ = "";
|
||||
std::string area_ = "";
|
||||
};
|
||||
|
@@ -21,7 +21,7 @@ from esphome.const import (
|
||||
CONF_COMMAND_RETAIN,
|
||||
CONF_COMMAND_TOPIC,
|
||||
CONF_DAY,
|
||||
CONF_DEVICE_ID,
|
||||
CONF_DEVICE_UID,
|
||||
CONF_DISABLED_BY_DEFAULT,
|
||||
CONF_DISCOVERY,
|
||||
CONF_ENTITY_CATEGORY,
|
||||
@@ -348,7 +348,7 @@ def icon(value):
|
||||
)
|
||||
|
||||
|
||||
def sub_device_id(value):
|
||||
def sub_device_uid(value):
|
||||
devices_ns = cg.esphome_ns.namespace("devices")
|
||||
SubDevice = devices_ns.class_("SubDevice")
|
||||
validator = use_id(SubDevice)
|
||||
@@ -1832,7 +1832,7 @@ ENTITY_BASE_SCHEMA = Schema(
|
||||
Optional(CONF_DISABLED_BY_DEFAULT, default=False): boolean,
|
||||
Optional(CONF_ICON): icon,
|
||||
Optional(CONF_ENTITY_CATEGORY): entity_category,
|
||||
Optional(CONF_DEVICE_ID): sub_device_id,
|
||||
Optional(CONF_DEVICE_UID): sub_device_uid,
|
||||
}
|
||||
)
|
||||
|
||||
|
@@ -216,7 +216,7 @@ CONF_DEST = "dest"
|
||||
CONF_DEVICE = "device"
|
||||
CONF_DEVICE_CLASS = "device_class"
|
||||
CONF_DEVICE_FACTOR = "device_factor"
|
||||
CONF_DEVICE_ID = "device_id"
|
||||
CONF_DEVICE_UID = "device_uid"
|
||||
CONF_DIELECTRIC_CONSTANT = "dielectric_constant"
|
||||
CONF_DIMENSIONS = "dimensions"
|
||||
CONF_DIO_PIN = "dio_pin"
|
||||
|
@@ -48,8 +48,8 @@ class EntityBase {
|
||||
void set_icon(const char *icon);
|
||||
|
||||
// Get/set this entity's device id
|
||||
const StringRef &get_device_id() const { return this->device_id_; }
|
||||
void set_device_id(const std::string &device_id) { this->device_id_ = StringRef(device_id); }
|
||||
const uint32_t get_device_uid() const { return this->device_uid_; }
|
||||
void set_device_uid(const uint32_t device_uid) { this->device_uid_ = device_uid; }
|
||||
|
||||
protected:
|
||||
/// The hash_base() function has been deprecated. It is kept in this
|
||||
@@ -65,7 +65,7 @@ class EntityBase {
|
||||
bool internal_{false};
|
||||
bool disabled_by_default_{false};
|
||||
EntityCategory entity_category_{ENTITY_CATEGORY_NONE};
|
||||
StringRef device_id_{""};
|
||||
uint32_t device_uid_{};
|
||||
};
|
||||
|
||||
class EntityBase_DeviceClass { // NOLINT(readability-identifier-naming)
|
||||
|
@@ -113,7 +113,7 @@ async def setup_entity(var, config):
|
||||
add(var.set_entity_category(config[CONF_ENTITY_CATEGORY]))
|
||||
if CONF_DEVICE_ID in config:
|
||||
device = await get_variable(config[CONF_DEVICE_ID])
|
||||
add(var.set_device_id(device.get_id()))
|
||||
add(var.set_device_uid(hash(str(device)) % 0xFFFFFFFF))
|
||||
|
||||
|
||||
def extract_registry_entry_config(
|
||||
|
@@ -8,4 +8,4 @@ binary_sensor:
|
||||
|
||||
- platform: template
|
||||
name: Other device sensor
|
||||
device_id: other_device
|
||||
device_uid: other_device
|
||||
|
Reference in New Issue
Block a user