9#ifdef USE_BINARY_SENSOR
14namespace duty_time_sensor {
18 void setup()
override;
28#ifdef USE_BINARY_SENSOR
40 std::function<bool()>
func_{
nullptr};
54 void play(Ts...
x)
override { this->
parent_->start(); }
62 void play(Ts...
x)
override { this->
parent_->reset(); }
Base class for all automation conditions.
Helper class to easily give an object a parent of type T.
This class simplifies creating components that periodically check a state.
Base class for all binary_sensor-type classes.
void set_restore(bool restore)
sensor::Sensor * last_duty_time_sensor_
void dump_config() override
std::function< bool()> func_
void publish_and_save_(uint32_t sec, uint32_t ms)
ESPPreferenceObject pref_
void process_state_(bool state)
void set_lambda(std::function< bool()> &&func)
void set_value_(uint32_t sec)
void set_sensor(binary_sensor::BinarySensor *sensor)
void set_last_duty_time_sensor(sensor::Sensor *sensor)
bool check(Ts... x) override
RunningCondition(DutyTimeSensor *parent, bool state)
Base-class for all sensors.
float state
This member variable stores the last state that has passed through all filters.
Providing packet encoding functions for exchanging data with a remote host.