1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Use new device classes in Accuweather integration (#79717)

* Add new device classes

* Update tests
This commit is contained in:
Maciej Bieniek
2022-10-07 23:52:36 +00:00
committed by GitHub
parent 24e9f6285d
commit 5abff31437
2 changed files with 14 additions and 0 deletions

View File

@@ -49,6 +49,7 @@ async def test_sensor_without_forecast(hass):
assert state.attributes.get(ATTR_ICON) == "mdi:weather-fog"
assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == LENGTH_METERS
assert state.attributes.get(ATTR_STATE_CLASS) == SensorStateClass.MEASUREMENT
assert state.attributes.get(ATTR_DEVICE_CLASS) == SensorDeviceClass.DISTANCE
entry = registry.async_get("sensor.home_cloud_ceiling")
assert entry
@@ -435,6 +436,7 @@ async def test_sensor_enabled_without_forecast(hass):
assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == SPEED_KILOMETERS_PER_HOUR
assert state.attributes.get(ATTR_ICON) == "mdi:weather-windy"
assert state.attributes.get(ATTR_STATE_CLASS) == SensorStateClass.MEASUREMENT
assert state.attributes.get(ATTR_DEVICE_CLASS) == SensorDeviceClass.SPEED
entry = registry.async_get("sensor.home_wind_gust")
assert entry
@@ -447,6 +449,7 @@ async def test_sensor_enabled_without_forecast(hass):
assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == SPEED_KILOMETERS_PER_HOUR
assert state.attributes.get(ATTR_ICON) == "mdi:weather-windy"
assert state.attributes.get(ATTR_STATE_CLASS) == SensorStateClass.MEASUREMENT
assert state.attributes.get(ATTR_DEVICE_CLASS) == SensorDeviceClass.SPEED
entry = registry.async_get("sensor.home_wind")
assert entry
@@ -579,6 +582,7 @@ async def test_sensor_enabled_without_forecast(hass):
assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == SPEED_KILOMETERS_PER_HOUR
assert state.attributes.get("direction") == "SSE"
assert state.attributes.get(ATTR_ICON) == "mdi:weather-windy"
assert state.attributes.get(ATTR_DEVICE_CLASS) == SensorDeviceClass.SPEED
entry = registry.async_get("sensor.home_wind_day_0d")
assert entry
@@ -592,6 +596,7 @@ async def test_sensor_enabled_without_forecast(hass):
assert state.attributes.get("direction") == "WNW"
assert state.attributes.get(ATTR_ICON) == "mdi:weather-windy"
assert state.attributes.get(ATTR_STATE_CLASS) is None
assert state.attributes.get(ATTR_DEVICE_CLASS) == SensorDeviceClass.SPEED
entry = registry.async_get("sensor.home_wind_night_0d")
assert entry
@@ -605,6 +610,7 @@ async def test_sensor_enabled_without_forecast(hass):
assert state.attributes.get("direction") == "S"
assert state.attributes.get(ATTR_ICON) == "mdi:weather-windy"
assert state.attributes.get(ATTR_STATE_CLASS) is None
assert state.attributes.get(ATTR_DEVICE_CLASS) == SensorDeviceClass.SPEED
entry = registry.async_get("sensor.home_wind_gust_day_0d")
assert entry
@@ -618,6 +624,7 @@ async def test_sensor_enabled_without_forecast(hass):
assert state.attributes.get("direction") == "WSW"
assert state.attributes.get(ATTR_ICON) == "mdi:weather-windy"
assert state.attributes.get(ATTR_STATE_CLASS) is None
assert state.attributes.get(ATTR_DEVICE_CLASS) == SensorDeviceClass.SPEED
entry = registry.async_get("sensor.home_wind_gust_night_0d")
assert entry