1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-01 19:02:18 +01:00

Add restore state option to template switch (#222)

* Add restore state option to template switch

* Add test
This commit is contained in:
Otto Winter
2018-11-09 20:05:50 +01:00
committed by GitHub
parent e3094d9689
commit 3ec931ffa4
3 changed files with 10 additions and 1 deletions

View File

@@ -806,6 +806,7 @@ switch:
level: !lambda 'return 0.5;'
turn_off_action:
- switch.turn_on: living_room_lights_off
restore_state: False
- platform: restart
name: "Living Room Restart"
- platform: shutdown
@@ -832,6 +833,7 @@ switch:
// Switch is OFF, do something else here
}
optimistic: true
restore_state: True
- platform: uart
name: "UART String Output"
data: 'DataToSend'