mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 21:06:19 +00:00
Add Wind to Accuweather sensors (#44364)
This commit is contained in:
@@ -222,6 +222,13 @@ async def test_sensor_enabled_without_forecast(hass):
|
||||
suggested_object_id="home_wet_bulb_temperature",
|
||||
disabled_by=None,
|
||||
)
|
||||
registry.async_get_or_create(
|
||||
SENSOR_DOMAIN,
|
||||
DOMAIN,
|
||||
"0123456-wind",
|
||||
suggested_object_id="home_wind",
|
||||
disabled_by=None,
|
||||
)
|
||||
registry.async_get_or_create(
|
||||
SENSOR_DOMAIN,
|
||||
DOMAIN,
|
||||
@@ -313,6 +320,20 @@ async def test_sensor_enabled_without_forecast(hass):
|
||||
suggested_object_id="home_wind_gust_night_0d",
|
||||
disabled_by=None,
|
||||
)
|
||||
registry.async_get_or_create(
|
||||
SENSOR_DOMAIN,
|
||||
DOMAIN,
|
||||
"0123456-windday-0",
|
||||
suggested_object_id="home_wind_day_0d",
|
||||
disabled_by=None,
|
||||
)
|
||||
registry.async_get_or_create(
|
||||
SENSOR_DOMAIN,
|
||||
DOMAIN,
|
||||
"0123456-windnight-0",
|
||||
suggested_object_id="home_wind_night_0d",
|
||||
disabled_by=None,
|
||||
)
|
||||
|
||||
await init_integration(hass, forecast=True)
|
||||
|
||||
@@ -393,6 +414,17 @@ async def test_sensor_enabled_without_forecast(hass):
|
||||
assert entry
|
||||
assert entry.unique_id == "0123456-windgust"
|
||||
|
||||
state = hass.states.get("sensor.home_wind")
|
||||
assert state
|
||||
assert state.state == "14.5"
|
||||
assert state.attributes.get(ATTR_ATTRIBUTION) == ATTRIBUTION
|
||||
assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == SPEED_KILOMETERS_PER_HOUR
|
||||
assert state.attributes.get(ATTR_ICON) == "mdi:weather-windy"
|
||||
|
||||
entry = registry.async_get("sensor.home_wind")
|
||||
assert entry
|
||||
assert entry.unique_id == "0123456-wind"
|
||||
|
||||
state = hass.states.get("sensor.home_cloud_cover_day_0d")
|
||||
assert state
|
||||
assert state.state == "58"
|
||||
@@ -507,6 +539,30 @@ async def test_sensor_enabled_without_forecast(hass):
|
||||
assert entry
|
||||
assert entry.unique_id == "0123456-tree-0"
|
||||
|
||||
state = hass.states.get("sensor.home_wind_day_0d")
|
||||
assert state
|
||||
assert state.state == "13.0"
|
||||
assert state.attributes.get(ATTR_ATTRIBUTION) == ATTRIBUTION
|
||||
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"
|
||||
|
||||
entry = registry.async_get("sensor.home_wind_day_0d")
|
||||
assert entry
|
||||
assert entry.unique_id == "0123456-windday-0"
|
||||
|
||||
state = hass.states.get("sensor.home_wind_night_0d")
|
||||
assert state
|
||||
assert state.state == "7.4"
|
||||
assert state.attributes.get(ATTR_ATTRIBUTION) == ATTRIBUTION
|
||||
assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == SPEED_KILOMETERS_PER_HOUR
|
||||
assert state.attributes.get("direction") == "WNW"
|
||||
assert state.attributes.get(ATTR_ICON) == "mdi:weather-windy"
|
||||
|
||||
entry = registry.async_get("sensor.home_wind_night_0d")
|
||||
assert entry
|
||||
assert entry.unique_id == "0123456-windnight-0"
|
||||
|
||||
state = hass.states.get("sensor.home_wind_gust_day_0d")
|
||||
assert state
|
||||
assert state.state == "29.6"
|
||||
|
||||
Reference in New Issue
Block a user