diff --git a/homeassistant/components/accuweather/sensor.py b/homeassistant/components/accuweather/sensor.py index 6991f5c872a..8ce382d2538 100644 --- a/homeassistant/components/accuweather/sensor.py +++ b/homeassistant/components/accuweather/sensor.py @@ -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(), ), diff --git a/tests/components/accuweather/test_sensor.py b/tests/components/accuweather/test_sensor.py index 0182f7584b1..a96408e35ac 100644 --- a/tests/components/accuweather/test_sensor.py +++ b/tests/components/accuweather/test_sensor.py @@ -5,6 +5,7 @@ from unittest.mock import PropertyMock, patch from homeassistant.components.accuweather.const import ATTRIBUTION, DOMAIN from homeassistant.components.sensor import ( + ATTR_OPTIONS, ATTR_STATE_CLASS, DOMAIN as SENSOR_DOMAIN, SensorDeviceClass, @@ -79,8 +80,9 @@ async def test_sensor_without_forecast(hass): assert state.state == "falling" assert state.attributes.get(ATTR_ATTRIBUTION) == ATTRIBUTION assert state.attributes.get(ATTR_ICON) == "mdi:gauge" - assert state.attributes.get(ATTR_DEVICE_CLASS) is None + assert state.attributes.get(ATTR_DEVICE_CLASS) == SensorDeviceClass.ENUM assert state.attributes.get(ATTR_STATE_CLASS) is None + assert state.attributes.get(ATTR_OPTIONS) == ["falling", "rising", "steady"] entry = registry.async_get("sensor.home_pressure_tendency") assert entry