mirror of
https://github.com/esphome/esphome.git
synced 2026-09-30 08:20:21 +00:00
[template] Use register_apply_action for lock.template.publish and valve.template.publish (#19525)
This commit is contained in:
@@ -475,6 +475,7 @@ select:
|
||||
|
||||
lock:
|
||||
- platform: template
|
||||
id: template_lock
|
||||
name: "Template Lock"
|
||||
lambda: |-
|
||||
if (id(template_some_binary_sensor).state) {
|
||||
@@ -483,8 +484,14 @@ lock:
|
||||
return LOCK_STATE_UNLOCKED;
|
||||
lock_action:
|
||||
- logger.log: lock_action
|
||||
- lock.template.publish:
|
||||
id: template_lock
|
||||
state: LOCKED
|
||||
unlock_action:
|
||||
- logger.log: unlock_action
|
||||
- lock.template.publish:
|
||||
id: template_lock
|
||||
state: !lambda "return LOCK_STATE_UNLOCKED;"
|
||||
open_action:
|
||||
- logger.log: open_action
|
||||
|
||||
@@ -504,6 +511,14 @@ valve:
|
||||
- valve.template.publish:
|
||||
id: template_valve
|
||||
state: CLOSED
|
||||
- valve.template.publish:
|
||||
id: template_valve
|
||||
position: 50%
|
||||
current_operation: IDLE
|
||||
- valve.template.publish:
|
||||
id: template_valve
|
||||
position: !lambda "return 0.25f;"
|
||||
current_operation: !lambda "return VALVE_OPERATION_CLOSING;"
|
||||
stop_action:
|
||||
- logger.log: stop_action
|
||||
# Exercise valve.control with various field combinations so the
|
||||
|
||||
Reference in New Issue
Block a user