1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-30 14:43:51 +00:00

Add map filter for text sensors (#2761)

This commit is contained in:
Oxan van Leeuwen
2021-11-25 21:35:33 +01:00
committed by GitHub
parent d50bdf619f
commit b5f660398c
4 changed files with 48 additions and 17 deletions

View File

@@ -458,6 +458,16 @@ text_sensor:
name: 'Template Text Sensor'
lambda: |-
return {"Hello World"};
filters:
- to_upper:
- to_lower:
- append: "xyz"
- prepend: "abcd"
- substitute:
- Hello -> Goodbye
- map:
- red -> green
- lambda: return {"1234"};
- platform: homeassistant
entity_id: sensor.hello_world2
id: ha_hello_world2