mirror of
https://github.com/esphome/esphome.git
synced 2025-02-22 04:48:21 +00:00
Mark unique_id() override as deprecated (#4538)
This commit is contained in:
parent
da056866ff
commit
afc1c83af4
@ -150,10 +150,9 @@ class Sensor : public EntityBase {
|
|||||||
/// Return whether this sensor has gotten a full state (that passed through all filters) yet.
|
/// Return whether this sensor has gotten a full state (that passed through all filters) yet.
|
||||||
bool has_state() const;
|
bool has_state() const;
|
||||||
|
|
||||||
/** A unique ID for this sensor, empty for no unique id. See unique ID requirements:
|
/** Override this method to set the unique ID of this sensor.
|
||||||
* https://developers.home-assistant.io/docs/en/entity_registry_index.html#unique-id-requirements
|
|
||||||
*
|
*
|
||||||
* @return The unique id as a string.
|
* @deprecated Do not use for new sensors, a suitable unique ID is automatically generated (2023.4).
|
||||||
*/
|
*/
|
||||||
virtual std::string unique_id();
|
virtual std::string unique_id();
|
||||||
|
|
||||||
|
@ -61,6 +61,10 @@ class TextSensor : public EntityBase {
|
|||||||
|
|
||||||
// ========== 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();
|
virtual std::string unique_id();
|
||||||
|
|
||||||
bool has_state();
|
bool has_state();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user