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

#include <entity_base.h>

Inheritance diagram for esphome::EntityBase:
esphome::binary_sensor::BinarySensor esphome::button::Button esphome::climate::Climate esphome::cover::Cover esphome::esp32_camera::ESP32Camera esphome::fan::Fan esphome::light::LightState esphome::lock::Lock esphome::media_player::MediaPlayer esphome::number::Number esphome::select::Select esphome::sensor::Sensor esphome::sprinkler::Sprinkler esphome::switch_::Switch esphome::text_sensor::TextSensor

Public Member Functions

 EntityBase ()
 EntityBase (std::string name)
const std::string & get_name () const
void set_name (const std::string &name)
const std::string & get_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)
const std::string & get_icon () const
void set_icon (const std::string &name)

Protected Member Functions

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

Protected Attributes

std::string name_
std::string object_id_
std::string icon_
uint32_t object_id_hash_
bool internal_ {false}
bool disabled_by_default_ {false}
EntityCategory entity_category_ {ENTITY_CATEGORY_NONE}

Detailed Description

Definition at line 15 of file entity_base.h.

Constructor & Destructor Documentation

◆ EntityBase() [1/2]

esphome::EntityBase::EntityBase ( )

Definition at line 17 of file entity_base.h.

◆ EntityBase() [2/2]

esphome::EntityBase::EntityBase ( std::string  name)

Definition at line 8 of file entity_base.cpp.

Member Function Documentation

◆ calc_object_id_()

void esphome::EntityBase::calc_object_id_ ( )

Definition at line 37 of file entity_base.cpp.

◆ get_entity_category()

EntityCategory esphome::EntityBase::get_entity_category ( ) const

Definition at line 30 of file entity_base.cpp.

◆ get_icon()

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

Definition at line 26 of file entity_base.cpp.

◆ get_name()

const std::string & esphome::EntityBase::get_name ( ) const

Definition at line 11 of file entity_base.cpp.

◆ get_object_id()

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

Definition at line 34 of file entity_base.cpp.

◆ get_object_id_hash()

uint32_t esphome::EntityBase::get_object_id_hash ( )

Definition at line 42 of file entity_base.cpp.

◆ 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.

Reimplemented in esphome::sprinkler::Sprinkler.

Definition at line 51 of file entity_base.h.

◆ is_disabled_by_default()

bool esphome::EntityBase::is_disabled_by_default ( ) const

Definition at line 22 of file entity_base.cpp.

◆ is_internal()

bool esphome::EntityBase::is_internal ( ) const

Definition at line 18 of file entity_base.cpp.

◆ set_disabled_by_default()

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

Definition at line 23 of file entity_base.cpp.

◆ set_entity_category()

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

Definition at line 31 of file entity_base.cpp.

◆ set_icon()

void esphome::EntityBase::set_icon ( const std::string &  name)

Definition at line 27 of file entity_base.cpp.

◆ set_internal()

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

Definition at line 19 of file entity_base.cpp.

◆ set_name()

void esphome::EntityBase::set_name ( const std::string &  name)

Definition at line 12 of file entity_base.cpp.

Field Documentation

◆ disabled_by_default_

bool esphome::EntityBase::disabled_by_default_ {false}

Definition at line 59 of file entity_base.h.

◆ entity_category_

EntityCategory esphome::EntityBase::entity_category_ {ENTITY_CATEGORY_NONE}

Definition at line 60 of file entity_base.h.

◆ icon_

std::string esphome::EntityBase::icon_

Definition at line 56 of file entity_base.h.

◆ internal_

bool esphome::EntityBase::internal_ {false}

Definition at line 58 of file entity_base.h.

◆ name_

std::string esphome::EntityBase::name_

Definition at line 54 of file entity_base.h.

◆ object_id_

std::string esphome::EntityBase::object_id_

Definition at line 55 of file entity_base.h.

◆ object_id_hash_

uint32_t esphome::EntityBase::object_id_hash_

Definition at line 57 of file entity_base.h.

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