ESPHome  2022.9.1
Public Member Functions | Protected Member Functions | Protected Attributes
esphome::api::UserServiceBase< Ts > Class Template Referenceabstract

#include <user_services.h>

Inheritance diagram for esphome::api::UserServiceBase< Ts >:
esphome::api::UserServiceDescriptor

Public Member Functions

 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

virtual void execute (Ts... x)=0
 
template<int... S>
void execute_ (std::vector< ExecuteServiceArgument > args, seq< S... > type)
 

Protected Attributes

std::string name_
 
uint32_t key_ {0}
 
std::array< std::string, sizeof...(Ts)> arg_names_
 

Detailed Description

template<typename... Ts>
class esphome::api::UserServiceBase< Ts >

Definition at line 23 of file user_services.h.

Constructor & Destructor Documentation

◆ UserServiceBase()

template<typename... Ts>
esphome::api::UserServiceBase< Ts >::UserServiceBase ( std::string  name,
const std::array< std::string, sizeof...(Ts)> &  arg_names 
)
inline

Definition at line 25 of file user_services.h.

Member Function Documentation

◆ encode_list_service_response()

template<typename... Ts>
ListEntitiesServicesResponse esphome::api::UserServiceBase< Ts >::encode_list_service_response ( )
inlineoverridevirtual

Implements esphome::api::UserServiceDescriptor.

Definition at line 30 of file user_services.h.

◆ execute()

template<typename... Ts>
virtual void esphome::api::UserServiceBase< Ts >::execute ( Ts...  x)
protectedpure virtual

◆ execute_()

template<typename... Ts>
template<int... S>
void esphome::api::UserServiceBase< Ts >::execute_ ( std::vector< ExecuteServiceArgument args,
seq< S... >  type 
)
inlineprotected

Definition at line 55 of file user_services.h.

◆ execute_service()

template<typename... Ts>
bool esphome::api::UserServiceBase< Ts >::execute_service ( const ExecuteServiceRequest req)
inlineoverridevirtual

Implements esphome::api::UserServiceDescriptor.

Definition at line 44 of file user_services.h.

Field Documentation

◆ arg_names_

template<typename... Ts>
std::array<std::string, sizeof...(Ts)> esphome::api::UserServiceBase< Ts >::arg_names_
protected

Definition at line 61 of file user_services.h.

◆ key_

template<typename... Ts>
uint32_t esphome::api::UserServiceBase< Ts >::key_ {0}
protected

Definition at line 60 of file user_services.h.

◆ name_

template<typename... Ts>
std::string esphome::api::UserServiceBase< Ts >::name_
protected

Definition at line 59 of file user_services.h.


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