6namespace binary_sensor {
8static const char *
const TAG =
"binary_sensor";
36 this->
state = new_state;
39 ESP_LOGD(TAG,
"'%s': New state is %s", this->
get_name().c_str(), ONOFF(new_state));
49 while (last_filter->
next_ !=
nullptr)
50 last_filter = last_filter->
next_;
51 last_filter->
next_ = filter;
55 for (
Filter *filter : filters) {
StringRef get_device_class_ref() const
Get the device class as StringRef.
const StringRef & get_name() const
bool set_state_(const optional< bool > &state)
constexpr const char * c_str() const
constexpr bool empty() const
Base class for all binary_sensor-type classes.
void add_filters(const std::vector< Filter * > &filters)
void publish_state(bool new_state)
Publish a new state to the front-end.
void send_state_internal(bool new_state)
void publish_initial_state(bool new_state)
Publish the initial state, this will not make the callback manager send callbacks and is meant only f...
void add_filter(Filter *filter)
virtual bool is_status_binary_sensor() const
Return whether this binary sensor has outputted a state.
virtual void input(bool value)
void log_binary_sensor(const char *tag, const char *prefix, const char *type, BinarySensor *obj)
Providing packet encoding functions for exchanging data with a remote host.