mirror of
https://github.com/esphome/esphome.git
synced 2026-09-29 07:50:21 +00:00
[binary_sensor] Use register_apply_condition for binary_sensor.is_on and binary_sensor.is_off (#19554)
This commit is contained in:
@@ -43,6 +43,17 @@ binary_sensor:
|
||||
- binary_sensor.template.publish:
|
||||
id: publish_target
|
||||
state: !lambda "return x.value_or(false);"
|
||||
- if:
|
||||
condition:
|
||||
binary_sensor.is_on: publish_target
|
||||
then:
|
||||
- logger.log: "publish_target is on"
|
||||
- if:
|
||||
condition:
|
||||
binary_sensor.is_off:
|
||||
id: publish_target
|
||||
then:
|
||||
- logger.log: "publish_target is off"
|
||||
|
||||
- platform: template
|
||||
id: publish_target
|
||||
|
||||
Reference in New Issue
Block a user