From 8007a86bbfb3bfa600200c3f567ea35136c4dcf5 Mon Sep 17 00:00:00 2001 From: neri Date: Tue, 16 Jul 2024 21:50:11 +0200 Subject: [PATCH] mlock: faster user feedback --- mlock-common.yaml | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/mlock-common.yaml b/mlock-common.yaml index 11ff3ac..67571f4 100644 --- a/mlock-common.yaml +++ b/mlock-common.yaml @@ -16,7 +16,7 @@ esphome: platform: ESP8266 board: d1_mini on_boot: - - priority: 600 + - priority: 300 then: - light.addressable_set: { id: status_led, red: 0%, green: 0%, blue: 100% } - priority: -100 @@ -81,17 +81,13 @@ rc522_spi: cs_pin: GPIO15 on_tag: then: - - light.addressable_set: - id: status_led - red: 100% - green: 100% - blue: 0% + - light.addressable_set: { id: status_led, red: 100%, green: 60%, blue: 0% } + # small delay so the light can update its color + - delay: 15ms # store the tag id into global variable - lambda: |- id(my_tag) = x; - - text.set: - id: ${name_of_board}_letzter_token - value: !lambda return id(my_tag); + id(may_switch_output) = 0; # login to vault with role_id to fetch short lived token - http_request.post: url: https://vault.ctdo.de/v1/auth/approle/login @@ -172,6 +168,9 @@ rc522_spi: - light.addressable_set: { id: status_led, red: 0%, green: 100%, blue: 0% } else: - light.addressable_set: { id: status_led, red: 100%, green: 0%, blue: 0% } + - text.set: + id: ${name_of_board}_letzter_token + value: !lambda return id(my_tag); # switch component for the output state switch: