dolezsa / thermal_comfort

Thermal Comfort sensor for HA (absolute humidity, heat index, dew point, thermal perception)
Other
552 stars 106 forks source link

Support translated sensor names #299

Closed rautesamtr closed 11 months ago

rautesamtr commented 11 months ago

https://developers.home-assistant.io/blog/2023/03/27/entity_name_translations

This PR adds support for translating sensor names. For this the translation key has been moved form the SENSOR_TYPES description map and is set in he SensorThermalComfort Class since every entity needs a translation_key. Translation works out of the box for config flow entities since we already implemented has_entity_name for them. It doesn't for YAML. With has_entity_name set to True and translations enabled we lose the name set for the device in YAML.

For now we only offer translations in YAML when the name isn't set.