ESPHome  2024.12.0
Public Member Functions | Protected Attributes
esphome::EntityBase_UnitOfMeasurement Class Reference

#include <entity_base.h>

Inheritance diagram for esphome::EntityBase_UnitOfMeasurement:
esphome::number::NumberTraits esphome::sensor::Sensor esphome::a01nyub::A01nyubComponent esphome::a02yyuw::A02yyuwComponent esphome::absolute_humidity::AbsoluteHumidityComponent esphome::adc128s102::ADC128S102Sensor esphome::adc::ADCSensor esphome::ade7953_base::ADE7953 esphome::ads1115::ADS1115Sensor esphome::ads1118::ADS1118Sensor esphome::apds9306::APDS9306 esphome::as5600::AS5600Sensor esphome::bh1750::BH1750Sensor esphome::binary_sensor_map::BinarySensorMap esphome::ble_client::BLEClientRSSISensor esphome::ble_client::BLESensor esphome::ble_rssi::BLERSSISensor esphome::cd74hc4067::CD74HC4067Sensor esphome::combination::CombinationComponent esphome::copy::CopySensor esphome::ct_clamp::CTClampSensor esphome::dallas_temp::DallasTemperatureSensor esphome::demo::DemoSensor esphome::duty_cycle::DutyCycleSensor esphome::duty_time_sensor::DutyTimeSensor esphome::ens160_base::ENS160Component esphome::esp32_hall::ESP32HallSensor esphome::ezo::EZOSensor esphome::fs3000::FS3000Component esphome::gp2y1010au0f::GP2Y1010AU0FSensor esphome::homeassistant::HomeassistantSensor esphome::hrxl_maxsonar_wr::HrxlMaxsonarWrComponent esphome::hx711::HX711Sensor esphome::integration::IntegrationSensor esphome::internal_temperature::InternalTemperatureSensor esphome::jsn_sr04t::Jsnsr04tComponent esphome::ld2420::LD2420Sensor esphome::m5stack_8angle::M5Stack8AngleKnobSensor esphome::max31855::MAX31855Sensor esphome::max31856::MAX31856Sensor esphome::max31865::MAX31865Sensor esphome::max44009::MAX44009Sensor esphome::max6675::MAX6675Sensor esphome::mcp3008::MCP3008Sensor esphome::mcp3204::MCP3204Sensor esphome::mcp9808::MCP9808Sensor esphome::micronova::MicroNovaSensor esphome::modbus_controller::ModbusSensor esphome::mqtt_subscribe::MQTTSubscribeSensor esphome::nau7802::NAU7802Sensor esphome::nextion::NextionSensor esphome::ntc::NTC esphome::pid::PIDClimateSensor esphome::pulse_counter::PulseCounterSensor esphome::pulse_meter::PulseMeterSensor esphome::pulse_width::PulseWidthSensor esphome::resistance::ResistanceSensor esphome::rotary_encoder::RotaryEncoderSensor esphome::sdp3x::SDP3XComponent esphome::sen0321_sensor::Sen0321Sensor esphome::sen21231_sensor::Sen21231Sensor esphome::sgp4x::SGP4xComponent esphome::sml::SmlSensor esphome::sts3x::STS3XComponent esphome::sun::SunSensor esphome::tc74::TC74Component esphome::tee501::TEE501Component esphome::teleinfo::TeleInfoSensor esphome::template_::TemplateSensor esphome::tmp102::TMP102Component esphome::tmp1075::TMP1075Sensor esphome::tmp117::TMP117Component esphome::tof10120::TOF10120Sensor esphome::total_daily_energy::TotalDailyEnergy esphome::tsl2561::TSL2561Sensor esphome::tuya::TuyaSensor esphome::ultrasonic::UltrasonicSensorComponent esphome::uponor_smatrix::UponorSmatrixSensor esphome::uptime::UptimeSecondsSensor esphome::uptime::UptimeTimestampSensor esphome::vbus::VBusCustomSubSensor esphome::veml3235::VEML3235Sensor esphome::vl53l0x::VL53L0XSensor esphome::wifi_signal::WiFiSignalSensor esphome::xgzp68xx::XGZP68XXComponent esphome::zio_ultrasonic::ZioUltrasonicComponent

Public Member Functions

std::string get_unit_of_measurement ()
 Get the unit of measurement, using the manual override if set. More...
 
void set_unit_of_measurement (const char *unit_of_measurement)
 Manually set the unit of measurement. More...
 

Protected Attributes

const char * unit_of_measurement_ {nullptr}
 Unit of measurement override. More...
 

Detailed Description

Definition at line 77 of file entity_base.h.

Member Function Documentation

◆ get_unit_of_measurement()

std::string esphome::EntityBase_UnitOfMeasurement::get_unit_of_measurement ( )

Get the unit of measurement, using the manual override if set.

Definition at line 87 of file entity_base.cpp.

◆ set_unit_of_measurement()

void esphome::EntityBase_UnitOfMeasurement::set_unit_of_measurement ( const char *  unit_of_measurement)

Manually set the unit of measurement.

Definition at line 92 of file entity_base.cpp.

Field Documentation

◆ unit_of_measurement_

const char* esphome::EntityBase_UnitOfMeasurement::unit_of_measurement_ {nullptr}
protected

Unit of measurement override.

Definition at line 85 of file entity_base.h.


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