13namespace binary_sensor {
69 const uint32_t now =
millis();
148 void play(Ts...
x)
override {
149 auto val = this->state_.value(
x...);
virtual void play(Ts... x)=0
Base class for all automation conditions.
bool check(Ts... x) override
BinarySensorCondition(BinarySensor *parent, bool state)
Base class for all binary_sensor-type classes.
bool state
The current reported state of the binary sensor.
void add_on_state_callback(std::function< void(bool)> &&callback)
Add a callback to be notified of state changes.
void publish_state(bool state)
Publish a new state to the front-end.
BinarySensorPublishAction(BinarySensor *sensor)
TEMPLATABLE_VALUE(bool, state) void play(Ts... x) override
uint32_t min_length_
The millis() time when the click started.
uint32_t max_length_
Minimum length of click. 0 means no minimum.
ClickTrigger(BinarySensor *parent, uint32_t min_length, uint32_t max_length)
DoubleClickTrigger(BinarySensor *parent, uint32_t min_length, uint32_t max_length)
uint32_t max_length_
Minimum length of click. 0 means no minimum.
void schedule_cooldown_()
void set_invalid_cooldown(uint32_t invalid_cooldown)
uint32_t invalid_cooldown_
float get_setup_priority() const override
optional< size_t > at_index_
void schedule_is_valid_(uint32_t min_length)
MultiClickTrigger(BinarySensor *parent, std::vector< MultiClickTriggerEvent > timing)
void schedule_is_not_valid_(uint32_t max_length)
void on_state_(bool state)
std::vector< MultiClickTriggerEvent > timing_
PressTrigger(BinarySensor *parent)
ReleaseTrigger(BinarySensor *parent)
StateTrigger(BinarySensor *parent)
bool match_interval(uint32_t min_length, uint32_t max_length, uint32_t length)
const float HARDWARE
For components that deal with hardware and are very important like GPIO switch.
Providing packet encoding functions for exchanging data with a remote host.
uint32_t IRAM_ATTR HOT millis()