[switch] Use register_apply_condition for switch.is_on and switch.is_off (#19553)

This commit is contained in:
J. Nick Koston
2026-09-24 08:57:58 -04:00
committed by GitHub
parent 5790181f44
commit 8b11d3da39
3 changed files with 15 additions and 23 deletions
+10
View File
@@ -29,3 +29,13 @@ esphome:
- switch.control:
id: the_switch
state: !lambda return (1 > 2);
- if:
condition:
switch.is_on: the_switch
then:
- logger.log: "Switch is on"
- if:
condition:
switch.is_off: the_switch
then:
- logger.log: "Switch is off"