ESPHome  2024.5.1
Public Member Functions | Protected Member Functions | Protected Attributes
esphome::EntityBase Class Reference

#include <entity_base.h>

Inheritance diagram for esphome::EntityBase:
esphome::alarm_control_panel::AlarmControlPanel esphome::binary_sensor::BinarySensor esphome::button::Button esphome::climate::Climate esphome::cover::Cover esphome::datetime::DateTimeBase esphome::esp32_camera::ESP32Camera esphome::event::Event esphome::fan::Fan esphome::light::LightState esphome::lock::Lock esphome::media_player::MediaPlayer esphome::number::Number esphome::select::Select esphome::sensor::Sensor esphome::switch_::Switch esphome::text::Text esphome::text_sensor::TextSensor esphome::valve::Valve

Public Member Functions

const StringRefget_name () const
void set_name (const char *name)
bool has_own_name () const
std::string get_object_id () const
void set_object_id (const char *object_id)
uint32_t get_object_id_hash ()
bool is_internal () const
void set_internal (bool internal)
bool is_disabled_by_default () const
void set_disabled_by_default (bool disabled_by_default)
EntityCategory get_entity_category () const
void set_entity_category (EntityCategory entity_category)
std::string get_icon () const
void set_icon (const char *icon)

Protected Member Functions

virtual uint32_t hash_base ()
 The hash_base() function has been deprecated. More...
void calc_object_id_ ()

Protected Attributes

StringRef name_
const char * object_id_c_str_ {nullptr}
const char * icon_c_str_ {nullptr}
uint32_t object_id_hash_
bool has_own_name_ {false}
bool internal_ {false}
bool disabled_by_default_ {false}
EntityCategory entity_category_ {ENTITY_CATEGORY_NONE}

Detailed Description

Definition at line 16 of file entity_base.h.

Member Function Documentation

◆ calc_object_id_()

void esphome::EntityBase::calc_object_id_ ( )

Definition at line 62 of file entity_base.cpp.

◆ get_entity_category()

EntityCategory esphome::EntityBase::get_entity_category ( ) const

Definition at line 39 of file entity_base.cpp.

◆ get_icon()

std::string esphome::EntityBase::get_icon ( ) const

Definition at line 30 of file entity_base.cpp.

◆ get_name()

const StringRef & esphome::EntityBase::get_name ( ) const

Definition at line 10 of file entity_base.cpp.

◆ get_object_id()

std::string esphome::EntityBase::get_object_id ( ) const

Definition at line 43 of file entity_base.cpp.

◆ get_object_id_hash()

uint32_t esphome::EntityBase::get_object_id_hash ( )

Definition at line 76 of file entity_base.cpp.

◆ has_own_name()

bool esphome::EntityBase::has_own_name ( ) const

Definition at line 23 of file entity_base.h.

◆ hash_base()

virtual uint32_t esphome::EntityBase::hash_base ( )

The hash_base() function has been deprecated.

It is kept in this class for now, to prevent external components from not compiling.

Definition at line 53 of file entity_base.h.

◆ is_disabled_by_default()

bool esphome::EntityBase::is_disabled_by_default ( ) const

Definition at line 26 of file entity_base.cpp.

◆ is_internal()

bool esphome::EntityBase::is_internal ( ) const

Definition at line 22 of file entity_base.cpp.

◆ set_disabled_by_default()

void esphome::EntityBase::set_disabled_by_default ( bool  disabled_by_default)

Definition at line 27 of file entity_base.cpp.

◆ set_entity_category()

void esphome::EntityBase::set_entity_category ( EntityCategory  entity_category)

Definition at line 40 of file entity_base.cpp.

◆ set_icon()

void esphome::EntityBase::set_icon ( const char *  icon)

Definition at line 36 of file entity_base.cpp.

◆ set_internal()

void esphome::EntityBase::set_internal ( bool  internal)

Definition at line 23 of file entity_base.cpp.

◆ set_name()

void esphome::EntityBase::set_name ( const char *  name)

Definition at line 11 of file entity_base.cpp.

◆ set_object_id()

void esphome::EntityBase::set_object_id ( const char *  object_id)

Definition at line 56 of file entity_base.cpp.

Field Documentation

◆ disabled_by_default_

bool esphome::EntityBase::disabled_by_default_ {false}

Definition at line 62 of file entity_base.h.

◆ entity_category_

EntityCategory esphome::EntityBase::entity_category_ {ENTITY_CATEGORY_NONE}

Definition at line 63 of file entity_base.h.

◆ has_own_name_

bool esphome::EntityBase::has_own_name_ {false}

Definition at line 60 of file entity_base.h.

◆ icon_c_str_

const char* esphome::EntityBase::icon_c_str_ {nullptr}

Definition at line 58 of file entity_base.h.

◆ internal_

bool esphome::EntityBase::internal_ {false}

Definition at line 61 of file entity_base.h.

◆ name_

StringRef esphome::EntityBase::name_

Definition at line 56 of file entity_base.h.

◆ object_id_c_str_

const char* esphome::EntityBase::object_id_c_str_ {nullptr}

Definition at line 57 of file entity_base.h.

◆ object_id_hash_

uint32_t esphome::EntityBase::object_id_hash_

Definition at line 59 of file entity_base.h.

The documentation for this class was generated from the following files: