1
0
mirror of https://github.com/esphome/esphome.git synced 2026-02-08 00:31:58 +00:00

Add additional text_sensor filter tests (#13479)

This commit is contained in:
J. Nick Koston
2026-01-26 17:18:36 -10:00
committed by GitHub
parent 123ee02d39
commit bc49174920
3 changed files with 254 additions and 0 deletions

View File

@@ -64,3 +64,16 @@ text_sensor:
- suffix -> SUFFIX
- map:
- PREFIX text SUFFIX -> mapped
- platform: template
name: "Test Lambda Filter"
id: test_lambda_filter
filters:
- lambda: |-
return {"[" + x + "]"};
- to_upper
- lambda: |-
if (x.length() > 10) {
return {x.substr(0, 10) + "..."};
}
return {x};