5namespace analog_threshold {
7static const char *
const TAG =
"analog_threshold.binary_sensor";
14 if (std::isnan(sensor_value)) {
27 if (!std::isnan(sensor_value)) {
35 LOG_BINARY_SENSOR(
"",
"Analog Threshold Binary Sensor",
this);
36 LOG_SENSOR(
" ",
"Sensor", this->
sensor_);
TemplatableValue< float > lower_threshold_
TemplatableValue< float > upper_threshold_
void dump_config() override
void set_sensor(sensor::Sensor *analog_sensor)
void publish_initial_state(bool state)
Publish the initial state, this will not make the callback manager send callbacks and is meant only f...
bool state
The current reported state of the binary sensor.
void publish_state(bool state)
Publish a new state to the front-end.
Base-class for all sensors.
float get_state() const
Getter-syntax for .state.
void add_on_state_callback(std::function< void(float)> &&callback)
Add a callback that will be called every time a filtered value arrives.
Providing packet encoding functions for exchanging data with a remote host.