[template] Use register_apply_action for lock.template.publish and valve.template.publish (#19525)

This commit is contained in:
J. Nick Koston
2026-09-23 17:20:05 -05:00
committed by GitHub
parent 170bb02fa3
commit 0110215e31
5 changed files with 26 additions and 77 deletions
@@ -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