ESPHome 2026.11.0-dev
Loading...
Searching...
No Matches
esphome::homeassistant Namespace Reference

Data Structures

class  HomeassistantBinarySensor
 
class  HomeassistantButton
 
class  HomeassistantLight
 A light in Home Assistant, driven from here: its state and attributes are imported over the native API, and every change made on this side is sent back as a light.turn_on or light.turn_off action. More...
 
class  HomeassistantNumber
 
class  HomeassistantSelect
 Mirrors a Home Assistant select or input_select entity. More...
 
class  HomeassistantSensor
 
class  HomeassistantSwitch
 
class  HomeassistantText
 
class  HomeassistantTextSensor
 
class  HomeassistantTime
 

Functions

 ESPHOME_LOG_TAG (TAG, "homeassistant.binary_sensor")
 
 ESPHOME_LOG_TAG (TAG, "homeassistant.button")
 
 PROGMEM_STRING_TABLE (UnsetValues, "None", "unavailable", "unknown")
 
bool is_unset (StringRef value)
 True for what Home Assistant reports when there is no value: "None" for an attribute that is not set, "unavailable" and "unknown" for the state of an entity that is not ready.
 
template<typename C >
bool emit_utf8 (uint32_t code_point, C &on_char)
 Emit the UTF-8 encoding of a code point. Rejects NUL, which would end the item early.
 
template<typename C , typename O >
bool parse_python_list (StringRef src, C &&on_char, O &&on_item)
 Walk a list attribute as Home Assistant sends it: the Python repr of a list of strings, such as ‘['Low’, "It's high", 'caf\xe9'], or of an enum, such as[<ColorMode.HS: 'hs'>]`, where the quoted value stands for the item.
 
 ESPHOME_LOG_TAG (TAG, "homeassistant.light")
 
 ESPHOME_LOG_TAG (TAG, "homeassistant.number")
 
 ESPHOME_LOG_TAG (TAG, "homeassistant.select")
 
 ESPHOME_LOG_TAG (TAG, "homeassistant.sensor")
 
 ESPHOME_LOG_TAG (TAG, "homeassistant.switch")
 
 ESPHOME_LOG_TAG (TAG, "homeassistant.text")
 
 ESPHOME_LOG_TAG (TAG, "homeassistant.text_sensor")
 
 ESPHOME_LOG_TAG (TAG, "homeassistant.time")
 

Variables

HomeassistantTime * global_homeassistant_time = nullptr
 

Function Documentation

◆ emit_utf8()

template<typename C >
bool esphome::homeassistant::emit_utf8 ( uint32_t code_point,
C & on_char )

Emit the UTF-8 encoding of a code point. Rejects NUL, which would end the item early.

Definition at line 15 of file homeassistant.h.

◆ ESPHOME_LOG_TAG() [1/10]

esphome::homeassistant::ESPHOME_LOG_TAG ( TAG ,
"homeassistant.binary_sensor"  )

◆ ESPHOME_LOG_TAG() [2/10]

esphome::homeassistant::ESPHOME_LOG_TAG ( TAG ,
"homeassistant.button"  )

◆ ESPHOME_LOG_TAG() [3/10]

esphome::homeassistant::ESPHOME_LOG_TAG ( TAG ,
"homeassistant.light"  )

◆ ESPHOME_LOG_TAG() [4/10]

esphome::homeassistant::ESPHOME_LOG_TAG ( TAG ,
"homeassistant.number"  )

◆ ESPHOME_LOG_TAG() [5/10]

esphome::homeassistant::ESPHOME_LOG_TAG ( TAG ,
"homeassistant.select"  )

◆ ESPHOME_LOG_TAG() [6/10]

esphome::homeassistant::ESPHOME_LOG_TAG ( TAG ,
"homeassistant.sensor"  )

◆ ESPHOME_LOG_TAG() [7/10]

esphome::homeassistant::ESPHOME_LOG_TAG ( TAG ,
"homeassistant.switch"  )

◆ ESPHOME_LOG_TAG() [8/10]

esphome::homeassistant::ESPHOME_LOG_TAG ( TAG ,
"homeassistant.text"  )

◆ ESPHOME_LOG_TAG() [9/10]

esphome::homeassistant::ESPHOME_LOG_TAG ( TAG ,
"homeassistant.text_sensor"  )

◆ ESPHOME_LOG_TAG() [10/10]

esphome::homeassistant::ESPHOME_LOG_TAG ( TAG ,
"homeassistant.time"  )

◆ is_unset()

bool esphome::homeassistant::is_unset ( StringRef value)

True for what Home Assistant reports when there is no value: "None" for an attribute that is not set, "unavailable" and "unknown" for the state of an entity that is not ready.

Definition at line 9 of file homeassistant.cpp.

◆ parse_python_list()

template<typename C , typename O >
bool esphome::homeassistant::parse_python_list ( StringRef src,
C && on_char,
O && on_item )

Walk a list attribute as Home Assistant sends it: the Python repr of a list of strings, such as ‘['Low’, "It's high", 'caf\xe9'], or of an enum, such as[<ColorMode.HS: 'hs'>]`, where the quoted value stands for the item.

Calls on_char for each decoded byte of an item and on_item at the end of each item. Returns false on malformed input; the callbacks may already have run by then.

Definition at line 43 of file homeassistant.h.

◆ PROGMEM_STRING_TABLE()

esphome::homeassistant::PROGMEM_STRING_TABLE ( UnsetValues ,
"None" ,
"unavailable" ,
"unknown"  )

Variable Documentation

◆ global_homeassistant_time

HomeassistantTime * esphome::homeassistant::global_homeassistant_time = nullptr

Definition at line 17 of file homeassistant_time.cpp.