mirror of
https://github.com/esphome/esphome.git
synced 2026-09-29 16:00:23 +00:00
[switch] Use register_apply_condition for switch.is_on and switch.is_off (#19553)
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user