8static const char *
const TAG =
"binary_sensor";
17 LOG_ENTITY_DEVICE_CLASS(tag, prefix, *obj);
33 this->
state = new_state;
41#if defined(USE_BINARY_SENSOR) && defined(USE_CONTROLLER_REGISTRY)
44 ESP_LOGD(TAG,
"'%s' >> %s", this->
get_name().c_str(), ONOFFMAYBE(new_state));
56 while (last_filter->
next_ !=
nullptr)
57 last_filter = last_filter->
next_;
58 last_filter->
next_ = filter;
62 for (
Filter *filter : filters) {
static void notify_binary_sensor_update(binary_sensor::BinarySensor *obj)
const StringRef & get_name() const
virtual bool set_new_state(const optional< T > &new_state)
Set a new state for this entity.
constexpr const char * c_str() const
Base class for all binary_sensor-type classes.
void add_filters(std::initializer_list< 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)
bool set_new_state(const optional< bool > &new_state) override
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)