1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-30 14:43:51 +00:00

Add new Lock core component (#2958)

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
Keilin Bickar
2022-02-03 13:24:31 -05:00
committed by GitHub
parent 62b366a5ec
commit 21803607e7
41 changed files with 1558 additions and 3 deletions

View File

@@ -2582,3 +2582,28 @@ select:
qr_code:
- id: homepage_qr
value: https://esphome.io/index.html
lock:
- platform: template
id: test_lock1
name: "Template Switch"
lambda: |-
if (id(binary_sensor1).state) {
return LOCK_STATE_LOCKED;
}else{
return LOCK_STATE_UNLOCKED;
}
optimistic: true
assumed_state: no
on_unlock:
- lock.template.publish:
id: test_lock1
state: !lambda "return LOCK_STATE_UNLOCKED;"
on_lock:
- lock.template.publish:
id: test_lock1
state: !lambda "return LOCK_STATE_LOCKED;"
- platform: output
name: "Generic Output Lock"
id: test_lock2
output: pca_6