ESPHome 2025.12.0-dev
Loading...
Searching...
No Matches
esphome::EntityBase_DeviceClass Class Reference

#include <entity_base.h>

Inheritance diagram for esphome::EntityBase_DeviceClass:
esphome::binary_sensor::BinarySensor esphome::button::Button esphome::cover::Cover esphome::event::Event esphome::number::NumberTraits esphome::sensor::Sensor esphome::switch_::Switch esphome::text_sensor::TextSensor esphome::update::UpdateEntity esphome::valve::Valve

Public Member Functions

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.
 
StringRef get_device_class_ref () const
 Get the device class as StringRef.
 

Protected Attributes

const char * device_class_ {nullptr}
 Device class override.
 

Detailed Description

Definition at line 158 of file entity_base.h.

Member Function Documentation

◆ get_device_class_ref()

StringRef esphome::EntityBase_DeviceClass::get_device_class_ref ( ) const
inline

Get the device class as StringRef.

Definition at line 168 of file entity_base.h.

◆ set_device_class()

void esphome::EntityBase_DeviceClass::set_device_class ( const char * device_class)

Get the device class, using the manual override if set.

Manually set the device class.

Definition at line 92 of file entity_base.cpp.

Field Documentation

◆ device_class_

const char* esphome::EntityBase_DeviceClass::device_class_ {nullptr}
protected

Device class override.

Definition at line 174 of file entity_base.h.


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