1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-24 04:33:49 +01:00

Add basic text_sensor tests (#11424)

This commit is contained in:
J. Nick Koston
2025-10-20 16:26:41 -10:00
committed by GitHub
parent 6a239f4d1c
commit 9f668b0c4b
2 changed files with 67 additions and 0 deletions

View File

@@ -0,0 +1,66 @@
text_sensor:
- platform: template
name: "Test Substitute Single"
id: test_substitute_single
filters:
- substitute:
- ERROR -> Error
- platform: template
name: "Test Substitute Multiple"
id: test_substitute_multiple
filters:
- substitute:
- ERROR -> Error
- WARN -> Warning
- INFO -> Information
- DEBUG -> Debug
- platform: template
name: "Test Substitute Chained"
id: test_substitute_chained
filters:
- substitute:
- foo -> bar
- to_upper
- substitute:
- BAR -> baz
- platform: template
name: "Test Map Single"
id: test_map_single
filters:
- map:
- ON -> Active
- platform: template
name: "Test Map Multiple"
id: test_map_multiple
filters:
- map:
- ON -> Active
- OFF -> Inactive
- UNKNOWN -> Error
- IDLE -> Standby
- platform: template
name: "Test Map Passthrough"
id: test_map_passthrough
filters:
- map:
- Good -> Excellent
- Bad -> Poor
- platform: template
name: "Test All Filters"
id: test_all_filters
filters:
- to_upper
- to_lower
- append: " suffix"
- prepend: "prefix "
- substitute:
- prefix -> PREFIX
- suffix -> SUFFIX
- map:
- PREFIX text SUFFIX -> mapped

View File

@@ -0,0 +1 @@
<<: !include common.yaml