|
ESPHome 2026.4.0
|
#include <custom_api_device.h>
Public Member Functions | |
| bool | is_connected () const |
| Return if a client (such as Home Assistant) is connected to the native API. | |
| template<typename T , typename... Ts> | |
| void | register_service (void(T::*callback)(Ts...), const std::string &name, const std::array< std::string, sizeof...(Ts)> &arg_names) |
| Register a custom native API service that will show up in Home Assistant. | |
| template<typename T , typename... Ts> | |
| void | register_service (void(T::*callback)(Ts...), const std::string &name, const std::array< std::string, sizeof...(Ts)> &arg_names) |
| template<typename T > | |
| void | register_service (void(T::*callback)(), const std::string &name) |
| Register a custom native API service that will show up in Home Assistant. | |
| template<typename T > | |
| void | register_service (void(T::*callback)(), const std::string &name) |
| template<typename T > | |
| void | subscribe_homeassistant_state (void(T::*callback)(StringRef), const std::string &entity_id, const std::string &attribute="") |
| Subscribe to the state (or attribute state) of an entity from Home Assistant. | |
| template<typename T > | |
| ESPDEPRECATED ("Use void callback(StringRef) instead. Will be removed in 2027.1.0.", "2026.1.0") void subscribe_homeassistant_state(void(T | |
| Subscribe to the state (or attribute state) of an entity from Home Assistant (legacy std::string version). | |
| template<typename T > | |
| void | subscribe_homeassistant_state (void(T::*callback)(const std::string &, StringRef), const std::string &entity_id, const std::string &attribute="") |
| Subscribe to the state (or attribute state) of an entity from Home Assistant. | |
| template<typename T > | |
| ESPDEPRECATED ("Use void callback(const std::string &, StringRef) instead. Will be removed in 2027.1.0.", "2026.1.0") void subscribe_homeassistant_state(void(T | |
| Subscribe to the state (or attribute state) of an entity from Home Assistant (legacy std::string version). | |
| template<typename T > | |
| void | subscribe_homeassistant_state (void(T::*callback)(StringRef), const std::string &entity_id, const std::string &attribute="") |
| template<typename T > | |
| void | subscribe_homeassistant_state (void(T::*callback)(std::string), const std::string &entity_id, const std::string &attribute="") |
| template<typename T > | |
| void | subscribe_homeassistant_state (void(T::*callback)(const std::string &, StringRef), const std::string &entity_id, const std::string &attribute="") |
| template<typename T > | |
| void | subscribe_homeassistant_state (void(T::*callback)(std::string, std::string), const std::string &entity_id, const std::string &attribute="") |
| void | call_homeassistant_service (const std::string &service_name) |
| Call a Home Assistant service from ESPHome. | |
| void | call_homeassistant_service (const std::string &service_name, const std::map< std::string, std::string > &data) |
| Call a Home Assistant service from ESPHome. | |
| void | fire_homeassistant_event (const std::string &event_name) |
| Fire an ESPHome event in Home Assistant. | |
| void | fire_homeassistant_event (const std::string &service_name, const std::map< std::string, std::string > &data) |
| Fire an ESPHome event in Home Assistant. | |
| template<typename T = void> | |
| void | call_homeassistant_service (const std::string &service_name) |
| template<typename T = void> | |
| void | call_homeassistant_service (const std::string &service_name, const std::map< std::string, std::string > &data) |
| template<typename T = void> | |
| void | fire_homeassistant_event (const std::string &event_name) |
| template<typename T = void> | |
| void | fire_homeassistant_event (const std::string &service_name, const std::map< std::string, std::string > &data) |
Definition at line 29 of file custom_api_device.h.
|
inline |
Call a Home Assistant service from ESPHome.
Usage:
| service_name | The service to call. |
Definition at line 248 of file custom_api_device.h.
|
inline |
Definition at line 323 of file custom_api_device.h.
|
inline |
Call a Home Assistant service from ESPHome.
Usage:
| service_name | The service to call. |
| data | The data for the service call, mapping from string to string. |
Definition at line 268 of file custom_api_device.h.
|
inline |
Definition at line 329 of file custom_api_device.h.
|
inline |
Subscribe to the state (or attribute state) of an entity from Home Assistant (legacy std::string version).
Definition at line 193 of file custom_api_device.h.
|
inline |
Subscribe to the state (or attribute state) of an entity from Home Assistant (legacy std::string version).
Definition at line 149 of file custom_api_device.h.
|
inline |
Fire an ESPHome event in Home Assistant.
Usage:
| event_name | The event to fire. |
Definition at line 290 of file custom_api_device.h.
|
inline |
Definition at line 334 of file custom_api_device.h.
|
inline |
Fire an ESPHome event in Home Assistant.
Usage:
| event_name | The event to fire. |
| data | The data for the event, mapping from string to string. |
Definition at line 310 of file custom_api_device.h.
|
inline |
Definition at line 340 of file custom_api_device.h.
|
inline |
Return if a client (such as Home Assistant) is connected to the native API.
Definition at line 32 of file custom_api_device.h.
|
inline |
Register a custom native API service that will show up in Home Assistant.
Usage:
| T | The class type creating the service, automatically deduced from the function pointer. |
| callback | The member function to call when the service is triggered. |
| name | The name of the arguments for the service, must match the arguments of the function. |
Definition at line 97 of file custom_api_device.h.
|
inline |
Definition at line 108 of file custom_api_device.h.
|
inline |
Register a custom native API service that will show up in Home Assistant.
Usage:
| T | The class type creating the service, automatically deduced from the function pointer. |
| Ts | The argument types for the service, automatically deduced from the function arguments. |
| callback | The member function to call when the service is triggered. |
| name | The name of the service to register. |
| arg_names | The name of the arguments for the service, must match the arguments of the function. |
Definition at line 57 of file custom_api_device.h.
|
inline |
Definition at line 70 of file custom_api_device.h.
|
inline |
Subscribe to the state (or attribute state) of an entity from Home Assistant.
Usage:
| T | The class type creating the service, automatically deduced from the function pointer. |
| callback | The member function to call when the entity state changes (zero-allocation for state). |
| entity_id | The entity_id to track. |
| attribute | The entity state attribute to track. |
Definition at line 180 of file custom_api_device.h.
|
inline |
Definition at line 221 of file custom_api_device.h.
|
inline |
Definition at line 213 of file custom_api_device.h.
|
inline |
Definition at line 229 of file custom_api_device.h.
|
inline |
Subscribe to the state (or attribute state) of an entity from Home Assistant.
Usage:
| T | The class type creating the service, automatically deduced from the function pointer. |
| callback | The member function to call when the entity state changes (zero-allocation). |
| entity_id | The entity_id to track. |
| attribute | The entity state attribute to track. |
Definition at line 137 of file custom_api_device.h.
|
inline |
Definition at line 205 of file custom_api_device.h.