Skip to content

Use on_multi_click for binary sensor timings #5

@jesserockz

Description

@jesserockz

Using on_multi_click allows multiple different timings to be done in YAML and doesn't require a global to store the time.

on_press:
then:
- lambda: |-
id(button_press_timestamp) = millis();
on_release:
then:
- lambda: |-
if (millis() - id(button_press_timestamp) >= 10000) {
// Remove Wifi
id(testCycleCount) = 0;
id(runTest) = true;
id(factory_reset_switch).turn_on();
}
else if (millis() - id(button_press_timestamp) >= 3000) {
// StatusCheck
id(statusCheck).execute();
delay(3000);
id(testCycleCount) = 0;
id(runTest) = true;
id(testScript).execute();
}
else {
id(run_pump_timed).execute();
}

Metadata

Metadata

Labels

enhancementNew feature or request

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions