mirror of
https://github.com/esphome/esphome.git
synced 2026-09-29 07:50:21 +00:00
[text_sensor] Use register_apply_condition for text_sensor.state (#19541)
This commit is contained in:
@@ -32,6 +32,23 @@ text_sensor:
|
||||
filters:
|
||||
- map:
|
||||
- ON -> Active
|
||||
# text_sensor.state with a constant and with a lambda, inside a trigger
|
||||
# whose argument is a std::string.
|
||||
on_value:
|
||||
- if:
|
||||
condition:
|
||||
text_sensor.state:
|
||||
id: test_substitute_single
|
||||
state: Error
|
||||
then:
|
||||
- logger.log: substitute reports an error
|
||||
- if:
|
||||
condition:
|
||||
text_sensor.state:
|
||||
id: test_substitute_single
|
||||
state: !lambda return x;
|
||||
then:
|
||||
- logger.log: substitute matches the mapped value
|
||||
|
||||
- platform: template
|
||||
name: "Test Map Multiple"
|
||||
|
||||
Reference in New Issue
Block a user