ESPHome 2025.8.0b2
|
Simple helper class to expose a touch pad value as a binary sensor. More...
#include <esp32_touch.h>
Public Member Functions | |
ESP32TouchBinarySensor (touch_pad_t touch_pad, uint32_t threshold, uint32_t wakeup_threshold) | |
touch_pad_t | get_touch_pad () const |
uint32_t | get_threshold () const |
void | set_threshold (uint32_t threshold) |
uint32_t | get_value () const |
Get the raw touch measurement value. | |
uint32_t | get_wakeup_threshold () const |
![]() | |
BinarySensor () | |
void | publish_state (bool new_state) |
Publish a new state to the front-end. | |
void | publish_initial_state (bool new_state) |
Publish the initial state, this will not make the callback manager send callbacks and is meant only for the initial state on boot. | |
void | add_filter (Filter *filter) |
void | add_filters (const std::vector< Filter * > &filters) |
void | send_state_internal (bool new_state) |
virtual bool | is_status_binary_sensor () const |
Return whether this binary sensor has outputted a state. | |
![]() | |
virtual bool | has_state () const |
virtual const bool & | get_state () const |
virtual bool | get_state_default (bool default_value) const |
void | invalidate_state () |
void | add_full_state_callback (std::function< void(optional< bool > previous, optional< bool > current)> &&callback) |
void | add_on_state_callback (std::function< void(bool)> &&callback) |
void | set_trigger_on_initial_state (bool trigger_on_initial_state) |
![]() | |
const StringRef & | get_name () const |
void | set_name (const char *name) |
bool | has_own_name () const |
std::string | get_object_id () const |
void | set_object_id (const char *object_id) |
uint32_t | get_object_id_hash () |
bool | is_internal () const |
void | set_internal (bool internal) |
bool | is_disabled_by_default () const |
void | set_disabled_by_default (bool disabled_by_default) |
EntityCategory | get_entity_category () const |
void | set_entity_category (EntityCategory entity_category) |
std::string | get_icon () const |
void | set_icon (const char *icon) |
StringRef | get_icon_ref () const |
uint32_t | get_device_id () const |
void | set_device (Device *device) |
bool | has_state () const |
void | set_has_state (bool state) |
![]() | |
std::string | get_device_class () |
Get the device class, using the manual override if set. | |
void | set_device_class (const char *device_class) |
Manually set the device class. | |
StringRef | get_device_class_ref () const |
Get the device class as StringRef. | |
Protected Attributes | |
friend | ESP32TouchComponent |
touch_pad_t | touch_pad_ {TOUCH_PAD_MAX} |
uint32_t | threshold_ {0} |
uint32_t | benchmark_ {} |
uint32_t | value_ {0} |
Stores the last raw touch measurement value. | |
bool | last_state_ {false} |
const uint32_t | wakeup_threshold_ {0} |
uint32_t | last_touch_time_ {} |
bool | initial_state_published_ {} |
![]() | |
Filter * | filter_list_ {nullptr} |
![]() | |
optional< bool > | state_ |
bool | trigger_on_initial_state_ |
CallbackManager< void(optional< bool > previous, optional< bool > current)> * | full_state_callbacks_ |
CallbackManager< void(bool)> * | state_callbacks_ |
![]() | |
StringRef | name_ |
const char * | object_id_c_str_ {nullptr} |
const char * | icon_c_str_ {nullptr} |
uint32_t | object_id_hash_ {} |
Device * | device_ {} |
struct esphome::EntityBase::EntityFlags | flags_ |
![]() | |
const char * | device_class_ {nullptr} |
Device class override. | |
Additional Inherited Members | |
![]() | |
bool | state {} |
![]() | |
bool | set_state_ (const optional< bool > &state) |
Set a new state for this entity. | |
![]() | |
virtual uint32_t | hash_base () |
The hash_base() function has been deprecated. | |
void | calc_object_id_ () |
Simple helper class to expose a touch pad value as a binary sensor.
Definition at line 229 of file esp32_touch.h.
|
inline |
Definition at line 231 of file esp32_touch.h.
|
inline |
Definition at line 235 of file esp32_touch.h.
|
inline |
Definition at line 234 of file esp32_touch.h.
|
inline |
Get the raw touch measurement value.
Definition at line 242 of file esp32_touch.h.
|
inline |
Definition at line 244 of file esp32_touch.h.
|
inline |
Definition at line 236 of file esp32_touch.h.
|
protected |
Definition at line 251 of file esp32_touch.h.
|
protected |
Definition at line 247 of file esp32_touch.h.
|
protected |
Definition at line 265 of file esp32_touch.h.
|
protected |
Definition at line 254 of file esp32_touch.h.
|
protected |
Definition at line 264 of file esp32_touch.h.
|
protected |
Definition at line 250 of file esp32_touch.h.
|
protected |
Definition at line 249 of file esp32_touch.h.
|
protected |
Stores the last raw touch measurement value.
Definition at line 253 of file esp32_touch.h.
|
protected |
Definition at line 255 of file esp32_touch.h.