ESPHome 2026.1.0-dev
Loading...
Searching...
No Matches
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 (const char *name, const std::array< const char *, sizeof...(Ts)> &arg_names, enums::SupportsResponseType supports_response=enums::SUPPORTS_RESPONSE_NONE)
 
ListEntitiesServicesResponse encode_list_service_response () override
 
bool execute_service (const ExecuteServiceRequest &req) override
 
bool execute_service (const ExecuteServiceRequest &req, uint32_t action_call_id) override
 
- Public Member Functions inherited from esphome::api::UserServiceDescriptor
bool is_internal ()
 

Protected Member Functions

virtual void execute (uint32_t call_id, bool return_response, Ts... x)=0
 
template<typename ArgsContainer , size_t... S>
void execute_ (const ArgsContainer &args, uint32_t call_id, bool return_response, std::index_sequence< S... >)
 

Protected Attributes

const char * name_
 
std::array< const char *, sizeof...(Ts)> arg_names_
 
uint32_t key_ {0}
 
enums::SupportsResponseType supports_response_ {enums::SUPPORTS_RESPONSE_NONE}
 

Detailed Description

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

Definition at line 39 of file user_services.h.

Constructor & Destructor Documentation

◆ UserServiceBase()

template<typename... Ts>
esphome::api::UserServiceBase< Ts >::UserServiceBase ( const char * name,
const std::array< const char *, sizeof...(Ts)> & arg_names,
enums::SupportsResponseType supports_response = enums::SUPPORTS_RESPONSE_NONE )
inline

Definition at line 41 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 47 of file user_services.h.

◆ execute()

◆ execute_()

template<typename... Ts>
template<typename ArgsContainer , size_t... S>
void esphome::api::UserServiceBase< Ts >::execute_ ( const ArgsContainer & args,
uint32_t call_id,
bool return_response,
std::index_sequence< S... >  )
inlineprotected

Definition at line 89 of file user_services.h.

◆ execute_service() [1/2]

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

Implements esphome::api::UserServiceDescriptor.

Definition at line 62 of file user_services.h.

◆ execute_service() [2/2]

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

Implements esphome::api::UserServiceDescriptor.

Definition at line 76 of file user_services.h.

Field Documentation

◆ arg_names_

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

Definition at line 95 of file user_services.h.

◆ key_

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

Definition at line 96 of file user_services.h.

◆ name_

template<typename... Ts>
const char* esphome::api::UserServiceBase< Ts >::name_
protected

Definition at line 94 of file user_services.h.

◆ supports_response_

template<typename... Ts>
enums::SupportsResponseType esphome::api::UserServiceBase< Ts >::supports_response_ {enums::SUPPORTS_RESPONSE_NONE}
protected

Definition at line 97 of file user_services.h.


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