8static const char *
const TAG =
"entity_base";
30std::string EntityBase::get_icon()
const {
85std::string EntityBase_DeviceClass::get_device_class() {
94std::string EntityBase_UnitOfMeasurement::get_unit_of_measurement() {
const std::string & get_friendly_name() const
Get the friendly name of this Application set by pre_setup().
bool is_name_add_mac_suffix_enabled() const
ESPDEPRECATED("Use get_device_class_ref() instead for better performance (avoids string copy). Will be removed in " "ESPHome 2026.5.0", "2025.11.0") std void set_device_class(const char *device_class)
Get the device class, using the manual override if set.
const char * device_class_
Device class override.
const char * unit_of_measurement_
Unit of measurement override.
ESPDEPRECATED("Use get_unit_of_measurement_ref() instead for better performance (avoids string copy). Will be " "removed in ESPHome 2026.5.0", "2025.11.0") std void set_unit_of_measurement(const char *unit_of_measurement)
Get the unit of measurement, using the manual override if set.
struct esphome::EntityBase::EntityFlags flags_
void set_object_id(const char *object_id)
const char * object_id_c_str_
uint32_t get_object_id_hash()
const StringRef & get_name() const
bool is_object_id_dynamic_() const
Check if the object_id is dynamic (changes with MAC suffix)
void set_name(const char *name)
ESPDEPRECATED("Use get_icon_ref() instead for better performance (avoids string copy). Will be removed in ESPHome 2026.5.0", "2025.11.0") std void set_icon(const char *icon)
std::string get_object_id() const
StringRef get_object_id_ref_for_api_() const
StringRef is a reference to a string owned by something else.
constexpr bool empty() const
static constexpr StringRef from_lit(const CharT(&s)[N])
Providing packet encoding functions for exchanging data with a remote host.
std::string str_sanitize(const std::string &str)
Sanitizes the input string by removing all characters but alphanumerics, dashes and underscores.
uint32_t fnv1_hash(const char *str)
Calculate a FNV-1 hash of str.
Application App
Global storage of Application pointer - only one Application can exist.
std::string str_snake_case(const std::string &str)
Convert the string to snake case (lowercase with underscores).