1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-30 14:43:51 +00:00

set_retry: add retries remaining parameter to the provided function (#4251)

This commit is contained in:
Dan Jackson
2023-01-17 17:26:32 -08:00
committed by GitHub
parent 3aa5953cd9
commit 029ac75a04
5 changed files with 25 additions and 12 deletions

View File

@@ -462,6 +462,15 @@ binary_sensor:
name: Mi Motion Sensor 2 Light
button:
name: Mi Motion Sensor 2 Button
- platform: gpio
id: gpio_set_retry_test
pin: GPIO9
on_press:
then:
- lambda: |-
App.scheduler.set_retry(id(gpio_set_retry_test), "set_retry_test", 100, 3, [](const uint8_t remaining) {
return remaining ? RetryResult::RETRY : RetryResult::DONE; // just to reference both symbols
}, 5.0f);
esp32_ble_tracker:
on_ble_advertise: