|
ESPHome 2025.12.0-dev
|
#include <entity_base.h>
Public Member Functions | |
| 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. | |
| StringRef | get_unit_of_measurement_ref () const |
| Get the unit of measurement as StringRef. | |
Protected Attributes | |
| const char * | unit_of_measurement_ {nullptr} |
| Unit of measurement override. | |
Definition at line 177 of file entity_base.h.
|
inline |
Get the unit of measurement as StringRef.
Definition at line 187 of file entity_base.h.
| void esphome::EntityBase_UnitOfMeasurement::set_unit_of_measurement | ( | const char * | unit_of_measurement | ) |
Get the unit of measurement, using the manual override if set.
Manually set the unit of measurement.
Definition at line 99 of file entity_base.cpp.
|
protected |
Unit of measurement override.
Definition at line 193 of file entity_base.h.