ESPHome  1.15.3
Public Member Functions | Protected Attributes
esphome::tuya::TuyaBinarySensor Class Reference

#include <tuya_binary_sensor.h>

Inheritance diagram for esphome::tuya::TuyaBinarySensor:
esphome::binary_sensor::BinarySensor esphome::Component esphome::Nameable

Public Member Functions

void setup () override
 
void dump_config () override
 
void set_sensor_id (uint8_t sensor_id)
 
void set_tuya_parent (Tuya *parent)
 
- Public Member Functions inherited from esphome::binary_sensor::BinarySensor
 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...
 
- Public Member Functions inherited from esphome::Nameable
 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)
 
- Public Member Functions inherited from esphome::Component
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

Tuyaparent_
 
uint8_t sensor_id_ {0}
 
- Protected Attributes inherited from esphome::binary_sensor::BinarySensor
CallbackManager< void(bool)> state_callback_ {}
 
optional< std::string > device_class_ {}
 Stores the override of the device class. More...
 
Filterfilter_list_ {nullptr}
 
bool has_state_ {false}
 
Deduplicator< bool > publish_dedup_
 
- Protected Attributes inherited from esphome::Nameable
std::string name_
 
std::string object_id_
 
uint32_t object_id_hash_
 
bool internal_ {false}
 
- Protected Attributes inherited from esphome::Component
uint32_t component_state_ {0x0000}
 State of this component. More...
 
float setup_priority_override_ {NAN}
 

Additional Inherited Members

- Data Fields inherited from esphome::binary_sensor::BinarySensor
bool state
 The current reported state of the binary sensor. More...
 
- Protected Member Functions inherited from esphome::binary_sensor::BinarySensor
uint32_t hash_base () override
 
- Protected Member Functions inherited from esphome::Nameable
void calc_object_id_ ()
 
- Protected Member Functions inherited from esphome::Component
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...
 

Detailed Description

Definition at line 10 of file tuya_binary_sensor.h.

Member Function Documentation

◆ dump_config()

void esphome::tuya::TuyaBinarySensor::dump_config ( )
overridevirtual

Reimplemented from esphome::Component.

Definition at line 16 of file tuya_binary_sensor.cpp.

◆ set_sensor_id()

void esphome::tuya::TuyaBinarySensor::set_sensor_id ( uint8_t  sensor_id)
inline

Definition at line 14 of file tuya_binary_sensor.h.

◆ set_tuya_parent()

void esphome::tuya::TuyaBinarySensor::set_tuya_parent ( Tuya parent)
inline

Definition at line 16 of file tuya_binary_sensor.h.

◆ setup()

void esphome::tuya::TuyaBinarySensor::setup ( )
overridevirtual

Reimplemented from esphome::Component.

Definition at line 9 of file tuya_binary_sensor.cpp.

Field Documentation

◆ parent_

Tuya* esphome::tuya::TuyaBinarySensor::parent_
protected

Definition at line 19 of file tuya_binary_sensor.h.

◆ sensor_id_

uint8_t esphome::tuya::TuyaBinarySensor::sensor_id_ {0}
protected

Definition at line 20 of file tuya_binary_sensor.h.


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