ESPHome  2024.10.2
Public Member Functions | Protected Member Functions | Protected Attributes
esphome::api::CustomAPIDeviceService< T, Ts > Class Template Reference

#include <custom_api_device.h>

Inheritance diagram for esphome::api::CustomAPIDeviceService< T, Ts >:
esphome::api::UserServiceBase< Ts... > esphome::api::UserServiceDescriptor

Public Member Functions

 CustomAPIDeviceService (const std::string &name, const std::array< std::string, sizeof...(Ts)> &arg_names, T *obj, void(T::*callback)(Ts...))
 
- Public Member Functions inherited from esphome::api::UserServiceBase< Ts... >
 UserServiceBase (std::string name, const std::array< std::string, sizeof...(Ts)> &arg_names)
 
ListEntitiesServicesResponse encode_list_service_response () override
 
bool execute_service (const ExecuteServiceRequest &req) override
 

Protected Member Functions

void execute (Ts... x) override
 
- Protected Member Functions inherited from esphome::api::UserServiceBase< Ts... >
void execute_ (std::vector< ExecuteServiceArgument > args, seq< S... > type)
 

Protected Attributes

T * obj_
 
void(T::* callback_ )(Ts...)
 
- Protected Attributes inherited from esphome::api::UserServiceBase< Ts... >
std::string name_
 
uint32_t key_
 
std::array< std::string, sizeof...(Ts)> arg_names_
 

Detailed Description

template<typename T, typename... Ts>
class esphome::api::CustomAPIDeviceService< T, Ts >

Definition at line 10 of file custom_api_device.h.

Constructor & Destructor Documentation

◆ CustomAPIDeviceService()

template<typename T, typename... Ts>
esphome::api::CustomAPIDeviceService< T, Ts >::CustomAPIDeviceService ( const std::string &  name,
const std::array< std::string, sizeof...(Ts)> &  arg_names,
T *  obj,
void(T::*)(Ts...)  callback 
)
inline

Definition at line 12 of file custom_api_device.h.

Member Function Documentation

◆ execute()

template<typename T, typename... Ts>
void esphome::api::CustomAPIDeviceService< T, Ts >::execute ( Ts...  x)
inlineoverrideprotectedvirtual

Implements esphome::api::UserServiceBase< Ts... >.

Definition at line 17 of file custom_api_device.h.

Field Documentation

◆ callback_

template<typename T, typename... Ts>
void(T::* esphome::api::CustomAPIDeviceService< T, Ts >::callback_) (Ts...)
protected

Definition at line 20 of file custom_api_device.h.

◆ obj_

template<typename T, typename... Ts>
T* esphome::api::CustomAPIDeviceService< T, Ts >::obj_
protected

Definition at line 19 of file custom_api_device.h.


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