ESPHome
1.15.3
|
#include <tuya_binary_sensor.h>
Public Member Functions | |
void | setup () override |
void | dump_config () override |
void | set_sensor_id (uint8_t sensor_id) |
void | set_tuya_parent (Tuya *parent) |
![]() | |
BinarySensor () | |
BinarySensor (const std::string &name) | |
Construct a binary sensor with the specified name. More... | |
void | add_on_state_callback (std::function< void(bool)> &&callback) |
Add a callback to be notified of state changes. More... | |
void | publish_state (bool state) |
Publish a new state to the front-end. More... | |
void | publish_initial_state (bool state) |
Publish the initial state, this will not make the callback manager send callbacks and is meant only for the initial state on boot. More... | |
void | set_device_class (const std::string &device_class) |
Manually set the Home Assistant device class (see binary_sensor::device_class) More... | |
std::string | get_device_class () |
Get the device class for this binary sensor, using the manual override if specified. More... | |
void | add_filter (Filter *filter) |
void | add_filters (std::vector< Filter *> filters) |
void | send_state_internal (bool state, bool is_initial) |
virtual bool | has_state () const |
Return whether this binary sensor has outputted a state. More... | |
virtual bool | is_status_binary_sensor () const |
virtual std::string | device_class () |
Get the default device class for this sensor, or empty string for no default. More... | |
![]() | |
Nameable () | |
Nameable (const std::string &name) | |
const std::string & | get_name () const |
void | set_name (const std::string &name) |
const std::string & | get_object_id () |
Get the sanitized name of this nameable as an ID. Caching it internally. More... | |
uint32_t | get_object_id_hash () |
bool | is_internal () const |
void | set_internal (bool internal) |
![]() | |
virtual void | loop () |
This method will be called repeatedly. More... | |
virtual float | get_setup_priority () const |
priority of setup(). More... | |
float | get_actual_setup_priority () const |
void | set_setup_priority (float priority) |
virtual float | get_loop_priority () const |
priority of loop(). More... | |
void | call () |
virtual void | on_shutdown () |
virtual void | on_safe_shutdown () |
uint32_t | get_component_state () const |
virtual void | mark_failed () |
Mark this component as failed. More... | |
bool | is_failed () |
virtual bool | can_proceed () |
bool | status_has_warning () |
bool | status_has_error () |
void | status_set_warning () |
void | status_set_error () |
void | status_clear_warning () |
void | status_clear_error () |
void | status_momentary_warning (const std::string &name, uint32_t length=5000) |
void | status_momentary_error (const std::string &name, uint32_t length=5000) |
bool | has_overridden_loop () const |
Protected Attributes | |
Tuya * | parent_ |
uint8_t | sensor_id_ {0} |
![]() | |
CallbackManager< void(bool)> | state_callback_ {} |
optional< std::string > | device_class_ {} |
Stores the override of the device class. More... | |
Filter * | filter_list_ {nullptr} |
bool | has_state_ {false} |
Deduplicator< bool > | publish_dedup_ |
![]() | |
std::string | name_ |
std::string | object_id_ |
uint32_t | object_id_hash_ |
bool | internal_ {false} |
![]() | |
uint32_t | component_state_ {0x0000} |
State of this component. More... | |
float | setup_priority_override_ {NAN} |
Additional Inherited Members | |
![]() | |
bool | state |
The current reported state of the binary sensor. More... | |
![]() | |
uint32_t | hash_base () override |
![]() | |
void | calc_object_id_ () |
![]() | |
virtual void | call_loop () |
virtual void | call_setup () |
void | set_interval (const std::string &name, uint32_t interval, std::function< void()> &&f) |
Set an interval function with a unique name. More... | |
void | set_interval (uint32_t interval, std::function< void()> &&f) |
bool | cancel_interval (const std::string &name) |
Cancel an interval function. More... | |
void | set_timeout (uint32_t timeout, std::function< void()> &&f) |
void | set_timeout (const std::string &name, uint32_t timeout, std::function< void()> &&f) |
Set a timeout function with a unique name. More... | |
bool | cancel_timeout (const std::string &name) |
Cancel a timeout function. More... | |
void | defer (const std::string &name, std::function< void()> &&f) |
Defer a callback to the next loop() call. More... | |
void | defer (std::function< void()> &&f) |
Defer a callback to the next loop() call. More... | |
bool | cancel_defer (const std::string &name) |
Cancel a defer callback using the specified name, name must not be empty. More... | |
Definition at line 10 of file tuya_binary_sensor.h.
|
overridevirtual |
Reimplemented from esphome::Component.
Definition at line 16 of file tuya_binary_sensor.cpp.
|
inline |
Definition at line 14 of file tuya_binary_sensor.h.
|
inline |
Definition at line 16 of file tuya_binary_sensor.h.
|
overridevirtual |
Reimplemented from esphome::Component.
Definition at line 9 of file tuya_binary_sensor.cpp.
|
protected |
Definition at line 19 of file tuya_binary_sensor.h.
|
protected |
Definition at line 20 of file tuya_binary_sensor.h.