From 8769ddcfa9b4747a8caa11aeb94a5a7a52263680 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Tue, 13 May 2025 22:04:23 -0500 Subject: [PATCH] revert --- esphome/components/sensor/sensor.h | 2 +- esphome/components/text_sensor/text_sensor.h | 2 +- esphome/core/entity_base.h | 4 ---- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/esphome/components/sensor/sensor.h b/esphome/components/sensor/sensor.h index e6ec9b86d3..98356c943d 100644 --- a/esphome/components/sensor/sensor.h +++ b/esphome/components/sensor/sensor.h @@ -143,7 +143,7 @@ class Sensor : public EntityBase, public EntityBase_DeviceClass, public EntityBa * * @deprecated Do not use for new sensors, a suitable unique ID is automatically generated (2023.4). */ - std::string unique_id() override; + virtual std::string unique_id(); void internal_send_state_to_frontend(float state); diff --git a/esphome/components/text_sensor/text_sensor.h b/esphome/components/text_sensor/text_sensor.h index fc7716fe0c..bd72ea70e3 100644 --- a/esphome/components/text_sensor/text_sensor.h +++ b/esphome/components/text_sensor/text_sensor.h @@ -65,7 +65,7 @@ class TextSensor : public EntityBase, public EntityBase_DeviceClass { * * @deprecated Do not use for new sensors, a suitable unique ID is automatically generated (2023.4). */ - std::string unique_id() override; + virtual std::string unique_id(); bool has_state(); diff --git a/esphome/core/entity_base.h b/esphome/core/entity_base.h index f778de1514..4ca21f9ee5 100644 --- a/esphome/core/entity_base.h +++ b/esphome/core/entity_base.h @@ -29,10 +29,6 @@ class EntityBase { // Get the unique Object ID of this Entity uint32_t get_object_id_hash(); - // Get the unique ID for this entity, can be overridden by entities - // that need custom unique IDs - virtual std::string unique_id() { return ""; } - // Get/set whether this Entity should be hidden from outside of ESPHome bool is_internal() const; void set_internal(bool internal);