Add map filter for text sensors (#1632)

This commit is contained in:
Oxan van Leeuwen 2021-11-25 21:35:38 +01:00 committed by GitHub
parent 5eae51ea9e
commit e51bd800e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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``
**********