green blink
This commit is contained in:
parent
11e3c719b8
commit
f7d503418d
|
@ -16,12 +16,12 @@ esphome:
|
||||||
platform: ESP8266
|
platform: ESP8266
|
||||||
board: d1_mini
|
board: d1_mini
|
||||||
on_boot:
|
on_boot:
|
||||||
- priority: 600
|
|
||||||
then:
|
|
||||||
- light.addressable_set: { id: status_led, red: 0%, green: 0%, blue: 50% }
|
|
||||||
- priority: -100
|
- priority: -100
|
||||||
then:
|
then:
|
||||||
- light.addressable_set: { id: status_led, red: 0%, green: 0%, blue: 100% }
|
- light.addressable_set: { id: status_led, red: 0%, green: 0%, blue: 100% }
|
||||||
|
# - priority: 600
|
||||||
|
# then:
|
||||||
|
# - light.addressable_set: { id: status_led, red: 0%, green: 0%, blue: 50% }
|
||||||
|
|
||||||
# Enable logging
|
# Enable logging
|
||||||
logger:
|
logger:
|
||||||
|
@ -75,11 +75,7 @@ rc522_spi:
|
||||||
cs_pin: GPIO15
|
cs_pin: GPIO15
|
||||||
on_tag:
|
on_tag:
|
||||||
then:
|
then:
|
||||||
- light.addressable_set:
|
- light.addressable_set: { id: status_led, red: 100%, green: 100%, blue: 0% }
|
||||||
id: status_led
|
|
||||||
red: 100%
|
|
||||||
green: 100%
|
|
||||||
blue: 0%
|
|
||||||
# store the tag id into global variable
|
# store the tag id into global variable
|
||||||
- lambda: |-
|
- lambda: |-
|
||||||
id(my_tag) = x;
|
id(my_tag) = x;
|
||||||
|
@ -121,8 +117,15 @@ rc522_spi:
|
||||||
condition:
|
condition:
|
||||||
lambda: 'return id(may_switch_output);'
|
lambda: 'return id(may_switch_output);'
|
||||||
then:
|
then:
|
||||||
- switch.turn_on: mlock_${name_of_board}_switch
|
- if:
|
||||||
else:
|
condition:
|
||||||
|
switch.is_on: mlock_${name_of_board}_switch
|
||||||
|
then: # allowed, but already on, blink once
|
||||||
|
- light.addressable_set: { id: status_led, red: 0%, green: 0%, blue: 0% }
|
||||||
|
- delay: 0.5s
|
||||||
|
else:
|
||||||
|
- switch.turn_on: mlock_${name_of_board}_switch
|
||||||
|
else: # not allowed, blink quickly
|
||||||
- repeat:
|
- repeat:
|
||||||
count: 3
|
count: 3
|
||||||
then:
|
then:
|
||||||
|
|
Loading…
Reference in New Issue