1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-01 17:42:22 +01:00

Remove legacy unique_id field from entities (#9022)

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
J. Nick Koston
2025-07-15 18:56:49 -10:00
committed by GitHub
parent 231bcb1f7d
commit f3c0c0c00c
26 changed files with 54 additions and 285 deletions

View File

@@ -70,7 +70,5 @@ void TextSensor::internal_send_state_to_frontend(const std::string &state) {
this->callback_.call(state);
}
std::string TextSensor::unique_id() { return ""; }
} // namespace text_sensor
} // namespace esphome

View File

@@ -20,9 +20,6 @@ namespace text_sensor {
if (!(obj)->get_icon().empty()) { \
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) \
@@ -64,11 +61,6 @@ class TextSensor : public EntityBase, public EntityBase_DeviceClass {
// ========== INTERNAL METHODS ==========
// (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);