159 if (this->
state_ != state) {
std::string get_device_class()
Get the device class, using the manual override if set.
void set_device_class(const char *device_class)
Manually set the device class.
const char * device_class_
Device class override.
std::string get_unit_of_measurement()
Get the unit of measurement, using the manual override if set.
const char * unit_of_measurement_
Unit of measurement override.
void set_unit_of_measurement(const char *unit_of_measurement)
Manually set the unit of measurement.
struct esphome::EntityBase::EntityFlags flags_
void set_device(Device *device)
void set_object_id(const char *object_id)
bool has_own_name() const
const char * object_id_c_str_
uint32_t get_object_id_hash()
const StringRef & get_name() const
void set_entity_category(EntityCategory entity_category)
std::string get_icon() const
uint32_t get_device_id() const
bool is_disabled_by_default() const
void set_name(const char *name)
void set_icon(const char *icon)
void set_disabled_by_default(bool disabled_by_default)
void set_has_state(bool state)
virtual uint32_t hash_base()
The hash_base() function has been deprecated.
std::string get_object_id() const
EntityCategory get_entity_category() const
void set_internal(bool internal)
An entity that has a state.
virtual const T & get_state() const
bool set_state_(const optional< T > &state)
Set a new state for this entity.
bool trigger_on_initial_state_
void add_full_state_callback(std::function< void(optional< T > previous, optional< T > current)> &&callback)
CallbackManager< void(T)> * state_callbacks_
void add_on_state_callback(std::function< void(T)> &&callback)
void set_trigger_on_initial_state(bool trigger_on_initial_state)
virtual bool has_state() const
virtual T get_state_default(T default_value) const
CallbackManager< void(optional< T > previous, optional< T > current)> * full_state_callbacks_
StringRef is a reference to a string owned by something else.
value_type const & value() const
Providing packet encoding functions for exchanging data with a remote host.
@ ENTITY_CATEGORY_DIAGNOSTIC
uint8_t disabled_by_default