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

Adds on/off helpers. Derived must provide state() (bool state) and set_power(bool). More...

#include <entity_handles.hpp>

Inheritance diagram for esphome::api::ToggleEntity< Derived >:
Inheritance graph
[legend]
Collaboration diagram for esphome::api::ToggleEntity< Derived >:
Collaboration graph
[legend]

Public Member Functions

bool is_on () const
 
void turn_on ()
 
void turn_off ()
 
void toggle ()
 
- Public Member Functions inherited from esphome::api::TypedEntity< Derived >
std::string icon () const
 
bool disabled_by_default () const
 
EntityCategory entity_category () const
 
std::uint32_t device_id () const
 
 Entity (Client &client, const std::uint32_t key, std::string object_id, std::string name)
 
- Public Member Functions inherited from esphome::api::Entity
 Entity (Client &client, const std::uint32_t key, std::string object_id, std::string name)
 
std::uint32_t key () const noexcept
 
const std::string & object_id () const noexcept
 
const std::string & name () const noexcept
 

Additional Inherited Members

- Protected Attributes inherited from esphome::api::Entity
Clientclient_
 
std::uint32_t key_
 
std::string object_id_
 
std::string name_
 

Detailed Description

template<class Derived>
class esphome::api::ToggleEntity< Derived >

Adds on/off helpers. Derived must provide state() (bool state) and set_power(bool).

Member Function Documentation

◆ is_on()

template<class Derived >
bool esphome::api::ToggleEntity< Derived >::is_on ( ) const
inline

◆ toggle()

template<class Derived >
void esphome::api::ToggleEntity< Derived >::toggle ( )
inline

◆ turn_off()

template<class Derived >
void esphome::api::ToggleEntity< Derived >::turn_off ( )
inline

◆ turn_on()

template<class Derived >
void esphome::api::ToggleEntity< Derived >::turn_on ( )
inline

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