ESPHome  2024.11.0
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 24 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 26 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 31 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 56 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 45 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 62 of file user_services.h.

◆ key_

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

Definition at line 61 of file user_services.h.

◆ name_

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

Definition at line 60 of file user_services.h.


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