Use device class ENUM for Accuweather pressure tendency sensor (#86887)

* Use device class ENUM for pressure tendency sensor

* Format
This commit is contained in:
Maciej Bieniek 2023-01-30 12:03:23 +01:00 committed by GitHub
parent a4fa0925b7
commit d485630ce9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View file

@ -300,8 +300,10 @@ SENSOR_TYPES: tuple[AccuWeatherSensorDescription, ...] = (
),
AccuWeatherSensorDescription(
key="PressureTendency",
device_class=SensorDeviceClass.ENUM,
icon="mdi:gauge",
name="Pressure tendency",
options=["falling", "rising", "steady"],
translation_key="pressure_tendency",
value_fn=lambda data, _: cast(str, data["LocalizedText"]).lower(),
),