feat: aufzeichnen der letzten entsperrung
This commit is contained in:
parent
8508507954
commit
4e8fe34d92
|
@ -83,7 +83,6 @@ rc522_spi:
|
|||
# store the tag id into global variable
|
||||
- lambda: |-
|
||||
id(my_tag) = x;
|
||||
- homeassistant.tag_scanned: !lambda 'return x;'
|
||||
# login to vault with role_id to fetch short lived token
|
||||
- http_request.post:
|
||||
url: https://vault.ctdo.de/v1/auth/approle/login
|
||||
|
@ -121,7 +120,26 @@ rc522_spi:
|
|||
condition:
|
||||
lambda: 'return id(may_switch_output);'
|
||||
then:
|
||||
- switch.toggle: mlock_${name_of_board}_switch
|
||||
- if:
|
||||
condition:
|
||||
switch.is_on: mlock_${name_of_board}_switch
|
||||
then:
|
||||
- switch.turn_off: mlock_${name_of_board}_switch
|
||||
- homeassistant.event:
|
||||
event: esphome.mlock_locked
|
||||
data:
|
||||
tag: !lambda return id(my_tag)
|
||||
machine: ${name_of_board}
|
||||
else:
|
||||
- switch.turn_on: mlock_${name_of_board}_switch
|
||||
- homeassistant.event:
|
||||
event: esphome.mlock_unlocked
|
||||
data:
|
||||
tag: !lambda return id(my_tag)
|
||||
machine: ${name_of_board}
|
||||
- text.set:
|
||||
id: ${name_of_board}_letzte_entsperrung
|
||||
value: !lambda return id(my_tag);
|
||||
else:
|
||||
- repeat:
|
||||
count: 3
|
||||
|
@ -193,3 +211,9 @@ light:
|
|||
num_leds: 1
|
||||
internal: true
|
||||
|
||||
text:
|
||||
- platform: template
|
||||
name: "$name_of_board Letzte Entsperung"
|
||||
id: ${name_of_board}_letzte_entsperrung
|
||||
optimistic: true
|
||||
mode: text
|
||||
|
|
Loading…
Reference in New Issue