9 #ifdef USE_BINARY_SENSOR 14 namespace 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(); }
59 void play(Ts...
x)
override { this->parent_->
stop(); }
63 void play(Ts...
x)
override { this->parent_->reset(); }
71 bool check(Ts...
x)
override {
return this->parent_->is_running() == this->state_; }
float get_setup_priority() const override
ESPPreferenceObject pref_
const float DATA
For components that import data from directly connected sensors like DHT.
sensor::Sensor * last_duty_time_sensor_
void set_last_duty_time_sensor(sensor::Sensor *sensor)
void dump_config() override
bool check(Ts... x) override
void set_restore(bool restore)
This class simplifies creating components that periodically check a state.
RunningCondition(DutyTimeSensor *parent, bool state)
float state
This member variable stores the last state that has passed through all filters.
void set_lambda(std::function< bool()> &&func)
Base class for all automation conditions.
std::function< bool()> func_
void publish_and_save_(uint32_t sec, uint32_t ms)
void set_sensor(binary_sensor::BinarySensor *sensor)
void process_state_(bool state)
Implementation of SPI Controller mode.
void set_value_(uint32_t sec)
Base class for all binary_sensor-type classes.
Base-class for all sensors.
esphome::sensor::Sensor * sensor
Helper class to easily give an object a parent of type T.