9#ifdef USE_BINARY_SENSOR
14namespace duty_time_sensor {
18 void setup()
override;
29#ifdef USE_BINARY_SENSOR
41 std::function<bool()>
func_{
nullptr};
55 void play(Ts...
x)
override { this->
parent_->start(); }
63 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_
float get_setup_priority() const override
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.
const float DATA
For components that import data from directly connected sensors like DHT.
Providing packet encoding functions for exchanging data with a remote host.