Closed andrein closed 3 months ago
It's not a bug after all, the UTF-8 sequences need to be quoted, this works as expected:
text_sensor:
- platform: homeassistant
id: weather_forecast_sensor
entity_id: weather.forecast_home
filters:
- map:
- from: clear-night
to: "\U000F0594"
- from: cloudy
to: "\U000F0590"
- from: exceptional
to: "\U000F0F2F"
- from: fog
to: "\U000F0591"
- from: hail
to: "\U000F0592"
- from: lightning
to: "\U000F0593"
- from: lightning-rainy
to: "\U000F067E"
- from: partlycloudy
to: "\U000F0595"
- from: pouring
to: "\U000F0596"
- from: rainy
to: "\U000F0597"
- from: snowy
to: "\U000F0598"
- from: snowy-rainy
to: "\U000F067F"
- from: sunny
to: "\U000F0599"
- from: windy
to: "\U000F059D"
- from: windy-variant
to: "\U000F059E"
- from: sunny-off
to: "\U000F14E4"
The problem
I have a weather forecat text_sensor and I'm attempting to translate the forecast string to an icon using the material design icons webfont:
This doesn't work, the generated code looks like this (slightly formatted for readability):
Notice that the
\U
becomes\134U
in the generated code, which breaks the rendering of the symbol. (I tried hard coding it, it works as expected in that case)Which version of ESPHome has the issue?
2024.6.4
What type of installation are you using?
pip
Which version of Home Assistant has the issue?
-
What platform are you using?
ESP32-IDF
Board
sunton esp32-8048s050
Component causing the issue
text_sensor
Example YAML snippet
Anything in the logs that might be useful for us?
No response
Additional information
No response