esphome-api-client 0.5.0
Modern C++17 client for the ESPHome native API (plaintext + Noise)
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
esphome::api::HomeAssistantServices Class Reference

Discovers user-defined services and invokes them. More...

#include <home_assistant_services.hpp>

Inheritance diagram for esphome::api::HomeAssistantServices:
Inheritance graph
[legend]
Collaboration diagram for esphome::api::HomeAssistantServices:
Collaboration graph
[legend]

Public Types

using ServiceHandler = std::function< void(const UserService &)>
 

Public Member Functions

 HomeAssistantServices (Client &client)
 
void on_service (ServiceHandler handler)
 Register a callback fired for each ListEntitiesServicesResponse (call before list_entities()).
 
void execute (std::uint32_t key, const std::vector< ServiceValue > &args, bool return_response=false)
 Invoke a service by key with positional arguments.
 
const std::vector< UserService > & services () const noexcept
 
- Public Member Functions inherited from esphome::api::Subsystem
 Subsystem (Client &client)
 

Additional Inherited Members

- Protected Attributes inherited from esphome::api::Subsystem
Clientclient_
 

Detailed Description

Discovers user-defined services and invokes them.

Member Typedef Documentation

◆ ServiceHandler

Constructor & Destructor Documentation

◆ HomeAssistantServices()

esphome::api::HomeAssistantServices::HomeAssistantServices ( Client client)
inlineexplicit

Member Function Documentation

◆ execute()

void esphome::api::HomeAssistantServices::execute ( std::uint32_t  key,
const std::vector< ServiceValue > &  args,
bool  return_response = false 
)

Invoke a service by key with positional arguments.

◆ on_service()

void esphome::api::HomeAssistantServices::on_service ( ServiceHandler  handler)

Register a callback fired for each ListEntitiesServicesResponse (call before list_entities()).

Discovered services accumulate in services().

◆ services()

const std::vector< UserService > & esphome::api::HomeAssistantServices::services ( ) const
inlinenoexcept

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