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);