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_);
38 " Upper threshold: %.11f\n"
39 " Lower threshold: %.11f",
TemplatableValue< float > lower_threshold_
TemplatableValue< float > upper_threshold_
void dump_config() override
void set_sensor(sensor::Sensor *analog_sensor)
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 f...
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.