mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-30 22:53:59 +00:00 
			
		
		
		
	Add new Lock core component (#2958)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
		| @@ -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 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user