try the impossible thing
This commit is contained in:
parent
aa73c8b4c6
commit
11e3c719b8
|
@ -106,13 +106,13 @@ rc522_spi:
|
||||||
return ((std::string) "https://vault.ctdo.de/v1/maschinenlock/" + id(my_tag));
|
return ((std::string) "https://vault.ctdo.de/v1/maschinenlock/" + id(my_tag));
|
||||||
headers:
|
headers:
|
||||||
X-Vault-Token: !lambda return id(my_token).c_str();
|
X-Vault-Token: !lambda return id(my_token).c_str();
|
||||||
|
verify_ssl: false
|
||||||
on_response:
|
on_response:
|
||||||
# when found, check if machine is allowed, turn on output or blink LED red
|
|
||||||
then:
|
then:
|
||||||
- if:
|
- if:
|
||||||
condition:
|
condition:
|
||||||
lambda: 'return status_code == 200;'
|
lambda: 'return status_code == 200;'
|
||||||
then:
|
then: # when found, check if machine is allowed, turn on output or blink LED red
|
||||||
- lambda: |-
|
- lambda: |-
|
||||||
json::parse_json(id(http_request_data).get_string(), [](JsonObject root) {
|
json::parse_json(id(http_request_data).get_string(), [](JsonObject root) {
|
||||||
id(may_switch_output) = root["data"]["mlock-$name_of_board"];
|
id(may_switch_output) = root["data"]["mlock-$name_of_board"];
|
||||||
|
@ -138,7 +138,7 @@ rc522_spi:
|
||||||
- delay: 0.5s
|
- delay: 0.5s
|
||||||
- light.addressable_set: { id: status_led, red: 0%, green: 0%, blue: 0% }
|
- light.addressable_set: { id: status_led, red: 0%, green: 0%, blue: 0% }
|
||||||
- delay: 0.5s
|
- delay: 0.5s
|
||||||
- if: # return LED to old state before blinking
|
- if: # return LED to switch state before
|
||||||
condition:
|
condition:
|
||||||
switch.is_on: mlock_${name_of_board}_switch
|
switch.is_on: mlock_${name_of_board}_switch
|
||||||
then:
|
then:
|
||||||
|
|
Loading…
Reference in New Issue