15 LOG_ENTITY_DEVICE_CLASS(tag, prefix, *obj);
19#ifdef USE_BINARY_SENSOR_RAW_CALLBACK
22#ifdef USE_BINARY_SENSOR_FILTER
26#ifdef USE_BINARY_SENSOR_FILTER
37#ifdef USE_BINARY_SENSOR_FILTER
39 if (!new_state.has_value()) {
46#if defined(USE_BINARY_SENSOR) && defined(USE_CONTROLLER_REGISTRY)
47 ControllerRegistry::notify_binary_sensor_update(
this);
49 ESP_LOGV(TAG,
"'%s' >> %s", LOG_STR_ARG(this->
get_log_name()), ONOFFMAYBE(new_state));
55#ifdef USE_BINARY_SENSOR_FILTER
62 while (last_filter->
next_ !=
nullptr)
63 last_filter = last_filter->
next_;
64 last_filter->
next_ = filter;
68 for (
Filter *filter : filters) {
const LogString * get_log_name() const
Get the name for a "%s" log argument (LOG_STR_ARG).
virtual bool set_new_state(const optional< T > &new_state)
Apply a new state, de-duplicating and firing callbacks as needed.
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)
LazyCallbackManager< void(bool)> raw_callback_
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)
ESPHOME_LOG_TAG(TAG, "binary_sensor.automation")
bool log_entity_header(const char *tag, const char *prefix, const char *type, const EntityBase *obj)
Log "<prefix><type> '<name>'" for a dump_config header; returns false when obj is null.