Add translation_key property to entites (#82701)

* Add translation_key attribute to entity state

* Update accuweather test

* Index entity translation keys by platform

* Store translation key in entity registry
This commit is contained in:
Erik Montnemery 2022-12-01 09:34:09 +01:00 committed by GitHub
parent 843f537109
commit 8e617bbc1d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 127 additions and 32 deletions

View file

@ -301,9 +301,9 @@ SENSOR_TYPES: tuple[AccuWeatherSensorDescription, ...] = (
),
AccuWeatherSensorDescription(
key="PressureTendency",
device_class="accuweather__pressure_tendency",
icon="mdi:gauge",
name="Pressure tendency",
translation_key="pressure_tendency",
value_fn=lambda data, _: cast(str, data["LocalizedText"]).lower(),
),
AccuWeatherSensorDescription(