mirror of
https://github.com/esphome/esphome-docs.git
synced 2024-09-28 04:17:47 +02:00
Add map filter for text sensors (#1632)
This commit is contained in:
parent
5eae51ea9e
commit
e51bd800e9
@ -142,6 +142,25 @@ Search the current value of the text sensor for a string, and replace it with an
|
||||
|
||||
The arguments are a list of substitutions, each in the form ``TO_FIND -> REPLACEMENT``.
|
||||
|
||||
``map``
|
||||
*******
|
||||
|
||||
Lookup the current value of the text sensor in a list, and return the matching item if found.
|
||||
Does not change the value of the text sensor if the current value wasn't found.
|
||||
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
# Example configuration entry
|
||||
- platform: template
|
||||
# ...
|
||||
filters:
|
||||
- map:
|
||||
- high -> On
|
||||
- low -> Off
|
||||
|
||||
The arguments are a list of substitutions, each in the form ``LOOKUP -> REPLACEMENT``.
|
||||
|
||||
``lambda``
|
||||
**********
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user