mirror of
https://github.com/esphome/esphome.git
synced 2025-08-02 16:37:46 +00:00
Merge remote-tracking branch 'upstream/dev' into proto_field_ifdefs
This commit is contained in:
commit
2abccce297
@ -118,10 +118,6 @@ class ADCSensor : public sensor::Sensor, public PollingComponent, public voltage
|
|||||||
void set_autorange(bool autorange) { this->autorange_ = autorange; }
|
void set_autorange(bool autorange) { this->autorange_ = autorange; }
|
||||||
#endif // USE_ESP32
|
#endif // USE_ESP32
|
||||||
|
|
||||||
#ifdef USE_ESP8266
|
|
||||||
std::string unique_id() override;
|
|
||||||
#endif // USE_ESP8266
|
|
||||||
|
|
||||||
#ifdef USE_RP2040
|
#ifdef USE_RP2040
|
||||||
void set_is_temperature() { this->is_temperature_ = true; }
|
void set_is_temperature() { this->is_temperature_ = true; }
|
||||||
#endif // USE_RP2040
|
#endif // USE_RP2040
|
||||||
|
@ -56,8 +56,6 @@ float ADCSensor::sample() {
|
|||||||
return aggr.aggregate() / 1024.0f;
|
return aggr.aggregate() / 1024.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string ADCSensor::unique_id() { return get_mac_address() + "-adc"; }
|
|
||||||
|
|
||||||
} // namespace adc
|
} // namespace adc
|
||||||
} // namespace esphome
|
} // namespace esphome
|
||||||
|
|
||||||
|
@ -290,7 +290,7 @@ message ListEntitiesBinarySensorResponse {
|
|||||||
string object_id = 1;
|
string object_id = 1;
|
||||||
fixed32 key = 2;
|
fixed32 key = 2;
|
||||||
string name = 3;
|
string name = 3;
|
||||||
string unique_id = 4;
|
reserved 4; // Deprecated: was string unique_id
|
||||||
|
|
||||||
string device_class = 5;
|
string device_class = 5;
|
||||||
bool is_status_binary_sensor = 6;
|
bool is_status_binary_sensor = 6;
|
||||||
@ -324,7 +324,7 @@ message ListEntitiesCoverResponse {
|
|||||||
string object_id = 1;
|
string object_id = 1;
|
||||||
fixed32 key = 2;
|
fixed32 key = 2;
|
||||||
string name = 3;
|
string name = 3;
|
||||||
string unique_id = 4;
|
reserved 4; // Deprecated: was string unique_id
|
||||||
|
|
||||||
bool assumed_state = 5;
|
bool assumed_state = 5;
|
||||||
bool supports_position = 6;
|
bool supports_position = 6;
|
||||||
@ -401,7 +401,7 @@ message ListEntitiesFanResponse {
|
|||||||
string object_id = 1;
|
string object_id = 1;
|
||||||
fixed32 key = 2;
|
fixed32 key = 2;
|
||||||
string name = 3;
|
string name = 3;
|
||||||
string unique_id = 4;
|
reserved 4; // Deprecated: was string unique_id
|
||||||
|
|
||||||
bool supports_oscillation = 5;
|
bool supports_oscillation = 5;
|
||||||
bool supports_speed = 6;
|
bool supports_speed = 6;
|
||||||
@ -484,7 +484,7 @@ message ListEntitiesLightResponse {
|
|||||||
string object_id = 1;
|
string object_id = 1;
|
||||||
fixed32 key = 2;
|
fixed32 key = 2;
|
||||||
string name = 3;
|
string name = 3;
|
||||||
string unique_id = 4;
|
reserved 4; // Deprecated: was string unique_id
|
||||||
|
|
||||||
repeated ColorMode supported_color_modes = 12;
|
repeated ColorMode supported_color_modes = 12;
|
||||||
// next four supports_* are for legacy clients, newer clients should use color modes
|
// next four supports_* are for legacy clients, newer clients should use color modes
|
||||||
@ -582,7 +582,7 @@ message ListEntitiesSensorResponse {
|
|||||||
string object_id = 1;
|
string object_id = 1;
|
||||||
fixed32 key = 2;
|
fixed32 key = 2;
|
||||||
string name = 3;
|
string name = 3;
|
||||||
string unique_id = 4;
|
reserved 4; // Deprecated: was string unique_id
|
||||||
|
|
||||||
string icon = 5 [(field_ifdef) = "USE_ENTITY_ICON"];
|
string icon = 5 [(field_ifdef) = "USE_ENTITY_ICON"];
|
||||||
string unit_of_measurement = 6;
|
string unit_of_measurement = 6;
|
||||||
@ -621,7 +621,7 @@ message ListEntitiesSwitchResponse {
|
|||||||
string object_id = 1;
|
string object_id = 1;
|
||||||
fixed32 key = 2;
|
fixed32 key = 2;
|
||||||
string name = 3;
|
string name = 3;
|
||||||
string unique_id = 4;
|
reserved 4; // Deprecated: was string unique_id
|
||||||
|
|
||||||
string icon = 5 [(field_ifdef) = "USE_ENTITY_ICON"];
|
string icon = 5 [(field_ifdef) = "USE_ENTITY_ICON"];
|
||||||
bool assumed_state = 6;
|
bool assumed_state = 6;
|
||||||
@ -663,7 +663,7 @@ message ListEntitiesTextSensorResponse {
|
|||||||
string object_id = 1;
|
string object_id = 1;
|
||||||
fixed32 key = 2;
|
fixed32 key = 2;
|
||||||
string name = 3;
|
string name = 3;
|
||||||
string unique_id = 4;
|
reserved 4; // Deprecated: was string unique_id
|
||||||
|
|
||||||
string icon = 5 [(field_ifdef) = "USE_ENTITY_ICON"];
|
string icon = 5 [(field_ifdef) = "USE_ENTITY_ICON"];
|
||||||
bool disabled_by_default = 6;
|
bool disabled_by_default = 6;
|
||||||
@ -853,7 +853,7 @@ message ListEntitiesCameraResponse {
|
|||||||
string object_id = 1;
|
string object_id = 1;
|
||||||
fixed32 key = 2;
|
fixed32 key = 2;
|
||||||
string name = 3;
|
string name = 3;
|
||||||
string unique_id = 4;
|
reserved 4; // Deprecated: was string unique_id
|
||||||
bool disabled_by_default = 5;
|
bool disabled_by_default = 5;
|
||||||
string icon = 6 [(field_ifdef) = "USE_ENTITY_ICON"];
|
string icon = 6 [(field_ifdef) = "USE_ENTITY_ICON"];
|
||||||
EntityCategory entity_category = 7;
|
EntityCategory entity_category = 7;
|
||||||
@ -937,7 +937,7 @@ message ListEntitiesClimateResponse {
|
|||||||
string object_id = 1;
|
string object_id = 1;
|
||||||
fixed32 key = 2;
|
fixed32 key = 2;
|
||||||
string name = 3;
|
string name = 3;
|
||||||
string unique_id = 4;
|
reserved 4; // Deprecated: was string unique_id
|
||||||
|
|
||||||
bool supports_current_temperature = 5;
|
bool supports_current_temperature = 5;
|
||||||
bool supports_two_point_target_temperature = 6;
|
bool supports_two_point_target_temperature = 6;
|
||||||
@ -1038,7 +1038,7 @@ message ListEntitiesNumberResponse {
|
|||||||
string object_id = 1;
|
string object_id = 1;
|
||||||
fixed32 key = 2;
|
fixed32 key = 2;
|
||||||
string name = 3;
|
string name = 3;
|
||||||
string unique_id = 4;
|
reserved 4; // Deprecated: was string unique_id
|
||||||
|
|
||||||
string icon = 5 [(field_ifdef) = "USE_ENTITY_ICON"];
|
string icon = 5 [(field_ifdef) = "USE_ENTITY_ICON"];
|
||||||
float min_value = 6;
|
float min_value = 6;
|
||||||
@ -1087,7 +1087,7 @@ message ListEntitiesSelectResponse {
|
|||||||
string object_id = 1;
|
string object_id = 1;
|
||||||
fixed32 key = 2;
|
fixed32 key = 2;
|
||||||
string name = 3;
|
string name = 3;
|
||||||
string unique_id = 4;
|
reserved 4; // Deprecated: was string unique_id
|
||||||
|
|
||||||
string icon = 5 [(field_ifdef) = "USE_ENTITY_ICON"];
|
string icon = 5 [(field_ifdef) = "USE_ENTITY_ICON"];
|
||||||
repeated string options = 6;
|
repeated string options = 6;
|
||||||
@ -1131,7 +1131,7 @@ message ListEntitiesSirenResponse {
|
|||||||
string object_id = 1;
|
string object_id = 1;
|
||||||
fixed32 key = 2;
|
fixed32 key = 2;
|
||||||
string name = 3;
|
string name = 3;
|
||||||
string unique_id = 4;
|
reserved 4; // Deprecated: was string unique_id
|
||||||
|
|
||||||
string icon = 5 [(field_ifdef) = "USE_ENTITY_ICON"];
|
string icon = 5 [(field_ifdef) = "USE_ENTITY_ICON"];
|
||||||
bool disabled_by_default = 6;
|
bool disabled_by_default = 6;
|
||||||
@ -1194,7 +1194,7 @@ message ListEntitiesLockResponse {
|
|||||||
string object_id = 1;
|
string object_id = 1;
|
||||||
fixed32 key = 2;
|
fixed32 key = 2;
|
||||||
string name = 3;
|
string name = 3;
|
||||||
string unique_id = 4;
|
reserved 4; // Deprecated: was string unique_id
|
||||||
|
|
||||||
string icon = 5 [(field_ifdef) = "USE_ENTITY_ICON"];
|
string icon = 5 [(field_ifdef) = "USE_ENTITY_ICON"];
|
||||||
bool disabled_by_default = 6;
|
bool disabled_by_default = 6;
|
||||||
@ -1243,7 +1243,7 @@ message ListEntitiesButtonResponse {
|
|||||||
string object_id = 1;
|
string object_id = 1;
|
||||||
fixed32 key = 2;
|
fixed32 key = 2;
|
||||||
string name = 3;
|
string name = 3;
|
||||||
string unique_id = 4;
|
reserved 4; // Deprecated: was string unique_id
|
||||||
|
|
||||||
string icon = 5 [(field_ifdef) = "USE_ENTITY_ICON"];
|
string icon = 5 [(field_ifdef) = "USE_ENTITY_ICON"];
|
||||||
bool disabled_by_default = 6;
|
bool disabled_by_default = 6;
|
||||||
@ -1298,7 +1298,7 @@ message ListEntitiesMediaPlayerResponse {
|
|||||||
string object_id = 1;
|
string object_id = 1;
|
||||||
fixed32 key = 2;
|
fixed32 key = 2;
|
||||||
string name = 3;
|
string name = 3;
|
||||||
string unique_id = 4;
|
reserved 4; // Deprecated: was string unique_id
|
||||||
|
|
||||||
string icon = 5 [(field_ifdef) = "USE_ENTITY_ICON"];
|
string icon = 5 [(field_ifdef) = "USE_ENTITY_ICON"];
|
||||||
bool disabled_by_default = 6;
|
bool disabled_by_default = 6;
|
||||||
@ -1845,7 +1845,7 @@ message ListEntitiesAlarmControlPanelResponse {
|
|||||||
string object_id = 1;
|
string object_id = 1;
|
||||||
fixed32 key = 2;
|
fixed32 key = 2;
|
||||||
string name = 3;
|
string name = 3;
|
||||||
string unique_id = 4;
|
reserved 4; // Deprecated: was string unique_id
|
||||||
string icon = 5 [(field_ifdef) = "USE_ENTITY_ICON"];
|
string icon = 5 [(field_ifdef) = "USE_ENTITY_ICON"];
|
||||||
bool disabled_by_default = 6;
|
bool disabled_by_default = 6;
|
||||||
EntityCategory entity_category = 7;
|
EntityCategory entity_category = 7;
|
||||||
@ -1892,7 +1892,7 @@ message ListEntitiesTextResponse {
|
|||||||
string object_id = 1;
|
string object_id = 1;
|
||||||
fixed32 key = 2;
|
fixed32 key = 2;
|
||||||
string name = 3;
|
string name = 3;
|
||||||
string unique_id = 4;
|
reserved 4; // Deprecated: was string unique_id
|
||||||
string icon = 5 [(field_ifdef) = "USE_ENTITY_ICON"];
|
string icon = 5 [(field_ifdef) = "USE_ENTITY_ICON"];
|
||||||
bool disabled_by_default = 6;
|
bool disabled_by_default = 6;
|
||||||
EntityCategory entity_category = 7;
|
EntityCategory entity_category = 7;
|
||||||
@ -1940,7 +1940,7 @@ message ListEntitiesDateResponse {
|
|||||||
string object_id = 1;
|
string object_id = 1;
|
||||||
fixed32 key = 2;
|
fixed32 key = 2;
|
||||||
string name = 3;
|
string name = 3;
|
||||||
string unique_id = 4;
|
reserved 4; // Deprecated: was string unique_id
|
||||||
|
|
||||||
string icon = 5 [(field_ifdef) = "USE_ENTITY_ICON"];
|
string icon = 5 [(field_ifdef) = "USE_ENTITY_ICON"];
|
||||||
bool disabled_by_default = 6;
|
bool disabled_by_default = 6;
|
||||||
@ -1987,7 +1987,7 @@ message ListEntitiesTimeResponse {
|
|||||||
string object_id = 1;
|
string object_id = 1;
|
||||||
fixed32 key = 2;
|
fixed32 key = 2;
|
||||||
string name = 3;
|
string name = 3;
|
||||||
string unique_id = 4;
|
reserved 4; // Deprecated: was string unique_id
|
||||||
|
|
||||||
string icon = 5 [(field_ifdef) = "USE_ENTITY_ICON"];
|
string icon = 5 [(field_ifdef) = "USE_ENTITY_ICON"];
|
||||||
bool disabled_by_default = 6;
|
bool disabled_by_default = 6;
|
||||||
@ -2034,7 +2034,7 @@ message ListEntitiesEventResponse {
|
|||||||
string object_id = 1;
|
string object_id = 1;
|
||||||
fixed32 key = 2;
|
fixed32 key = 2;
|
||||||
string name = 3;
|
string name = 3;
|
||||||
string unique_id = 4;
|
reserved 4; // Deprecated: was string unique_id
|
||||||
|
|
||||||
string icon = 5 [(field_ifdef) = "USE_ENTITY_ICON"];
|
string icon = 5 [(field_ifdef) = "USE_ENTITY_ICON"];
|
||||||
bool disabled_by_default = 6;
|
bool disabled_by_default = 6;
|
||||||
@ -2065,7 +2065,7 @@ message ListEntitiesValveResponse {
|
|||||||
string object_id = 1;
|
string object_id = 1;
|
||||||
fixed32 key = 2;
|
fixed32 key = 2;
|
||||||
string name = 3;
|
string name = 3;
|
||||||
string unique_id = 4;
|
reserved 4; // Deprecated: was string unique_id
|
||||||
|
|
||||||
string icon = 5 [(field_ifdef) = "USE_ENTITY_ICON"];
|
string icon = 5 [(field_ifdef) = "USE_ENTITY_ICON"];
|
||||||
bool disabled_by_default = 6;
|
bool disabled_by_default = 6;
|
||||||
@ -2120,7 +2120,7 @@ message ListEntitiesDateTimeResponse {
|
|||||||
string object_id = 1;
|
string object_id = 1;
|
||||||
fixed32 key = 2;
|
fixed32 key = 2;
|
||||||
string name = 3;
|
string name = 3;
|
||||||
string unique_id = 4;
|
reserved 4; // Deprecated: was string unique_id
|
||||||
|
|
||||||
string icon = 5 [(field_ifdef) = "USE_ENTITY_ICON"];
|
string icon = 5 [(field_ifdef) = "USE_ENTITY_ICON"];
|
||||||
bool disabled_by_default = 6;
|
bool disabled_by_default = 6;
|
||||||
@ -2163,7 +2163,7 @@ message ListEntitiesUpdateResponse {
|
|||||||
string object_id = 1;
|
string object_id = 1;
|
||||||
fixed32 key = 2;
|
fixed32 key = 2;
|
||||||
string name = 3;
|
string name = 3;
|
||||||
string unique_id = 4;
|
reserved 4; // Deprecated: was string unique_id
|
||||||
|
|
||||||
string icon = 5 [(field_ifdef) = "USE_ENTITY_ICON"];
|
string icon = 5 [(field_ifdef) = "USE_ENTITY_ICON"];
|
||||||
bool disabled_by_default = 6;
|
bool disabled_by_default = 6;
|
||||||
|
@ -241,10 +241,6 @@ void APIConnection::loop() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string get_default_unique_id(const std::string &component_type, EntityBase *entity) {
|
|
||||||
return App.get_name() + component_type + entity->get_object_id();
|
|
||||||
}
|
|
||||||
|
|
||||||
DisconnectResponse APIConnection::disconnect(const DisconnectRequest &msg) {
|
DisconnectResponse APIConnection::disconnect(const DisconnectRequest &msg) {
|
||||||
// remote initiated disconnect_client
|
// remote initiated disconnect_client
|
||||||
// don't close yet, we still need to send the disconnect response
|
// don't close yet, we still need to send the disconnect response
|
||||||
@ -331,7 +327,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.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);
|
||||||
}
|
}
|
||||||
@ -366,7 +361,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.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);
|
||||||
}
|
}
|
||||||
@ -429,7 +423,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.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);
|
||||||
}
|
}
|
||||||
@ -503,7 +496,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.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);
|
||||||
}
|
}
|
||||||
@ -565,9 +557,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.unique_id = sensor->unique_id();
|
|
||||||
if (msg.unique_id.empty())
|
|
||||||
msg.unique_id = get_default_unique_id("sensor", sensor);
|
|
||||||
fill_entity_info_base(sensor, msg);
|
fill_entity_info_base(sensor, msg);
|
||||||
return encode_message_to_buffer(msg, ListEntitiesSensorResponse::MESSAGE_TYPE, conn, remaining_size, is_single);
|
return encode_message_to_buffer(msg, ListEntitiesSensorResponse::MESSAGE_TYPE, conn, remaining_size, is_single);
|
||||||
}
|
}
|
||||||
@ -594,7 +583,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.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);
|
||||||
}
|
}
|
||||||
@ -629,9 +617,6 @@ uint16_t APIConnection::try_send_text_sensor_info(EntityBase *entity, APIConnect
|
|||||||
auto *text_sensor = static_cast<text_sensor::TextSensor *>(entity);
|
auto *text_sensor = static_cast<text_sensor::TextSensor *>(entity);
|
||||||
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();
|
|
||||||
if (msg.unique_id.empty())
|
|
||||||
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);
|
||||||
return encode_message_to_buffer(msg, ListEntitiesTextSensorResponse::MESSAGE_TYPE, conn, remaining_size, is_single);
|
return encode_message_to_buffer(msg, ListEntitiesTextSensorResponse::MESSAGE_TYPE, conn, remaining_size, is_single);
|
||||||
}
|
}
|
||||||
@ -704,7 +689,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.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);
|
||||||
}
|
}
|
||||||
@ -760,7 +744,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.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);
|
||||||
}
|
}
|
||||||
@ -791,7 +774,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.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);
|
||||||
}
|
}
|
||||||
@ -822,7 +804,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.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);
|
||||||
}
|
}
|
||||||
@ -854,7 +835,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.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);
|
||||||
}
|
}
|
||||||
@ -889,7 +869,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.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);
|
||||||
}
|
}
|
||||||
@ -922,7 +901,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.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);
|
||||||
}
|
}
|
||||||
@ -939,7 +917,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.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);
|
||||||
}
|
}
|
||||||
@ -971,7 +948,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.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);
|
||||||
}
|
}
|
||||||
@ -1015,7 +991,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.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);
|
||||||
}
|
}
|
||||||
@ -1062,7 +1037,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.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);
|
||||||
}
|
}
|
||||||
@ -1099,7 +1073,6 @@ uint16_t APIConnection::try_send_camera_info(EntityBase *entity, APIConnection *
|
|||||||
bool is_single) {
|
bool is_single) {
|
||||||
auto *camera = static_cast<camera::Camera *>(entity);
|
auto *camera = static_cast<camera::Camera *>(entity);
|
||||||
ListEntitiesCameraResponse msg;
|
ListEntitiesCameraResponse msg;
|
||||||
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);
|
||||||
}
|
}
|
||||||
@ -1289,7 +1262,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.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,
|
||||||
is_single);
|
is_single);
|
||||||
@ -1344,7 +1316,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.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);
|
||||||
}
|
}
|
||||||
@ -1380,7 +1351,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.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);
|
||||||
}
|
}
|
||||||
|
@ -230,7 +230,6 @@ void ListEntitiesBinarySensorResponse::encode(ProtoWriteBuffer buffer) const {
|
|||||||
buffer.encode_string(1, this->object_id);
|
buffer.encode_string(1, this->object_id);
|
||||||
buffer.encode_fixed32(2, this->key);
|
buffer.encode_fixed32(2, this->key);
|
||||||
buffer.encode_string(3, this->name);
|
buffer.encode_string(3, this->name);
|
||||||
buffer.encode_string(4, this->unique_id);
|
|
||||||
buffer.encode_string(5, this->device_class);
|
buffer.encode_string(5, this->device_class);
|
||||||
buffer.encode_bool(6, this->is_status_binary_sensor);
|
buffer.encode_bool(6, this->is_status_binary_sensor);
|
||||||
buffer.encode_bool(7, this->disabled_by_default);
|
buffer.encode_bool(7, this->disabled_by_default);
|
||||||
@ -246,7 +245,6 @@ void ListEntitiesBinarySensorResponse::calculate_size(uint32_t &total_size) cons
|
|||||||
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
||||||
ProtoSize::add_fixed32_field(total_size, 1, this->key);
|
ProtoSize::add_fixed32_field(total_size, 1, this->key);
|
||||||
ProtoSize::add_string_field(total_size, 1, this->name);
|
ProtoSize::add_string_field(total_size, 1, this->name);
|
||||||
ProtoSize::add_string_field(total_size, 1, this->unique_id);
|
|
||||||
ProtoSize::add_string_field(total_size, 1, this->device_class);
|
ProtoSize::add_string_field(total_size, 1, this->device_class);
|
||||||
ProtoSize::add_bool_field(total_size, 1, this->is_status_binary_sensor);
|
ProtoSize::add_bool_field(total_size, 1, this->is_status_binary_sensor);
|
||||||
ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default);
|
ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default);
|
||||||
@ -276,7 +274,6 @@ void ListEntitiesCoverResponse::encode(ProtoWriteBuffer buffer) const {
|
|||||||
buffer.encode_string(1, this->object_id);
|
buffer.encode_string(1, this->object_id);
|
||||||
buffer.encode_fixed32(2, this->key);
|
buffer.encode_fixed32(2, this->key);
|
||||||
buffer.encode_string(3, this->name);
|
buffer.encode_string(3, this->name);
|
||||||
buffer.encode_string(4, this->unique_id);
|
|
||||||
buffer.encode_bool(5, this->assumed_state);
|
buffer.encode_bool(5, this->assumed_state);
|
||||||
buffer.encode_bool(6, this->supports_position);
|
buffer.encode_bool(6, this->supports_position);
|
||||||
buffer.encode_bool(7, this->supports_tilt);
|
buffer.encode_bool(7, this->supports_tilt);
|
||||||
@ -295,7 +292,6 @@ void ListEntitiesCoverResponse::calculate_size(uint32_t &total_size) const {
|
|||||||
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
||||||
ProtoSize::add_fixed32_field(total_size, 1, this->key);
|
ProtoSize::add_fixed32_field(total_size, 1, this->key);
|
||||||
ProtoSize::add_string_field(total_size, 1, this->name);
|
ProtoSize::add_string_field(total_size, 1, this->name);
|
||||||
ProtoSize::add_string_field(total_size, 1, this->unique_id);
|
|
||||||
ProtoSize::add_bool_field(total_size, 1, this->assumed_state);
|
ProtoSize::add_bool_field(total_size, 1, this->assumed_state);
|
||||||
ProtoSize::add_bool_field(total_size, 1, this->supports_position);
|
ProtoSize::add_bool_field(total_size, 1, this->supports_position);
|
||||||
ProtoSize::add_bool_field(total_size, 1, this->supports_tilt);
|
ProtoSize::add_bool_field(total_size, 1, this->supports_tilt);
|
||||||
@ -375,7 +371,6 @@ void ListEntitiesFanResponse::encode(ProtoWriteBuffer buffer) const {
|
|||||||
buffer.encode_string(1, this->object_id);
|
buffer.encode_string(1, this->object_id);
|
||||||
buffer.encode_fixed32(2, this->key);
|
buffer.encode_fixed32(2, this->key);
|
||||||
buffer.encode_string(3, this->name);
|
buffer.encode_string(3, this->name);
|
||||||
buffer.encode_string(4, this->unique_id);
|
|
||||||
buffer.encode_bool(5, this->supports_oscillation);
|
buffer.encode_bool(5, this->supports_oscillation);
|
||||||
buffer.encode_bool(6, this->supports_speed);
|
buffer.encode_bool(6, this->supports_speed);
|
||||||
buffer.encode_bool(7, this->supports_direction);
|
buffer.encode_bool(7, this->supports_direction);
|
||||||
@ -396,7 +391,6 @@ void ListEntitiesFanResponse::calculate_size(uint32_t &total_size) const {
|
|||||||
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
||||||
ProtoSize::add_fixed32_field(total_size, 1, this->key);
|
ProtoSize::add_fixed32_field(total_size, 1, this->key);
|
||||||
ProtoSize::add_string_field(total_size, 1, this->name);
|
ProtoSize::add_string_field(total_size, 1, this->name);
|
||||||
ProtoSize::add_string_field(total_size, 1, this->unique_id);
|
|
||||||
ProtoSize::add_bool_field(total_size, 1, this->supports_oscillation);
|
ProtoSize::add_bool_field(total_size, 1, this->supports_oscillation);
|
||||||
ProtoSize::add_bool_field(total_size, 1, this->supports_speed);
|
ProtoSize::add_bool_field(total_size, 1, this->supports_speed);
|
||||||
ProtoSize::add_bool_field(total_size, 1, this->supports_direction);
|
ProtoSize::add_bool_field(total_size, 1, this->supports_direction);
|
||||||
@ -508,7 +502,6 @@ void ListEntitiesLightResponse::encode(ProtoWriteBuffer buffer) const {
|
|||||||
buffer.encode_string(1, this->object_id);
|
buffer.encode_string(1, this->object_id);
|
||||||
buffer.encode_fixed32(2, this->key);
|
buffer.encode_fixed32(2, this->key);
|
||||||
buffer.encode_string(3, this->name);
|
buffer.encode_string(3, this->name);
|
||||||
buffer.encode_string(4, this->unique_id);
|
|
||||||
for (auto &it : this->supported_color_modes) {
|
for (auto &it : this->supported_color_modes) {
|
||||||
buffer.encode_uint32(12, static_cast<uint32_t>(it), true);
|
buffer.encode_uint32(12, static_cast<uint32_t>(it), true);
|
||||||
}
|
}
|
||||||
@ -534,7 +527,6 @@ void ListEntitiesLightResponse::calculate_size(uint32_t &total_size) const {
|
|||||||
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
||||||
ProtoSize::add_fixed32_field(total_size, 1, this->key);
|
ProtoSize::add_fixed32_field(total_size, 1, this->key);
|
||||||
ProtoSize::add_string_field(total_size, 1, this->name);
|
ProtoSize::add_string_field(total_size, 1, this->name);
|
||||||
ProtoSize::add_string_field(total_size, 1, this->unique_id);
|
|
||||||
if (!this->supported_color_modes.empty()) {
|
if (!this->supported_color_modes.empty()) {
|
||||||
for (const auto &it : this->supported_color_modes) {
|
for (const auto &it : this->supported_color_modes) {
|
||||||
ProtoSize::add_enum_field_repeated(total_size, 1, static_cast<uint32_t>(it));
|
ProtoSize::add_enum_field_repeated(total_size, 1, static_cast<uint32_t>(it));
|
||||||
@ -703,7 +695,6 @@ void ListEntitiesSensorResponse::encode(ProtoWriteBuffer buffer) const {
|
|||||||
buffer.encode_string(1, this->object_id);
|
buffer.encode_string(1, this->object_id);
|
||||||
buffer.encode_fixed32(2, this->key);
|
buffer.encode_fixed32(2, this->key);
|
||||||
buffer.encode_string(3, this->name);
|
buffer.encode_string(3, this->name);
|
||||||
buffer.encode_string(4, this->unique_id);
|
|
||||||
#ifdef USE_ENTITY_ICON
|
#ifdef USE_ENTITY_ICON
|
||||||
buffer.encode_string(5, this->icon);
|
buffer.encode_string(5, this->icon);
|
||||||
#endif
|
#endif
|
||||||
@ -721,7 +712,6 @@ void ListEntitiesSensorResponse::calculate_size(uint32_t &total_size) const {
|
|||||||
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
||||||
ProtoSize::add_fixed32_field(total_size, 1, this->key);
|
ProtoSize::add_fixed32_field(total_size, 1, this->key);
|
||||||
ProtoSize::add_string_field(total_size, 1, this->name);
|
ProtoSize::add_string_field(total_size, 1, this->name);
|
||||||
ProtoSize::add_string_field(total_size, 1, this->unique_id);
|
|
||||||
#ifdef USE_ENTITY_ICON
|
#ifdef USE_ENTITY_ICON
|
||||||
ProtoSize::add_string_field(total_size, 1, this->icon);
|
ProtoSize::add_string_field(total_size, 1, this->icon);
|
||||||
#endif
|
#endif
|
||||||
@ -753,7 +743,6 @@ void ListEntitiesSwitchResponse::encode(ProtoWriteBuffer buffer) const {
|
|||||||
buffer.encode_string(1, this->object_id);
|
buffer.encode_string(1, this->object_id);
|
||||||
buffer.encode_fixed32(2, this->key);
|
buffer.encode_fixed32(2, this->key);
|
||||||
buffer.encode_string(3, this->name);
|
buffer.encode_string(3, this->name);
|
||||||
buffer.encode_string(4, this->unique_id);
|
|
||||||
#ifdef USE_ENTITY_ICON
|
#ifdef USE_ENTITY_ICON
|
||||||
buffer.encode_string(5, this->icon);
|
buffer.encode_string(5, this->icon);
|
||||||
#endif
|
#endif
|
||||||
@ -769,7 +758,6 @@ void ListEntitiesSwitchResponse::calculate_size(uint32_t &total_size) const {
|
|||||||
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
||||||
ProtoSize::add_fixed32_field(total_size, 1, this->key);
|
ProtoSize::add_fixed32_field(total_size, 1, this->key);
|
||||||
ProtoSize::add_string_field(total_size, 1, this->name);
|
ProtoSize::add_string_field(total_size, 1, this->name);
|
||||||
ProtoSize::add_string_field(total_size, 1, this->unique_id);
|
|
||||||
#ifdef USE_ENTITY_ICON
|
#ifdef USE_ENTITY_ICON
|
||||||
ProtoSize::add_string_field(total_size, 1, this->icon);
|
ProtoSize::add_string_field(total_size, 1, this->icon);
|
||||||
#endif
|
#endif
|
||||||
@ -820,7 +808,6 @@ void ListEntitiesTextSensorResponse::encode(ProtoWriteBuffer buffer) const {
|
|||||||
buffer.encode_string(1, this->object_id);
|
buffer.encode_string(1, this->object_id);
|
||||||
buffer.encode_fixed32(2, this->key);
|
buffer.encode_fixed32(2, this->key);
|
||||||
buffer.encode_string(3, this->name);
|
buffer.encode_string(3, this->name);
|
||||||
buffer.encode_string(4, this->unique_id);
|
|
||||||
#ifdef USE_ENTITY_ICON
|
#ifdef USE_ENTITY_ICON
|
||||||
buffer.encode_string(5, this->icon);
|
buffer.encode_string(5, this->icon);
|
||||||
#endif
|
#endif
|
||||||
@ -835,7 +822,6 @@ void ListEntitiesTextSensorResponse::calculate_size(uint32_t &total_size) const
|
|||||||
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
||||||
ProtoSize::add_fixed32_field(total_size, 1, this->key);
|
ProtoSize::add_fixed32_field(total_size, 1, this->key);
|
||||||
ProtoSize::add_string_field(total_size, 1, this->name);
|
ProtoSize::add_string_field(total_size, 1, this->name);
|
||||||
ProtoSize::add_string_field(total_size, 1, this->unique_id);
|
|
||||||
#ifdef USE_ENTITY_ICON
|
#ifdef USE_ENTITY_ICON
|
||||||
ProtoSize::add_string_field(total_size, 1, this->icon);
|
ProtoSize::add_string_field(total_size, 1, this->icon);
|
||||||
#endif
|
#endif
|
||||||
@ -1139,7 +1125,6 @@ void ListEntitiesCameraResponse::encode(ProtoWriteBuffer buffer) const {
|
|||||||
buffer.encode_string(1, this->object_id);
|
buffer.encode_string(1, this->object_id);
|
||||||
buffer.encode_fixed32(2, this->key);
|
buffer.encode_fixed32(2, this->key);
|
||||||
buffer.encode_string(3, this->name);
|
buffer.encode_string(3, this->name);
|
||||||
buffer.encode_string(4, this->unique_id);
|
|
||||||
buffer.encode_bool(5, this->disabled_by_default);
|
buffer.encode_bool(5, this->disabled_by_default);
|
||||||
#ifdef USE_ENTITY_ICON
|
#ifdef USE_ENTITY_ICON
|
||||||
buffer.encode_string(6, this->icon);
|
buffer.encode_string(6, this->icon);
|
||||||
@ -1153,7 +1138,6 @@ void ListEntitiesCameraResponse::calculate_size(uint32_t &total_size) const {
|
|||||||
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
||||||
ProtoSize::add_fixed32_field(total_size, 1, this->key);
|
ProtoSize::add_fixed32_field(total_size, 1, this->key);
|
||||||
ProtoSize::add_string_field(total_size, 1, this->name);
|
ProtoSize::add_string_field(total_size, 1, this->name);
|
||||||
ProtoSize::add_string_field(total_size, 1, this->unique_id);
|
|
||||||
ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default);
|
ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default);
|
||||||
#ifdef USE_ENTITY_ICON
|
#ifdef USE_ENTITY_ICON
|
||||||
ProtoSize::add_string_field(total_size, 1, this->icon);
|
ProtoSize::add_string_field(total_size, 1, this->icon);
|
||||||
@ -1194,7 +1178,6 @@ void ListEntitiesClimateResponse::encode(ProtoWriteBuffer buffer) const {
|
|||||||
buffer.encode_string(1, this->object_id);
|
buffer.encode_string(1, this->object_id);
|
||||||
buffer.encode_fixed32(2, this->key);
|
buffer.encode_fixed32(2, this->key);
|
||||||
buffer.encode_string(3, this->name);
|
buffer.encode_string(3, this->name);
|
||||||
buffer.encode_string(4, this->unique_id);
|
|
||||||
buffer.encode_bool(5, this->supports_current_temperature);
|
buffer.encode_bool(5, this->supports_current_temperature);
|
||||||
buffer.encode_bool(6, this->supports_two_point_target_temperature);
|
buffer.encode_bool(6, this->supports_two_point_target_temperature);
|
||||||
for (auto &it : this->supported_modes) {
|
for (auto &it : this->supported_modes) {
|
||||||
@ -1238,7 +1221,6 @@ void ListEntitiesClimateResponse::calculate_size(uint32_t &total_size) const {
|
|||||||
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
||||||
ProtoSize::add_fixed32_field(total_size, 1, this->key);
|
ProtoSize::add_fixed32_field(total_size, 1, this->key);
|
||||||
ProtoSize::add_string_field(total_size, 1, this->name);
|
ProtoSize::add_string_field(total_size, 1, this->name);
|
||||||
ProtoSize::add_string_field(total_size, 1, this->unique_id);
|
|
||||||
ProtoSize::add_bool_field(total_size, 1, this->supports_current_temperature);
|
ProtoSize::add_bool_field(total_size, 1, this->supports_current_temperature);
|
||||||
ProtoSize::add_bool_field(total_size, 1, this->supports_two_point_target_temperature);
|
ProtoSize::add_bool_field(total_size, 1, this->supports_two_point_target_temperature);
|
||||||
if (!this->supported_modes.empty()) {
|
if (!this->supported_modes.empty()) {
|
||||||
@ -1429,7 +1411,6 @@ void ListEntitiesNumberResponse::encode(ProtoWriteBuffer buffer) const {
|
|||||||
buffer.encode_string(1, this->object_id);
|
buffer.encode_string(1, this->object_id);
|
||||||
buffer.encode_fixed32(2, this->key);
|
buffer.encode_fixed32(2, this->key);
|
||||||
buffer.encode_string(3, this->name);
|
buffer.encode_string(3, this->name);
|
||||||
buffer.encode_string(4, this->unique_id);
|
|
||||||
#ifdef USE_ENTITY_ICON
|
#ifdef USE_ENTITY_ICON
|
||||||
buffer.encode_string(5, this->icon);
|
buffer.encode_string(5, this->icon);
|
||||||
#endif
|
#endif
|
||||||
@ -1447,7 +1428,6 @@ void ListEntitiesNumberResponse::calculate_size(uint32_t &total_size) const {
|
|||||||
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
||||||
ProtoSize::add_fixed32_field(total_size, 1, this->key);
|
ProtoSize::add_fixed32_field(total_size, 1, this->key);
|
||||||
ProtoSize::add_string_field(total_size, 1, this->name);
|
ProtoSize::add_string_field(total_size, 1, this->name);
|
||||||
ProtoSize::add_string_field(total_size, 1, this->unique_id);
|
|
||||||
#ifdef USE_ENTITY_ICON
|
#ifdef USE_ENTITY_ICON
|
||||||
ProtoSize::add_string_field(total_size, 1, this->icon);
|
ProtoSize::add_string_field(total_size, 1, this->icon);
|
||||||
#endif
|
#endif
|
||||||
@ -1502,7 +1482,6 @@ void ListEntitiesSelectResponse::encode(ProtoWriteBuffer buffer) const {
|
|||||||
buffer.encode_string(1, this->object_id);
|
buffer.encode_string(1, this->object_id);
|
||||||
buffer.encode_fixed32(2, this->key);
|
buffer.encode_fixed32(2, this->key);
|
||||||
buffer.encode_string(3, this->name);
|
buffer.encode_string(3, this->name);
|
||||||
buffer.encode_string(4, this->unique_id);
|
|
||||||
#ifdef USE_ENTITY_ICON
|
#ifdef USE_ENTITY_ICON
|
||||||
buffer.encode_string(5, this->icon);
|
buffer.encode_string(5, this->icon);
|
||||||
#endif
|
#endif
|
||||||
@ -1519,7 +1498,6 @@ void ListEntitiesSelectResponse::calculate_size(uint32_t &total_size) const {
|
|||||||
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
||||||
ProtoSize::add_fixed32_field(total_size, 1, this->key);
|
ProtoSize::add_fixed32_field(total_size, 1, this->key);
|
||||||
ProtoSize::add_string_field(total_size, 1, this->name);
|
ProtoSize::add_string_field(total_size, 1, this->name);
|
||||||
ProtoSize::add_string_field(total_size, 1, this->unique_id);
|
|
||||||
#ifdef USE_ENTITY_ICON
|
#ifdef USE_ENTITY_ICON
|
||||||
ProtoSize::add_string_field(total_size, 1, this->icon);
|
ProtoSize::add_string_field(total_size, 1, this->icon);
|
||||||
#endif
|
#endif
|
||||||
@ -1582,7 +1560,6 @@ void ListEntitiesSirenResponse::encode(ProtoWriteBuffer buffer) const {
|
|||||||
buffer.encode_string(1, this->object_id);
|
buffer.encode_string(1, this->object_id);
|
||||||
buffer.encode_fixed32(2, this->key);
|
buffer.encode_fixed32(2, this->key);
|
||||||
buffer.encode_string(3, this->name);
|
buffer.encode_string(3, this->name);
|
||||||
buffer.encode_string(4, this->unique_id);
|
|
||||||
#ifdef USE_ENTITY_ICON
|
#ifdef USE_ENTITY_ICON
|
||||||
buffer.encode_string(5, this->icon);
|
buffer.encode_string(5, this->icon);
|
||||||
#endif
|
#endif
|
||||||
@ -1601,7 +1578,6 @@ void ListEntitiesSirenResponse::calculate_size(uint32_t &total_size) const {
|
|||||||
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
||||||
ProtoSize::add_fixed32_field(total_size, 1, this->key);
|
ProtoSize::add_fixed32_field(total_size, 1, this->key);
|
||||||
ProtoSize::add_string_field(total_size, 1, this->name);
|
ProtoSize::add_string_field(total_size, 1, this->name);
|
||||||
ProtoSize::add_string_field(total_size, 1, this->unique_id);
|
|
||||||
#ifdef USE_ENTITY_ICON
|
#ifdef USE_ENTITY_ICON
|
||||||
ProtoSize::add_string_field(total_size, 1, this->icon);
|
ProtoSize::add_string_field(total_size, 1, this->icon);
|
||||||
#endif
|
#endif
|
||||||
@ -1687,7 +1663,6 @@ void ListEntitiesLockResponse::encode(ProtoWriteBuffer buffer) const {
|
|||||||
buffer.encode_string(1, this->object_id);
|
buffer.encode_string(1, this->object_id);
|
||||||
buffer.encode_fixed32(2, this->key);
|
buffer.encode_fixed32(2, this->key);
|
||||||
buffer.encode_string(3, this->name);
|
buffer.encode_string(3, this->name);
|
||||||
buffer.encode_string(4, this->unique_id);
|
|
||||||
#ifdef USE_ENTITY_ICON
|
#ifdef USE_ENTITY_ICON
|
||||||
buffer.encode_string(5, this->icon);
|
buffer.encode_string(5, this->icon);
|
||||||
#endif
|
#endif
|
||||||
@ -1705,7 +1680,6 @@ void ListEntitiesLockResponse::calculate_size(uint32_t &total_size) const {
|
|||||||
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
||||||
ProtoSize::add_fixed32_field(total_size, 1, this->key);
|
ProtoSize::add_fixed32_field(total_size, 1, this->key);
|
||||||
ProtoSize::add_string_field(total_size, 1, this->name);
|
ProtoSize::add_string_field(total_size, 1, this->name);
|
||||||
ProtoSize::add_string_field(total_size, 1, this->unique_id);
|
|
||||||
#ifdef USE_ENTITY_ICON
|
#ifdef USE_ENTITY_ICON
|
||||||
ProtoSize::add_string_field(total_size, 1, this->icon);
|
ProtoSize::add_string_field(total_size, 1, this->icon);
|
||||||
#endif
|
#endif
|
||||||
@ -1771,7 +1745,6 @@ void ListEntitiesButtonResponse::encode(ProtoWriteBuffer buffer) const {
|
|||||||
buffer.encode_string(1, this->object_id);
|
buffer.encode_string(1, this->object_id);
|
||||||
buffer.encode_fixed32(2, this->key);
|
buffer.encode_fixed32(2, this->key);
|
||||||
buffer.encode_string(3, this->name);
|
buffer.encode_string(3, this->name);
|
||||||
buffer.encode_string(4, this->unique_id);
|
|
||||||
#ifdef USE_ENTITY_ICON
|
#ifdef USE_ENTITY_ICON
|
||||||
buffer.encode_string(5, this->icon);
|
buffer.encode_string(5, this->icon);
|
||||||
#endif
|
#endif
|
||||||
@ -1786,7 +1759,6 @@ void ListEntitiesButtonResponse::calculate_size(uint32_t &total_size) const {
|
|||||||
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
||||||
ProtoSize::add_fixed32_field(total_size, 1, this->key);
|
ProtoSize::add_fixed32_field(total_size, 1, this->key);
|
||||||
ProtoSize::add_string_field(total_size, 1, this->name);
|
ProtoSize::add_string_field(total_size, 1, this->name);
|
||||||
ProtoSize::add_string_field(total_size, 1, this->unique_id);
|
|
||||||
#ifdef USE_ENTITY_ICON
|
#ifdef USE_ENTITY_ICON
|
||||||
ProtoSize::add_string_field(total_size, 1, this->icon);
|
ProtoSize::add_string_field(total_size, 1, this->icon);
|
||||||
#endif
|
#endif
|
||||||
@ -1866,7 +1838,6 @@ void ListEntitiesMediaPlayerResponse::encode(ProtoWriteBuffer buffer) const {
|
|||||||
buffer.encode_string(1, this->object_id);
|
buffer.encode_string(1, this->object_id);
|
||||||
buffer.encode_fixed32(2, this->key);
|
buffer.encode_fixed32(2, this->key);
|
||||||
buffer.encode_string(3, this->name);
|
buffer.encode_string(3, this->name);
|
||||||
buffer.encode_string(4, this->unique_id);
|
|
||||||
#ifdef USE_ENTITY_ICON
|
#ifdef USE_ENTITY_ICON
|
||||||
buffer.encode_string(5, this->icon);
|
buffer.encode_string(5, this->icon);
|
||||||
#endif
|
#endif
|
||||||
@ -1884,7 +1855,6 @@ void ListEntitiesMediaPlayerResponse::calculate_size(uint32_t &total_size) const
|
|||||||
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
||||||
ProtoSize::add_fixed32_field(total_size, 1, this->key);
|
ProtoSize::add_fixed32_field(total_size, 1, this->key);
|
||||||
ProtoSize::add_string_field(total_size, 1, this->name);
|
ProtoSize::add_string_field(total_size, 1, this->name);
|
||||||
ProtoSize::add_string_field(total_size, 1, this->unique_id);
|
|
||||||
#ifdef USE_ENTITY_ICON
|
#ifdef USE_ENTITY_ICON
|
||||||
ProtoSize::add_string_field(total_size, 1, this->icon);
|
ProtoSize::add_string_field(total_size, 1, this->icon);
|
||||||
#endif
|
#endif
|
||||||
@ -2735,7 +2705,6 @@ void ListEntitiesAlarmControlPanelResponse::encode(ProtoWriteBuffer buffer) cons
|
|||||||
buffer.encode_string(1, this->object_id);
|
buffer.encode_string(1, this->object_id);
|
||||||
buffer.encode_fixed32(2, this->key);
|
buffer.encode_fixed32(2, this->key);
|
||||||
buffer.encode_string(3, this->name);
|
buffer.encode_string(3, this->name);
|
||||||
buffer.encode_string(4, this->unique_id);
|
|
||||||
#ifdef USE_ENTITY_ICON
|
#ifdef USE_ENTITY_ICON
|
||||||
buffer.encode_string(5, this->icon);
|
buffer.encode_string(5, this->icon);
|
||||||
#endif
|
#endif
|
||||||
@ -2752,7 +2721,6 @@ void ListEntitiesAlarmControlPanelResponse::calculate_size(uint32_t &total_size)
|
|||||||
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
||||||
ProtoSize::add_fixed32_field(total_size, 1, this->key);
|
ProtoSize::add_fixed32_field(total_size, 1, this->key);
|
||||||
ProtoSize::add_string_field(total_size, 1, this->name);
|
ProtoSize::add_string_field(total_size, 1, this->name);
|
||||||
ProtoSize::add_string_field(total_size, 1, this->unique_id);
|
|
||||||
#ifdef USE_ENTITY_ICON
|
#ifdef USE_ENTITY_ICON
|
||||||
ProtoSize::add_string_field(total_size, 1, this->icon);
|
ProtoSize::add_string_field(total_size, 1, this->icon);
|
||||||
#endif
|
#endif
|
||||||
@ -2814,7 +2782,6 @@ void ListEntitiesTextResponse::encode(ProtoWriteBuffer buffer) const {
|
|||||||
buffer.encode_string(1, this->object_id);
|
buffer.encode_string(1, this->object_id);
|
||||||
buffer.encode_fixed32(2, this->key);
|
buffer.encode_fixed32(2, this->key);
|
||||||
buffer.encode_string(3, this->name);
|
buffer.encode_string(3, this->name);
|
||||||
buffer.encode_string(4, this->unique_id);
|
|
||||||
#ifdef USE_ENTITY_ICON
|
#ifdef USE_ENTITY_ICON
|
||||||
buffer.encode_string(5, this->icon);
|
buffer.encode_string(5, this->icon);
|
||||||
#endif
|
#endif
|
||||||
@ -2832,7 +2799,6 @@ void ListEntitiesTextResponse::calculate_size(uint32_t &total_size) const {
|
|||||||
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
||||||
ProtoSize::add_fixed32_field(total_size, 1, this->key);
|
ProtoSize::add_fixed32_field(total_size, 1, this->key);
|
||||||
ProtoSize::add_string_field(total_size, 1, this->name);
|
ProtoSize::add_string_field(total_size, 1, this->name);
|
||||||
ProtoSize::add_string_field(total_size, 1, this->unique_id);
|
|
||||||
#ifdef USE_ENTITY_ICON
|
#ifdef USE_ENTITY_ICON
|
||||||
ProtoSize::add_string_field(total_size, 1, this->icon);
|
ProtoSize::add_string_field(total_size, 1, this->icon);
|
||||||
#endif
|
#endif
|
||||||
@ -2894,7 +2860,6 @@ void ListEntitiesDateResponse::encode(ProtoWriteBuffer buffer) const {
|
|||||||
buffer.encode_string(1, this->object_id);
|
buffer.encode_string(1, this->object_id);
|
||||||
buffer.encode_fixed32(2, this->key);
|
buffer.encode_fixed32(2, this->key);
|
||||||
buffer.encode_string(3, this->name);
|
buffer.encode_string(3, this->name);
|
||||||
buffer.encode_string(4, this->unique_id);
|
|
||||||
#ifdef USE_ENTITY_ICON
|
#ifdef USE_ENTITY_ICON
|
||||||
buffer.encode_string(5, this->icon);
|
buffer.encode_string(5, this->icon);
|
||||||
#endif
|
#endif
|
||||||
@ -2908,7 +2873,6 @@ void ListEntitiesDateResponse::calculate_size(uint32_t &total_size) const {
|
|||||||
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
||||||
ProtoSize::add_fixed32_field(total_size, 1, this->key);
|
ProtoSize::add_fixed32_field(total_size, 1, this->key);
|
||||||
ProtoSize::add_string_field(total_size, 1, this->name);
|
ProtoSize::add_string_field(total_size, 1, this->name);
|
||||||
ProtoSize::add_string_field(total_size, 1, this->unique_id);
|
|
||||||
#ifdef USE_ENTITY_ICON
|
#ifdef USE_ENTITY_ICON
|
||||||
ProtoSize::add_string_field(total_size, 1, this->icon);
|
ProtoSize::add_string_field(total_size, 1, this->icon);
|
||||||
#endif
|
#endif
|
||||||
@ -2969,7 +2933,6 @@ void ListEntitiesTimeResponse::encode(ProtoWriteBuffer buffer) const {
|
|||||||
buffer.encode_string(1, this->object_id);
|
buffer.encode_string(1, this->object_id);
|
||||||
buffer.encode_fixed32(2, this->key);
|
buffer.encode_fixed32(2, this->key);
|
||||||
buffer.encode_string(3, this->name);
|
buffer.encode_string(3, this->name);
|
||||||
buffer.encode_string(4, this->unique_id);
|
|
||||||
#ifdef USE_ENTITY_ICON
|
#ifdef USE_ENTITY_ICON
|
||||||
buffer.encode_string(5, this->icon);
|
buffer.encode_string(5, this->icon);
|
||||||
#endif
|
#endif
|
||||||
@ -2983,7 +2946,6 @@ void ListEntitiesTimeResponse::calculate_size(uint32_t &total_size) const {
|
|||||||
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
||||||
ProtoSize::add_fixed32_field(total_size, 1, this->key);
|
ProtoSize::add_fixed32_field(total_size, 1, this->key);
|
||||||
ProtoSize::add_string_field(total_size, 1, this->name);
|
ProtoSize::add_string_field(total_size, 1, this->name);
|
||||||
ProtoSize::add_string_field(total_size, 1, this->unique_id);
|
|
||||||
#ifdef USE_ENTITY_ICON
|
#ifdef USE_ENTITY_ICON
|
||||||
ProtoSize::add_string_field(total_size, 1, this->icon);
|
ProtoSize::add_string_field(total_size, 1, this->icon);
|
||||||
#endif
|
#endif
|
||||||
@ -3044,7 +3006,6 @@ void ListEntitiesEventResponse::encode(ProtoWriteBuffer buffer) const {
|
|||||||
buffer.encode_string(1, this->object_id);
|
buffer.encode_string(1, this->object_id);
|
||||||
buffer.encode_fixed32(2, this->key);
|
buffer.encode_fixed32(2, this->key);
|
||||||
buffer.encode_string(3, this->name);
|
buffer.encode_string(3, this->name);
|
||||||
buffer.encode_string(4, this->unique_id);
|
|
||||||
#ifdef USE_ENTITY_ICON
|
#ifdef USE_ENTITY_ICON
|
||||||
buffer.encode_string(5, this->icon);
|
buffer.encode_string(5, this->icon);
|
||||||
#endif
|
#endif
|
||||||
@ -3062,7 +3023,6 @@ void ListEntitiesEventResponse::calculate_size(uint32_t &total_size) const {
|
|||||||
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
||||||
ProtoSize::add_fixed32_field(total_size, 1, this->key);
|
ProtoSize::add_fixed32_field(total_size, 1, this->key);
|
||||||
ProtoSize::add_string_field(total_size, 1, this->name);
|
ProtoSize::add_string_field(total_size, 1, this->name);
|
||||||
ProtoSize::add_string_field(total_size, 1, this->unique_id);
|
|
||||||
#ifdef USE_ENTITY_ICON
|
#ifdef USE_ENTITY_ICON
|
||||||
ProtoSize::add_string_field(total_size, 1, this->icon);
|
ProtoSize::add_string_field(total_size, 1, this->icon);
|
||||||
#endif
|
#endif
|
||||||
@ -3094,7 +3054,6 @@ void ListEntitiesValveResponse::encode(ProtoWriteBuffer buffer) const {
|
|||||||
buffer.encode_string(1, this->object_id);
|
buffer.encode_string(1, this->object_id);
|
||||||
buffer.encode_fixed32(2, this->key);
|
buffer.encode_fixed32(2, this->key);
|
||||||
buffer.encode_string(3, this->name);
|
buffer.encode_string(3, this->name);
|
||||||
buffer.encode_string(4, this->unique_id);
|
|
||||||
#ifdef USE_ENTITY_ICON
|
#ifdef USE_ENTITY_ICON
|
||||||
buffer.encode_string(5, this->icon);
|
buffer.encode_string(5, this->icon);
|
||||||
#endif
|
#endif
|
||||||
@ -3112,7 +3071,6 @@ void ListEntitiesValveResponse::calculate_size(uint32_t &total_size) const {
|
|||||||
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
||||||
ProtoSize::add_fixed32_field(total_size, 1, this->key);
|
ProtoSize::add_fixed32_field(total_size, 1, this->key);
|
||||||
ProtoSize::add_string_field(total_size, 1, this->name);
|
ProtoSize::add_string_field(total_size, 1, this->name);
|
||||||
ProtoSize::add_string_field(total_size, 1, this->unique_id);
|
|
||||||
#ifdef USE_ENTITY_ICON
|
#ifdef USE_ENTITY_ICON
|
||||||
ProtoSize::add_string_field(total_size, 1, this->icon);
|
ProtoSize::add_string_field(total_size, 1, this->icon);
|
||||||
#endif
|
#endif
|
||||||
@ -3173,7 +3131,6 @@ void ListEntitiesDateTimeResponse::encode(ProtoWriteBuffer buffer) const {
|
|||||||
buffer.encode_string(1, this->object_id);
|
buffer.encode_string(1, this->object_id);
|
||||||
buffer.encode_fixed32(2, this->key);
|
buffer.encode_fixed32(2, this->key);
|
||||||
buffer.encode_string(3, this->name);
|
buffer.encode_string(3, this->name);
|
||||||
buffer.encode_string(4, this->unique_id);
|
|
||||||
#ifdef USE_ENTITY_ICON
|
#ifdef USE_ENTITY_ICON
|
||||||
buffer.encode_string(5, this->icon);
|
buffer.encode_string(5, this->icon);
|
||||||
#endif
|
#endif
|
||||||
@ -3187,7 +3144,6 @@ void ListEntitiesDateTimeResponse::calculate_size(uint32_t &total_size) const {
|
|||||||
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
||||||
ProtoSize::add_fixed32_field(total_size, 1, this->key);
|
ProtoSize::add_fixed32_field(total_size, 1, this->key);
|
||||||
ProtoSize::add_string_field(total_size, 1, this->name);
|
ProtoSize::add_string_field(total_size, 1, this->name);
|
||||||
ProtoSize::add_string_field(total_size, 1, this->unique_id);
|
|
||||||
#ifdef USE_ENTITY_ICON
|
#ifdef USE_ENTITY_ICON
|
||||||
ProtoSize::add_string_field(total_size, 1, this->icon);
|
ProtoSize::add_string_field(total_size, 1, this->icon);
|
||||||
#endif
|
#endif
|
||||||
@ -3238,7 +3194,6 @@ void ListEntitiesUpdateResponse::encode(ProtoWriteBuffer buffer) const {
|
|||||||
buffer.encode_string(1, this->object_id);
|
buffer.encode_string(1, this->object_id);
|
||||||
buffer.encode_fixed32(2, this->key);
|
buffer.encode_fixed32(2, this->key);
|
||||||
buffer.encode_string(3, this->name);
|
buffer.encode_string(3, this->name);
|
||||||
buffer.encode_string(4, this->unique_id);
|
|
||||||
#ifdef USE_ENTITY_ICON
|
#ifdef USE_ENTITY_ICON
|
||||||
buffer.encode_string(5, this->icon);
|
buffer.encode_string(5, this->icon);
|
||||||
#endif
|
#endif
|
||||||
@ -3253,7 +3208,6 @@ void ListEntitiesUpdateResponse::calculate_size(uint32_t &total_size) const {
|
|||||||
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
||||||
ProtoSize::add_fixed32_field(total_size, 1, this->key);
|
ProtoSize::add_fixed32_field(total_size, 1, this->key);
|
||||||
ProtoSize::add_string_field(total_size, 1, this->name);
|
ProtoSize::add_string_field(total_size, 1, this->name);
|
||||||
ProtoSize::add_string_field(total_size, 1, this->unique_id);
|
|
||||||
#ifdef USE_ENTITY_ICON
|
#ifdef USE_ENTITY_ICON
|
||||||
ProtoSize::add_string_field(total_size, 1, this->icon);
|
ProtoSize::add_string_field(total_size, 1, this->icon);
|
||||||
#endif
|
#endif
|
||||||
|
@ -291,7 +291,6 @@ class InfoResponseProtoMessage : public ProtoMessage {
|
|||||||
std::string object_id{};
|
std::string object_id{};
|
||||||
uint32_t key{0};
|
uint32_t key{0};
|
||||||
std::string name{};
|
std::string name{};
|
||||||
std::string unique_id{};
|
|
||||||
bool disabled_by_default{false};
|
bool disabled_by_default{false};
|
||||||
std::string icon{};
|
std::string icon{};
|
||||||
enums::EntityCategory entity_category{};
|
enums::EntityCategory entity_category{};
|
||||||
@ -587,7 +586,7 @@ class SubscribeStatesRequest : public ProtoMessage {
|
|||||||
class ListEntitiesBinarySensorResponse : public InfoResponseProtoMessage {
|
class ListEntitiesBinarySensorResponse : public InfoResponseProtoMessage {
|
||||||
public:
|
public:
|
||||||
static constexpr uint8_t MESSAGE_TYPE = 12;
|
static constexpr uint8_t MESSAGE_TYPE = 12;
|
||||||
static constexpr uint8_t ESTIMATED_SIZE = 60;
|
static constexpr uint8_t ESTIMATED_SIZE = 51;
|
||||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||||
const char *message_name() const override { return "list_entities_binary_sensor_response"; }
|
const char *message_name() const override { return "list_entities_binary_sensor_response"; }
|
||||||
#endif
|
#endif
|
||||||
@ -623,7 +622,7 @@ class BinarySensorStateResponse : public StateResponseProtoMessage {
|
|||||||
class ListEntitiesCoverResponse : public InfoResponseProtoMessage {
|
class ListEntitiesCoverResponse : public InfoResponseProtoMessage {
|
||||||
public:
|
public:
|
||||||
static constexpr uint8_t MESSAGE_TYPE = 13;
|
static constexpr uint8_t MESSAGE_TYPE = 13;
|
||||||
static constexpr uint8_t ESTIMATED_SIZE = 66;
|
static constexpr uint8_t ESTIMATED_SIZE = 57;
|
||||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||||
const char *message_name() const override { return "list_entities_cover_response"; }
|
const char *message_name() const override { return "list_entities_cover_response"; }
|
||||||
#endif
|
#endif
|
||||||
@ -686,7 +685,7 @@ class CoverCommandRequest : public CommandProtoMessage {
|
|||||||
class ListEntitiesFanResponse : public InfoResponseProtoMessage {
|
class ListEntitiesFanResponse : public InfoResponseProtoMessage {
|
||||||
public:
|
public:
|
||||||
static constexpr uint8_t MESSAGE_TYPE = 14;
|
static constexpr uint8_t MESSAGE_TYPE = 14;
|
||||||
static constexpr uint8_t ESTIMATED_SIZE = 77;
|
static constexpr uint8_t ESTIMATED_SIZE = 68;
|
||||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||||
const char *message_name() const override { return "list_entities_fan_response"; }
|
const char *message_name() const override { return "list_entities_fan_response"; }
|
||||||
#endif
|
#endif
|
||||||
@ -757,7 +756,7 @@ class FanCommandRequest : public CommandProtoMessage {
|
|||||||
class ListEntitiesLightResponse : public InfoResponseProtoMessage {
|
class ListEntitiesLightResponse : public InfoResponseProtoMessage {
|
||||||
public:
|
public:
|
||||||
static constexpr uint8_t MESSAGE_TYPE = 15;
|
static constexpr uint8_t MESSAGE_TYPE = 15;
|
||||||
static constexpr uint8_t ESTIMATED_SIZE = 90;
|
static constexpr uint8_t ESTIMATED_SIZE = 81;
|
||||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||||
const char *message_name() const override { return "list_entities_light_response"; }
|
const char *message_name() const override { return "list_entities_light_response"; }
|
||||||
#endif
|
#endif
|
||||||
@ -851,7 +850,7 @@ class LightCommandRequest : public CommandProtoMessage {
|
|||||||
class ListEntitiesSensorResponse : public InfoResponseProtoMessage {
|
class ListEntitiesSensorResponse : public InfoResponseProtoMessage {
|
||||||
public:
|
public:
|
||||||
static constexpr uint8_t MESSAGE_TYPE = 16;
|
static constexpr uint8_t MESSAGE_TYPE = 16;
|
||||||
static constexpr uint8_t ESTIMATED_SIZE = 77;
|
static constexpr uint8_t ESTIMATED_SIZE = 68;
|
||||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||||
const char *message_name() const override { return "list_entities_sensor_response"; }
|
const char *message_name() const override { return "list_entities_sensor_response"; }
|
||||||
#endif
|
#endif
|
||||||
@ -891,7 +890,7 @@ class SensorStateResponse : public StateResponseProtoMessage {
|
|||||||
class ListEntitiesSwitchResponse : public InfoResponseProtoMessage {
|
class ListEntitiesSwitchResponse : public InfoResponseProtoMessage {
|
||||||
public:
|
public:
|
||||||
static constexpr uint8_t MESSAGE_TYPE = 17;
|
static constexpr uint8_t MESSAGE_TYPE = 17;
|
||||||
static constexpr uint8_t ESTIMATED_SIZE = 60;
|
static constexpr uint8_t ESTIMATED_SIZE = 51;
|
||||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||||
const char *message_name() const override { return "list_entities_switch_response"; }
|
const char *message_name() const override { return "list_entities_switch_response"; }
|
||||||
#endif
|
#endif
|
||||||
@ -942,7 +941,7 @@ class SwitchCommandRequest : public CommandProtoMessage {
|
|||||||
class ListEntitiesTextSensorResponse : public InfoResponseProtoMessage {
|
class ListEntitiesTextSensorResponse : public InfoResponseProtoMessage {
|
||||||
public:
|
public:
|
||||||
static constexpr uint8_t MESSAGE_TYPE = 18;
|
static constexpr uint8_t MESSAGE_TYPE = 18;
|
||||||
static constexpr uint8_t ESTIMATED_SIZE = 58;
|
static constexpr uint8_t ESTIMATED_SIZE = 49;
|
||||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||||
const char *message_name() const override { return "list_entities_text_sensor_response"; }
|
const char *message_name() const override { return "list_entities_text_sensor_response"; }
|
||||||
#endif
|
#endif
|
||||||
@ -1241,7 +1240,7 @@ class ExecuteServiceRequest : public ProtoMessage {
|
|||||||
class ListEntitiesCameraResponse : public InfoResponseProtoMessage {
|
class ListEntitiesCameraResponse : public InfoResponseProtoMessage {
|
||||||
public:
|
public:
|
||||||
static constexpr uint8_t MESSAGE_TYPE = 43;
|
static constexpr uint8_t MESSAGE_TYPE = 43;
|
||||||
static constexpr uint8_t ESTIMATED_SIZE = 49;
|
static constexpr uint8_t ESTIMATED_SIZE = 40;
|
||||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||||
const char *message_name() const override { return "list_entities_camera_response"; }
|
const char *message_name() const override { return "list_entities_camera_response"; }
|
||||||
#endif
|
#endif
|
||||||
@ -1291,7 +1290,7 @@ class CameraImageRequest : public ProtoMessage {
|
|||||||
class ListEntitiesClimateResponse : public InfoResponseProtoMessage {
|
class ListEntitiesClimateResponse : public InfoResponseProtoMessage {
|
||||||
public:
|
public:
|
||||||
static constexpr uint8_t MESSAGE_TYPE = 46;
|
static constexpr uint8_t MESSAGE_TYPE = 46;
|
||||||
static constexpr uint8_t ESTIMATED_SIZE = 156;
|
static constexpr uint8_t ESTIMATED_SIZE = 147;
|
||||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||||
const char *message_name() const override { return "list_entities_climate_response"; }
|
const char *message_name() const override { return "list_entities_climate_response"; }
|
||||||
#endif
|
#endif
|
||||||
@ -1393,7 +1392,7 @@ class ClimateCommandRequest : public CommandProtoMessage {
|
|||||||
class ListEntitiesNumberResponse : public InfoResponseProtoMessage {
|
class ListEntitiesNumberResponse : public InfoResponseProtoMessage {
|
||||||
public:
|
public:
|
||||||
static constexpr uint8_t MESSAGE_TYPE = 49;
|
static constexpr uint8_t MESSAGE_TYPE = 49;
|
||||||
static constexpr uint8_t ESTIMATED_SIZE = 84;
|
static constexpr uint8_t ESTIMATED_SIZE = 75;
|
||||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||||
const char *message_name() const override { return "list_entities_number_response"; }
|
const char *message_name() const override { return "list_entities_number_response"; }
|
||||||
#endif
|
#endif
|
||||||
@ -1449,7 +1448,7 @@ class NumberCommandRequest : public CommandProtoMessage {
|
|||||||
class ListEntitiesSelectResponse : public InfoResponseProtoMessage {
|
class ListEntitiesSelectResponse : public InfoResponseProtoMessage {
|
||||||
public:
|
public:
|
||||||
static constexpr uint8_t MESSAGE_TYPE = 52;
|
static constexpr uint8_t MESSAGE_TYPE = 52;
|
||||||
static constexpr uint8_t ESTIMATED_SIZE = 67;
|
static constexpr uint8_t ESTIMATED_SIZE = 58;
|
||||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||||
const char *message_name() const override { return "list_entities_select_response"; }
|
const char *message_name() const override { return "list_entities_select_response"; }
|
||||||
#endif
|
#endif
|
||||||
@ -1501,7 +1500,7 @@ class SelectCommandRequest : public CommandProtoMessage {
|
|||||||
class ListEntitiesSirenResponse : public InfoResponseProtoMessage {
|
class ListEntitiesSirenResponse : public InfoResponseProtoMessage {
|
||||||
public:
|
public:
|
||||||
static constexpr uint8_t MESSAGE_TYPE = 55;
|
static constexpr uint8_t MESSAGE_TYPE = 55;
|
||||||
static constexpr uint8_t ESTIMATED_SIZE = 71;
|
static constexpr uint8_t ESTIMATED_SIZE = 62;
|
||||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||||
const char *message_name() const override { return "list_entities_siren_response"; }
|
const char *message_name() const override { return "list_entities_siren_response"; }
|
||||||
#endif
|
#endif
|
||||||
@ -1561,7 +1560,7 @@ class SirenCommandRequest : public CommandProtoMessage {
|
|||||||
class ListEntitiesLockResponse : public InfoResponseProtoMessage {
|
class ListEntitiesLockResponse : public InfoResponseProtoMessage {
|
||||||
public:
|
public:
|
||||||
static constexpr uint8_t MESSAGE_TYPE = 58;
|
static constexpr uint8_t MESSAGE_TYPE = 58;
|
||||||
static constexpr uint8_t ESTIMATED_SIZE = 64;
|
static constexpr uint8_t ESTIMATED_SIZE = 55;
|
||||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||||
const char *message_name() const override { return "list_entities_lock_response"; }
|
const char *message_name() const override { return "list_entities_lock_response"; }
|
||||||
#endif
|
#endif
|
||||||
@ -1617,7 +1616,7 @@ class LockCommandRequest : public CommandProtoMessage {
|
|||||||
class ListEntitiesButtonResponse : public InfoResponseProtoMessage {
|
class ListEntitiesButtonResponse : public InfoResponseProtoMessage {
|
||||||
public:
|
public:
|
||||||
static constexpr uint8_t MESSAGE_TYPE = 61;
|
static constexpr uint8_t MESSAGE_TYPE = 61;
|
||||||
static constexpr uint8_t ESTIMATED_SIZE = 58;
|
static constexpr uint8_t ESTIMATED_SIZE = 49;
|
||||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||||
const char *message_name() const override { return "list_entities_button_response"; }
|
const char *message_name() const override { return "list_entities_button_response"; }
|
||||||
#endif
|
#endif
|
||||||
@ -1667,7 +1666,7 @@ class MediaPlayerSupportedFormat : public ProtoMessage {
|
|||||||
class ListEntitiesMediaPlayerResponse : public InfoResponseProtoMessage {
|
class ListEntitiesMediaPlayerResponse : public InfoResponseProtoMessage {
|
||||||
public:
|
public:
|
||||||
static constexpr uint8_t MESSAGE_TYPE = 63;
|
static constexpr uint8_t MESSAGE_TYPE = 63;
|
||||||
static constexpr uint8_t ESTIMATED_SIZE = 85;
|
static constexpr uint8_t ESTIMATED_SIZE = 76;
|
||||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||||
const char *message_name() const override { return "list_entities_media_player_response"; }
|
const char *message_name() const override { return "list_entities_media_player_response"; }
|
||||||
#endif
|
#endif
|
||||||
@ -2481,7 +2480,7 @@ class VoiceAssistantSetConfiguration : public ProtoMessage {
|
|||||||
class ListEntitiesAlarmControlPanelResponse : public InfoResponseProtoMessage {
|
class ListEntitiesAlarmControlPanelResponse : public InfoResponseProtoMessage {
|
||||||
public:
|
public:
|
||||||
static constexpr uint8_t MESSAGE_TYPE = 94;
|
static constexpr uint8_t MESSAGE_TYPE = 94;
|
||||||
static constexpr uint8_t ESTIMATED_SIZE = 57;
|
static constexpr uint8_t ESTIMATED_SIZE = 48;
|
||||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||||
const char *message_name() const override { return "list_entities_alarm_control_panel_response"; }
|
const char *message_name() const override { return "list_entities_alarm_control_panel_response"; }
|
||||||
#endif
|
#endif
|
||||||
@ -2535,7 +2534,7 @@ class AlarmControlPanelCommandRequest : public CommandProtoMessage {
|
|||||||
class ListEntitiesTextResponse : public InfoResponseProtoMessage {
|
class ListEntitiesTextResponse : public InfoResponseProtoMessage {
|
||||||
public:
|
public:
|
||||||
static constexpr uint8_t MESSAGE_TYPE = 97;
|
static constexpr uint8_t MESSAGE_TYPE = 97;
|
||||||
static constexpr uint8_t ESTIMATED_SIZE = 68;
|
static constexpr uint8_t ESTIMATED_SIZE = 59;
|
||||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||||
const char *message_name() const override { return "list_entities_text_response"; }
|
const char *message_name() const override { return "list_entities_text_response"; }
|
||||||
#endif
|
#endif
|
||||||
@ -2590,7 +2589,7 @@ class TextCommandRequest : public CommandProtoMessage {
|
|||||||
class ListEntitiesDateResponse : public InfoResponseProtoMessage {
|
class ListEntitiesDateResponse : public InfoResponseProtoMessage {
|
||||||
public:
|
public:
|
||||||
static constexpr uint8_t MESSAGE_TYPE = 100;
|
static constexpr uint8_t MESSAGE_TYPE = 100;
|
||||||
static constexpr uint8_t ESTIMATED_SIZE = 49;
|
static constexpr uint8_t ESTIMATED_SIZE = 40;
|
||||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||||
const char *message_name() const override { return "list_entities_date_response"; }
|
const char *message_name() const override { return "list_entities_date_response"; }
|
||||||
#endif
|
#endif
|
||||||
@ -2644,7 +2643,7 @@ class DateCommandRequest : public CommandProtoMessage {
|
|||||||
class ListEntitiesTimeResponse : public InfoResponseProtoMessage {
|
class ListEntitiesTimeResponse : public InfoResponseProtoMessage {
|
||||||
public:
|
public:
|
||||||
static constexpr uint8_t MESSAGE_TYPE = 103;
|
static constexpr uint8_t MESSAGE_TYPE = 103;
|
||||||
static constexpr uint8_t ESTIMATED_SIZE = 49;
|
static constexpr uint8_t ESTIMATED_SIZE = 40;
|
||||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||||
const char *message_name() const override { return "list_entities_time_response"; }
|
const char *message_name() const override { return "list_entities_time_response"; }
|
||||||
#endif
|
#endif
|
||||||
@ -2698,7 +2697,7 @@ class TimeCommandRequest : public CommandProtoMessage {
|
|||||||
class ListEntitiesEventResponse : public InfoResponseProtoMessage {
|
class ListEntitiesEventResponse : public InfoResponseProtoMessage {
|
||||||
public:
|
public:
|
||||||
static constexpr uint8_t MESSAGE_TYPE = 107;
|
static constexpr uint8_t MESSAGE_TYPE = 107;
|
||||||
static constexpr uint8_t ESTIMATED_SIZE = 76;
|
static constexpr uint8_t ESTIMATED_SIZE = 67;
|
||||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||||
const char *message_name() const override { return "list_entities_event_response"; }
|
const char *message_name() const override { return "list_entities_event_response"; }
|
||||||
#endif
|
#endif
|
||||||
@ -2733,7 +2732,7 @@ class EventResponse : public StateResponseProtoMessage {
|
|||||||
class ListEntitiesValveResponse : public InfoResponseProtoMessage {
|
class ListEntitiesValveResponse : public InfoResponseProtoMessage {
|
||||||
public:
|
public:
|
||||||
static constexpr uint8_t MESSAGE_TYPE = 109;
|
static constexpr uint8_t MESSAGE_TYPE = 109;
|
||||||
static constexpr uint8_t ESTIMATED_SIZE = 64;
|
static constexpr uint8_t ESTIMATED_SIZE = 55;
|
||||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||||
const char *message_name() const override { return "list_entities_valve_response"; }
|
const char *message_name() const override { return "list_entities_valve_response"; }
|
||||||
#endif
|
#endif
|
||||||
@ -2789,7 +2788,7 @@ class ValveCommandRequest : public CommandProtoMessage {
|
|||||||
class ListEntitiesDateTimeResponse : public InfoResponseProtoMessage {
|
class ListEntitiesDateTimeResponse : public InfoResponseProtoMessage {
|
||||||
public:
|
public:
|
||||||
static constexpr uint8_t MESSAGE_TYPE = 112;
|
static constexpr uint8_t MESSAGE_TYPE = 112;
|
||||||
static constexpr uint8_t ESTIMATED_SIZE = 49;
|
static constexpr uint8_t ESTIMATED_SIZE = 40;
|
||||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||||
const char *message_name() const override { return "list_entities_date_time_response"; }
|
const char *message_name() const override { return "list_entities_date_time_response"; }
|
||||||
#endif
|
#endif
|
||||||
@ -2839,7 +2838,7 @@ class DateTimeCommandRequest : public CommandProtoMessage {
|
|||||||
class ListEntitiesUpdateResponse : public InfoResponseProtoMessage {
|
class ListEntitiesUpdateResponse : public InfoResponseProtoMessage {
|
||||||
public:
|
public:
|
||||||
static constexpr uint8_t MESSAGE_TYPE = 116;
|
static constexpr uint8_t MESSAGE_TYPE = 116;
|
||||||
static constexpr uint8_t ESTIMATED_SIZE = 58;
|
static constexpr uint8_t ESTIMATED_SIZE = 49;
|
||||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||||
const char *message_name() const override { return "list_entities_update_response"; }
|
const char *message_name() const override { return "list_entities_update_response"; }
|
||||||
#endif
|
#endif
|
||||||
|
@ -836,10 +836,6 @@ void ListEntitiesBinarySensorResponse::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(" unique_id: ");
|
|
||||||
out.append("'").append(this->unique_id).append("'");
|
|
||||||
out.append("\n");
|
|
||||||
|
|
||||||
out.append(" device_class: ");
|
out.append(" device_class: ");
|
||||||
out.append("'").append(this->device_class).append("'");
|
out.append("'").append(this->device_class).append("'");
|
||||||
out.append("\n");
|
out.append("\n");
|
||||||
@ -911,10 +907,6 @@ void ListEntitiesCoverResponse::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(" unique_id: ");
|
|
||||||
out.append("'").append(this->unique_id).append("'");
|
|
||||||
out.append("\n");
|
|
||||||
|
|
||||||
out.append(" assumed_state: ");
|
out.append(" assumed_state: ");
|
||||||
out.append(YESNO(this->assumed_state));
|
out.append(YESNO(this->assumed_state));
|
||||||
out.append("\n");
|
out.append("\n");
|
||||||
@ -1055,10 +1047,6 @@ void ListEntitiesFanResponse::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(" unique_id: ");
|
|
||||||
out.append("'").append(this->unique_id).append("'");
|
|
||||||
out.append("\n");
|
|
||||||
|
|
||||||
out.append(" supports_oscillation: ");
|
out.append(" supports_oscillation: ");
|
||||||
out.append(YESNO(this->supports_oscillation));
|
out.append(YESNO(this->supports_oscillation));
|
||||||
out.append("\n");
|
out.append("\n");
|
||||||
@ -1228,10 +1216,6 @@ void ListEntitiesLightResponse::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(" unique_id: ");
|
|
||||||
out.append("'").append(this->unique_id).append("'");
|
|
||||||
out.append("\n");
|
|
||||||
|
|
||||||
for (const auto &it : this->supported_color_modes) {
|
for (const auto &it : this->supported_color_modes) {
|
||||||
out.append(" supported_color_modes: ");
|
out.append(" supported_color_modes: ");
|
||||||
out.append(proto_enum_to_string<enums::ColorMode>(it));
|
out.append(proto_enum_to_string<enums::ColorMode>(it));
|
||||||
@ -1511,10 +1495,6 @@ void ListEntitiesSensorResponse::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(" unique_id: ");
|
|
||||||
out.append("'").append(this->unique_id).append("'");
|
|
||||||
out.append("\n");
|
|
||||||
|
|
||||||
#ifdef USE_ENTITY_ICON
|
#ifdef USE_ENTITY_ICON
|
||||||
out.append(" icon: ");
|
out.append(" icon: ");
|
||||||
out.append("'").append(this->icon).append("'");
|
out.append("'").append(this->icon).append("'");
|
||||||
@ -1601,10 +1581,6 @@ void ListEntitiesSwitchResponse::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(" unique_id: ");
|
|
||||||
out.append("'").append(this->unique_id).append("'");
|
|
||||||
out.append("\n");
|
|
||||||
|
|
||||||
#ifdef USE_ENTITY_ICON
|
#ifdef USE_ENTITY_ICON
|
||||||
out.append(" icon: ");
|
out.append(" icon: ");
|
||||||
out.append("'").append(this->icon).append("'");
|
out.append("'").append(this->icon).append("'");
|
||||||
@ -1690,10 +1666,6 @@ void ListEntitiesTextSensorResponse::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(" unique_id: ");
|
|
||||||
out.append("'").append(this->unique_id).append("'");
|
|
||||||
out.append("\n");
|
|
||||||
|
|
||||||
#ifdef USE_ENTITY_ICON
|
#ifdef USE_ENTITY_ICON
|
||||||
out.append(" icon: ");
|
out.append(" icon: ");
|
||||||
out.append("'").append(this->icon).append("'");
|
out.append("'").append(this->icon).append("'");
|
||||||
@ -1998,10 +1970,6 @@ void ListEntitiesCameraResponse::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(" unique_id: ");
|
|
||||||
out.append("'").append(this->unique_id).append("'");
|
|
||||||
out.append("\n");
|
|
||||||
|
|
||||||
out.append(" disabled_by_default: ");
|
out.append(" disabled_by_default: ");
|
||||||
out.append(YESNO(this->disabled_by_default));
|
out.append(YESNO(this->disabled_by_default));
|
||||||
out.append("\n");
|
out.append("\n");
|
||||||
@ -2077,10 +2045,6 @@ void ListEntitiesClimateResponse::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(" unique_id: ");
|
|
||||||
out.append("'").append(this->unique_id).append("'");
|
|
||||||
out.append("\n");
|
|
||||||
|
|
||||||
out.append(" supports_current_temperature: ");
|
out.append(" supports_current_temperature: ");
|
||||||
out.append(YESNO(this->supports_current_temperature));
|
out.append(YESNO(this->supports_current_temperature));
|
||||||
out.append("\n");
|
out.append("\n");
|
||||||
@ -2397,10 +2361,6 @@ void ListEntitiesNumberResponse::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(" unique_id: ");
|
|
||||||
out.append("'").append(this->unique_id).append("'");
|
|
||||||
out.append("\n");
|
|
||||||
|
|
||||||
#ifdef USE_ENTITY_ICON
|
#ifdef USE_ENTITY_ICON
|
||||||
out.append(" icon: ");
|
out.append(" icon: ");
|
||||||
out.append("'").append(this->icon).append("'");
|
out.append("'").append(this->icon).append("'");
|
||||||
@ -2508,10 +2468,6 @@ void ListEntitiesSelectResponse::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(" unique_id: ");
|
|
||||||
out.append("'").append(this->unique_id).append("'");
|
|
||||||
out.append("\n");
|
|
||||||
|
|
||||||
#ifdef USE_ENTITY_ICON
|
#ifdef USE_ENTITY_ICON
|
||||||
out.append(" icon: ");
|
out.append(" icon: ");
|
||||||
out.append("'").append(this->icon).append("'");
|
out.append("'").append(this->icon).append("'");
|
||||||
@ -2599,10 +2555,6 @@ void ListEntitiesSirenResponse::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(" unique_id: ");
|
|
||||||
out.append("'").append(this->unique_id).append("'");
|
|
||||||
out.append("\n");
|
|
||||||
|
|
||||||
#ifdef USE_ENTITY_ICON
|
#ifdef USE_ENTITY_ICON
|
||||||
out.append(" icon: ");
|
out.append(" icon: ");
|
||||||
out.append("'").append(this->icon).append("'");
|
out.append("'").append(this->icon).append("'");
|
||||||
@ -2727,10 +2679,6 @@ void ListEntitiesLockResponse::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(" unique_id: ");
|
|
||||||
out.append("'").append(this->unique_id).append("'");
|
|
||||||
out.append("\n");
|
|
||||||
|
|
||||||
#ifdef USE_ENTITY_ICON
|
#ifdef USE_ENTITY_ICON
|
||||||
out.append(" icon: ");
|
out.append(" icon: ");
|
||||||
out.append("'").append(this->icon).append("'");
|
out.append("'").append(this->icon).append("'");
|
||||||
@ -2832,10 +2780,6 @@ void ListEntitiesButtonResponse::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(" unique_id: ");
|
|
||||||
out.append("'").append(this->unique_id).append("'");
|
|
||||||
out.append("\n");
|
|
||||||
|
|
||||||
#ifdef USE_ENTITY_ICON
|
#ifdef USE_ENTITY_ICON
|
||||||
out.append(" icon: ");
|
out.append(" icon: ");
|
||||||
out.append("'").append(this->icon).append("'");
|
out.append("'").append(this->icon).append("'");
|
||||||
@ -2922,10 +2866,6 @@ void ListEntitiesMediaPlayerResponse::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(" unique_id: ");
|
|
||||||
out.append("'").append(this->unique_id).append("'");
|
|
||||||
out.append("\n");
|
|
||||||
|
|
||||||
#ifdef USE_ENTITY_ICON
|
#ifdef USE_ENTITY_ICON
|
||||||
out.append(" icon: ");
|
out.append(" icon: ");
|
||||||
out.append("'").append(this->icon).append("'");
|
out.append("'").append(this->icon).append("'");
|
||||||
@ -3791,10 +3731,6 @@ void ListEntitiesAlarmControlPanelResponse::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(" unique_id: ");
|
|
||||||
out.append("'").append(this->unique_id).append("'");
|
|
||||||
out.append("\n");
|
|
||||||
|
|
||||||
#ifdef USE_ENTITY_ICON
|
#ifdef USE_ENTITY_ICON
|
||||||
out.append(" icon: ");
|
out.append(" icon: ");
|
||||||
out.append("'").append(this->icon).append("'");
|
out.append("'").append(this->icon).append("'");
|
||||||
@ -3889,10 +3825,6 @@ void ListEntitiesTextResponse::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(" unique_id: ");
|
|
||||||
out.append("'").append(this->unique_id).append("'");
|
|
||||||
out.append("\n");
|
|
||||||
|
|
||||||
#ifdef USE_ENTITY_ICON
|
#ifdef USE_ENTITY_ICON
|
||||||
out.append(" icon: ");
|
out.append(" icon: ");
|
||||||
out.append("'").append(this->icon).append("'");
|
out.append("'").append(this->icon).append("'");
|
||||||
@ -3992,10 +3924,6 @@ void ListEntitiesDateResponse::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(" unique_id: ");
|
|
||||||
out.append("'").append(this->unique_id).append("'");
|
|
||||||
out.append("\n");
|
|
||||||
|
|
||||||
#ifdef USE_ENTITY_ICON
|
#ifdef USE_ENTITY_ICON
|
||||||
out.append(" icon: ");
|
out.append(" icon: ");
|
||||||
out.append("'").append(this->icon).append("'");
|
out.append("'").append(this->icon).append("'");
|
||||||
@ -4099,10 +4027,6 @@ void ListEntitiesTimeResponse::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(" unique_id: ");
|
|
||||||
out.append("'").append(this->unique_id).append("'");
|
|
||||||
out.append("\n");
|
|
||||||
|
|
||||||
#ifdef USE_ENTITY_ICON
|
#ifdef USE_ENTITY_ICON
|
||||||
out.append(" icon: ");
|
out.append(" icon: ");
|
||||||
out.append("'").append(this->icon).append("'");
|
out.append("'").append(this->icon).append("'");
|
||||||
@ -4206,10 +4130,6 @@ void ListEntitiesEventResponse::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(" unique_id: ");
|
|
||||||
out.append("'").append(this->unique_id).append("'");
|
|
||||||
out.append("\n");
|
|
||||||
|
|
||||||
#ifdef USE_ENTITY_ICON
|
#ifdef USE_ENTITY_ICON
|
||||||
out.append(" icon: ");
|
out.append(" icon: ");
|
||||||
out.append("'").append(this->icon).append("'");
|
out.append("'").append(this->icon).append("'");
|
||||||
@ -4279,10 +4199,6 @@ void ListEntitiesValveResponse::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(" unique_id: ");
|
|
||||||
out.append("'").append(this->unique_id).append("'");
|
|
||||||
out.append("\n");
|
|
||||||
|
|
||||||
#ifdef USE_ENTITY_ICON
|
#ifdef USE_ENTITY_ICON
|
||||||
out.append(" icon: ");
|
out.append(" icon: ");
|
||||||
out.append("'").append(this->icon).append("'");
|
out.append("'").append(this->icon).append("'");
|
||||||
@ -4390,10 +4306,6 @@ void ListEntitiesDateTimeResponse::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(" unique_id: ");
|
|
||||||
out.append("'").append(this->unique_id).append("'");
|
|
||||||
out.append("\n");
|
|
||||||
|
|
||||||
#ifdef USE_ENTITY_ICON
|
#ifdef USE_ENTITY_ICON
|
||||||
out.append(" icon: ");
|
out.append(" icon: ");
|
||||||
out.append("'").append(this->icon).append("'");
|
out.append("'").append(this->icon).append("'");
|
||||||
@ -4477,10 +4389,6 @@ void ListEntitiesUpdateResponse::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(" unique_id: ");
|
|
||||||
out.append("'").append(this->unique_id).append("'");
|
|
||||||
out.append("\n");
|
|
||||||
|
|
||||||
#ifdef USE_ENTITY_ICON
|
#ifdef USE_ENTITY_ICON
|
||||||
out.append(" icon: ");
|
out.append(" icon: ");
|
||||||
out.append("'").append(this->icon).append("'");
|
out.append("'").append(this->icon).append("'");
|
||||||
|
@ -29,7 +29,6 @@ class IPAddressEthernetInfo : public PollingComponent, public text_sensor::TextS
|
|||||||
}
|
}
|
||||||
|
|
||||||
float get_setup_priority() const override { return setup_priority::ETHERNET; }
|
float get_setup_priority() const override { return setup_priority::ETHERNET; }
|
||||||
std::string unique_id() override { return get_mac_address() + "-ethernetinfo"; }
|
|
||||||
void dump_config() override;
|
void dump_config() override;
|
||||||
void add_ip_sensors(uint8_t index, text_sensor::TextSensor *s) { this->ip_sensors_[index] = s; }
|
void add_ip_sensors(uint8_t index, text_sensor::TextSensor *s) { this->ip_sensors_[index] = s; }
|
||||||
|
|
||||||
@ -52,7 +51,6 @@ class DNSAddressEthernetInfo : public PollingComponent, public text_sensor::Text
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
float get_setup_priority() const override { return setup_priority::ETHERNET; }
|
float get_setup_priority() const override { return setup_priority::ETHERNET; }
|
||||||
std::string unique_id() override { return get_mac_address() + "-ethernetinfo-dns"; }
|
|
||||||
void dump_config() override;
|
void dump_config() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -63,7 +61,6 @@ class MACAddressEthernetInfo : public Component, public text_sensor::TextSensor
|
|||||||
public:
|
public:
|
||||||
void setup() override { this->publish_state(ethernet::global_eth_component->get_eth_mac_address_pretty()); }
|
void setup() override { this->publish_state(ethernet::global_eth_component->get_eth_mac_address_pretty()); }
|
||||||
float get_setup_priority() const override { return setup_priority::ETHERNET; }
|
float get_setup_priority() const override { return setup_priority::ETHERNET; }
|
||||||
std::string unique_id() override { return get_mac_address() + "-ethernetinfo-mac"; }
|
|
||||||
void dump_config() override;
|
void dump_config() override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -129,11 +129,7 @@ bool MQTTComponent::send_discovery_() {
|
|||||||
root[MQTT_PAYLOAD_NOT_AVAILABLE] = this->availability_->payload_not_available;
|
root[MQTT_PAYLOAD_NOT_AVAILABLE] = this->availability_->payload_not_available;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string unique_id = this->unique_id();
|
|
||||||
const MQTTDiscoveryInfo &discovery_info = global_mqtt_client->get_discovery_info();
|
const MQTTDiscoveryInfo &discovery_info = global_mqtt_client->get_discovery_info();
|
||||||
if (!unique_id.empty()) {
|
|
||||||
root[MQTT_UNIQUE_ID] = unique_id;
|
|
||||||
} else {
|
|
||||||
if (discovery_info.unique_id_generator == MQTT_MAC_ADDRESS_UNIQUE_ID_GENERATOR) {
|
if (discovery_info.unique_id_generator == MQTT_MAC_ADDRESS_UNIQUE_ID_GENERATOR) {
|
||||||
char friendly_name_hash[9];
|
char friendly_name_hash[9];
|
||||||
sprintf(friendly_name_hash, "%08" PRIx32, fnv1_hash(this->friendly_name()));
|
sprintf(friendly_name_hash, "%08" PRIx32, fnv1_hash(this->friendly_name()));
|
||||||
@ -144,7 +140,6 @@ bool MQTTComponent::send_discovery_() {
|
|||||||
// gorgeous device registry view.
|
// gorgeous device registry view.
|
||||||
root[MQTT_UNIQUE_ID] = "ESP" + this->component_type() + this->get_default_object_id_();
|
root[MQTT_UNIQUE_ID] = "ESP" + this->component_type() + this->get_default_object_id_();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
const std::string &node_name = App.get_name();
|
const std::string &node_name = App.get_name();
|
||||||
if (discovery_info.object_id_generator == MQTT_DEVICE_NAME_OBJECT_ID_GENERATOR)
|
if (discovery_info.object_id_generator == MQTT_DEVICE_NAME_OBJECT_ID_GENERATOR)
|
||||||
@ -286,7 +281,6 @@ void MQTTComponent::call_dump_config() {
|
|||||||
this->dump_config();
|
this->dump_config();
|
||||||
}
|
}
|
||||||
void MQTTComponent::schedule_resend_state() { this->resend_state_ = true; }
|
void MQTTComponent::schedule_resend_state() { this->resend_state_ = true; }
|
||||||
std::string MQTTComponent::unique_id() { return ""; }
|
|
||||||
bool MQTTComponent::is_connected_() const { return global_mqtt_client->is_connected(); }
|
bool MQTTComponent::is_connected_() const { return global_mqtt_client->is_connected(); }
|
||||||
|
|
||||||
// Pull these properties from EntityBase if not overridden
|
// Pull these properties from EntityBase if not overridden
|
||||||
|
@ -164,13 +164,6 @@ class MQTTComponent : public Component {
|
|||||||
*/
|
*/
|
||||||
virtual const EntityBase *get_entity() const = 0;
|
virtual const EntityBase *get_entity() const = 0;
|
||||||
|
|
||||||
/** A unique ID for this MQTT component, empty for no unique id. See unique ID requirements:
|
|
||||||
* https://developers.home-assistant.io/docs/en/entity_registry_index.html#unique-id-requirements
|
|
||||||
*
|
|
||||||
* @return The unique id as a string.
|
|
||||||
*/
|
|
||||||
virtual std::string unique_id();
|
|
||||||
|
|
||||||
/// Get the friendly name of this MQTT component.
|
/// Get the friendly name of this MQTT component.
|
||||||
virtual std::string friendly_name() const;
|
virtual std::string friendly_name() const;
|
||||||
|
|
||||||
|
@ -76,7 +76,6 @@ bool MQTTSensorComponent::publish_state(float value) {
|
|||||||
int8_t accuracy = this->sensor_->get_accuracy_decimals();
|
int8_t accuracy = this->sensor_->get_accuracy_decimals();
|
||||||
return this->publish(this->get_state_topic_(), value_accuracy_to_string(value, accuracy));
|
return this->publish(this->get_state_topic_(), value_accuracy_to_string(value, accuracy));
|
||||||
}
|
}
|
||||||
std::string MQTTSensorComponent::unique_id() { return this->sensor_->unique_id(); }
|
|
||||||
|
|
||||||
} // namespace mqtt
|
} // namespace mqtt
|
||||||
} // namespace esphome
|
} // namespace esphome
|
||||||
|
@ -46,7 +46,6 @@ class MQTTSensorComponent : public mqtt::MQTTComponent {
|
|||||||
/// Override for MQTTComponent, returns "sensor".
|
/// Override for MQTTComponent, returns "sensor".
|
||||||
std::string component_type() const override;
|
std::string component_type() const override;
|
||||||
const EntityBase *get_entity() const override;
|
const EntityBase *get_entity() const override;
|
||||||
std::string unique_id() override;
|
|
||||||
|
|
||||||
sensor::Sensor *sensor_;
|
sensor::Sensor *sensor_;
|
||||||
optional<uint32_t> expire_after_; // Override the expire after advertised to Home Assistant
|
optional<uint32_t> expire_after_; // Override the expire after advertised to Home Assistant
|
||||||
|
@ -40,7 +40,6 @@ bool MQTTTextSensor::send_initial_state() {
|
|||||||
}
|
}
|
||||||
std::string MQTTTextSensor::component_type() const { return "sensor"; }
|
std::string MQTTTextSensor::component_type() const { return "sensor"; }
|
||||||
const EntityBase *MQTTTextSensor::get_entity() const { return this->sensor_; }
|
const EntityBase *MQTTTextSensor::get_entity() const { return this->sensor_; }
|
||||||
std::string MQTTTextSensor::unique_id() { return this->sensor_->unique_id(); }
|
|
||||||
|
|
||||||
} // namespace mqtt
|
} // namespace mqtt
|
||||||
} // namespace esphome
|
} // namespace esphome
|
||||||
|
@ -28,7 +28,6 @@ class MQTTTextSensor : public mqtt::MQTTComponent {
|
|||||||
protected:
|
protected:
|
||||||
std::string component_type() const override;
|
std::string component_type() const override;
|
||||||
const EntityBase *get_entity() const override;
|
const EntityBase *get_entity() const override;
|
||||||
std::string unique_id() override;
|
|
||||||
|
|
||||||
text_sensor::TextSensor *sensor_;
|
text_sensor::TextSensor *sensor_;
|
||||||
};
|
};
|
||||||
|
@ -11,8 +11,6 @@ const std::string &OneWireDevice::get_address_name() {
|
|||||||
return this->address_name_;
|
return this->address_name_;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string OneWireDevice::unique_id() { return "dallas-" + str_lower_case(format_hex(this->address_)); }
|
|
||||||
|
|
||||||
bool OneWireDevice::send_command_(uint8_t cmd) {
|
bool OneWireDevice::send_command_(uint8_t cmd) {
|
||||||
if (!this->bus_->select(this->address_))
|
if (!this->bus_->select(this->address_))
|
||||||
return false;
|
return false;
|
||||||
|
@ -24,8 +24,6 @@ class OneWireDevice {
|
|||||||
/// Helper to create (and cache) the name for this sensor. For example "0xfe0000031f1eaf29".
|
/// Helper to create (and cache) the name for this sensor. For example "0xfe0000031f1eaf29".
|
||||||
const std::string &get_address_name();
|
const std::string &get_address_name();
|
||||||
|
|
||||||
std::string unique_id();
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
uint64_t address_{0};
|
uint64_t address_{0};
|
||||||
OneWireBus *bus_{nullptr}; ///< pointer to OneWireBus instance
|
OneWireBus *bus_{nullptr}; ///< pointer to OneWireBus instance
|
||||||
|
@ -96,7 +96,6 @@ void Sensor::clear_filters() {
|
|||||||
}
|
}
|
||||||
float Sensor::get_state() const { return this->state; }
|
float Sensor::get_state() const { return this->state; }
|
||||||
float Sensor::get_raw_state() const { return this->raw_state; }
|
float Sensor::get_raw_state() const { return this->raw_state; }
|
||||||
std::string Sensor::unique_id() { return ""; }
|
|
||||||
|
|
||||||
void Sensor::internal_send_state_to_frontend(float state) {
|
void Sensor::internal_send_state_to_frontend(float state) {
|
||||||
this->set_has_state(true);
|
this->set_has_state(true);
|
||||||
|
@ -28,9 +28,6 @@ namespace sensor {
|
|||||||
if (!(obj)->get_icon().empty()) { \
|
if (!(obj)->get_icon().empty()) { \
|
||||||
ESP_LOGCONFIG(TAG, "%s Icon: '%s'", prefix, (obj)->get_icon().c_str()); \
|
ESP_LOGCONFIG(TAG, "%s Icon: '%s'", prefix, (obj)->get_icon().c_str()); \
|
||||||
} \
|
} \
|
||||||
if (!(obj)->unique_id().empty()) { \
|
|
||||||
ESP_LOGV(TAG, "%s Unique ID: '%s'", prefix, (obj)->unique_id().c_str()); \
|
|
||||||
} \
|
|
||||||
if ((obj)->get_force_update()) { \
|
if ((obj)->get_force_update()) { \
|
||||||
ESP_LOGV(TAG, "%s Force Update: YES", prefix); \
|
ESP_LOGV(TAG, "%s Force Update: YES", prefix); \
|
||||||
} \
|
} \
|
||||||
@ -141,12 +138,6 @@ class Sensor : public EntityBase, public EntityBase_DeviceClass, public EntityBa
|
|||||||
*/
|
*/
|
||||||
float raw_state;
|
float raw_state;
|
||||||
|
|
||||||
/** Override this method to set the unique ID of this sensor.
|
|
||||||
*
|
|
||||||
* @deprecated Do not use for new sensors, a suitable unique ID is automatically generated (2023.4).
|
|
||||||
*/
|
|
||||||
virtual std::string unique_id();
|
|
||||||
|
|
||||||
void internal_send_state_to_frontend(float state);
|
void internal_send_state_to_frontend(float state);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -176,7 +176,7 @@ void SSD1306::setup() {
|
|||||||
// Disable scrolling mode (0x2E)
|
// Disable scrolling mode (0x2E)
|
||||||
this->command(SSD1306_COMMAND_DEACTIVATE_SCROLL);
|
this->command(SSD1306_COMMAND_DEACTIVATE_SCROLL);
|
||||||
|
|
||||||
// Contrast and brighrness
|
// Contrast and brightness
|
||||||
// SSD1306 does not have brightness setting
|
// SSD1306 does not have brightness setting
|
||||||
set_contrast(this->contrast_);
|
set_contrast(this->contrast_);
|
||||||
if (this->is_ssd1305_())
|
if (this->is_ssd1305_())
|
||||||
|
@ -70,7 +70,5 @@ void TextSensor::internal_send_state_to_frontend(const std::string &state) {
|
|||||||
this->callback_.call(state);
|
this->callback_.call(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string TextSensor::unique_id() { return ""; }
|
|
||||||
|
|
||||||
} // namespace text_sensor
|
} // namespace text_sensor
|
||||||
} // namespace esphome
|
} // namespace esphome
|
||||||
|
@ -20,9 +20,6 @@ namespace text_sensor {
|
|||||||
if (!(obj)->get_icon().empty()) { \
|
if (!(obj)->get_icon().empty()) { \
|
||||||
ESP_LOGCONFIG(TAG, "%s Icon: '%s'", prefix, (obj)->get_icon().c_str()); \
|
ESP_LOGCONFIG(TAG, "%s Icon: '%s'", prefix, (obj)->get_icon().c_str()); \
|
||||||
} \
|
} \
|
||||||
if (!(obj)->unique_id().empty()) { \
|
|
||||||
ESP_LOGV(TAG, "%s Unique ID: '%s'", prefix, (obj)->unique_id().c_str()); \
|
|
||||||
} \
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#define SUB_TEXT_SENSOR(name) \
|
#define SUB_TEXT_SENSOR(name) \
|
||||||
@ -64,11 +61,6 @@ class TextSensor : public EntityBase, public EntityBase_DeviceClass {
|
|||||||
|
|
||||||
// ========== INTERNAL METHODS ==========
|
// ========== INTERNAL METHODS ==========
|
||||||
// (In most use cases you won't need these)
|
// (In most use cases you won't need these)
|
||||||
/** Override this method to set the unique ID of this sensor.
|
|
||||||
*
|
|
||||||
* @deprecated Do not use for new sensors, a suitable unique ID is automatically generated (2023.4).
|
|
||||||
*/
|
|
||||||
virtual std::string unique_id();
|
|
||||||
|
|
||||||
void internal_send_state_to_frontend(const std::string &state);
|
void internal_send_state_to_frontend(const std::string &state);
|
||||||
|
|
||||||
|
@ -27,7 +27,6 @@ void UptimeSecondsSensor::update() {
|
|||||||
const float seconds = float(seconds_int) + (this->uptime_ % 1000ULL) / 1000.0f;
|
const float seconds = float(seconds_int) + (this->uptime_ % 1000ULL) / 1000.0f;
|
||||||
this->publish_state(seconds);
|
this->publish_state(seconds);
|
||||||
}
|
}
|
||||||
std::string UptimeSecondsSensor::unique_id() { return get_mac_address() + "-uptime"; }
|
|
||||||
float UptimeSecondsSensor::get_setup_priority() const { return setup_priority::HARDWARE; }
|
float UptimeSecondsSensor::get_setup_priority() const { return setup_priority::HARDWARE; }
|
||||||
void UptimeSecondsSensor::dump_config() {
|
void UptimeSecondsSensor::dump_config() {
|
||||||
LOG_SENSOR("", "Uptime Sensor", this);
|
LOG_SENSOR("", "Uptime Sensor", this);
|
||||||
|
@ -13,8 +13,6 @@ class UptimeSecondsSensor : public sensor::Sensor, public PollingComponent {
|
|||||||
|
|
||||||
float get_setup_priority() const override;
|
float get_setup_priority() const override;
|
||||||
|
|
||||||
std::string unique_id() override;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
uint64_t uptime_{0};
|
uint64_t uptime_{0};
|
||||||
};
|
};
|
||||||
|
@ -17,7 +17,6 @@ void VersionTextSensor::setup() {
|
|||||||
}
|
}
|
||||||
float VersionTextSensor::get_setup_priority() const { return setup_priority::DATA; }
|
float VersionTextSensor::get_setup_priority() const { return setup_priority::DATA; }
|
||||||
void VersionTextSensor::set_hide_timestamp(bool hide_timestamp) { this->hide_timestamp_ = hide_timestamp; }
|
void VersionTextSensor::set_hide_timestamp(bool hide_timestamp) { this->hide_timestamp_ = hide_timestamp; }
|
||||||
std::string VersionTextSensor::unique_id() { return get_mac_address() + "-version"; }
|
|
||||||
void VersionTextSensor::dump_config() { LOG_TEXT_SENSOR("", "Version Text Sensor", this); }
|
void VersionTextSensor::dump_config() { LOG_TEXT_SENSOR("", "Version Text Sensor", this); }
|
||||||
|
|
||||||
} // namespace version
|
} // namespace version
|
||||||
|
@ -12,7 +12,6 @@ class VersionTextSensor : public text_sensor::TextSensor, public Component {
|
|||||||
void setup() override;
|
void setup() override;
|
||||||
void dump_config() override;
|
void dump_config() override;
|
||||||
float get_setup_priority() const override;
|
float get_setup_priority() const override;
|
||||||
std::string unique_id() override;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool hide_timestamp_{false};
|
bool hide_timestamp_{false};
|
||||||
|
@ -28,7 +28,6 @@ class IPAddressWiFiInfo : public PollingComponent, public text_sensor::TextSenso
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
float get_setup_priority() const override { return setup_priority::AFTER_WIFI; }
|
float get_setup_priority() const override { return setup_priority::AFTER_WIFI; }
|
||||||
std::string unique_id() override { return get_mac_address() + "-wifiinfo-ip"; }
|
|
||||||
void dump_config() override;
|
void dump_config() override;
|
||||||
void add_ip_sensors(uint8_t index, text_sensor::TextSensor *s) { this->ip_sensors_[index] = s; }
|
void add_ip_sensors(uint8_t index, text_sensor::TextSensor *s) { this->ip_sensors_[index] = s; }
|
||||||
|
|
||||||
@ -51,7 +50,6 @@ class DNSAddressWifiInfo : public PollingComponent, public text_sensor::TextSens
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
float get_setup_priority() const override { return setup_priority::AFTER_WIFI; }
|
float get_setup_priority() const override { return setup_priority::AFTER_WIFI; }
|
||||||
std::string unique_id() override { return get_mac_address() + "-wifiinfo-dns"; }
|
|
||||||
void dump_config() override;
|
void dump_config() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -80,7 +78,6 @@ class ScanResultsWiFiInfo : public PollingComponent, public text_sensor::TextSen
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
float get_setup_priority() const override { return setup_priority::AFTER_WIFI; }
|
float get_setup_priority() const override { return setup_priority::AFTER_WIFI; }
|
||||||
std::string unique_id() override { return get_mac_address() + "-wifiinfo-scanresults"; }
|
|
||||||
void dump_config() override;
|
void dump_config() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -97,7 +94,6 @@ class SSIDWiFiInfo : public PollingComponent, public text_sensor::TextSensor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
float get_setup_priority() const override { return setup_priority::AFTER_WIFI; }
|
float get_setup_priority() const override { return setup_priority::AFTER_WIFI; }
|
||||||
std::string unique_id() override { return get_mac_address() + "-wifiinfo-ssid"; }
|
|
||||||
void dump_config() override;
|
void dump_config() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -116,7 +112,6 @@ class BSSIDWiFiInfo : public PollingComponent, public text_sensor::TextSensor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
float get_setup_priority() const override { return setup_priority::AFTER_WIFI; }
|
float get_setup_priority() const override { return setup_priority::AFTER_WIFI; }
|
||||||
std::string unique_id() override { return get_mac_address() + "-wifiinfo-bssid"; }
|
|
||||||
void dump_config() override;
|
void dump_config() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -126,7 +121,6 @@ class BSSIDWiFiInfo : public PollingComponent, public text_sensor::TextSensor {
|
|||||||
class MacAddressWifiInfo : public Component, public text_sensor::TextSensor {
|
class MacAddressWifiInfo : public Component, public text_sensor::TextSensor {
|
||||||
public:
|
public:
|
||||||
void setup() override { this->publish_state(get_mac_address_pretty()); }
|
void setup() override { this->publish_state(get_mac_address_pretty()); }
|
||||||
std::string unique_id() override { return get_mac_address() + "-wifiinfo-macadr"; }
|
|
||||||
void dump_config() override;
|
void dump_config() override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -13,7 +13,6 @@ class WiFiSignalSensor : public sensor::Sensor, public PollingComponent {
|
|||||||
void update() override { this->publish_state(wifi::global_wifi_component->wifi_rssi()); }
|
void update() override { this->publish_state(wifi::global_wifi_component->wifi_rssi()); }
|
||||||
void dump_config() override;
|
void dump_config() override;
|
||||||
|
|
||||||
std::string unique_id() override { return get_mac_address() + "-wifisignal"; }
|
|
||||||
float get_setup_priority() const override { return setup_priority::AFTER_WIFI; }
|
float get_setup_priority() const override { return setup_priority::AFTER_WIFI; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user