diff --git a/homeassistant/components/metoffice/const.py b/homeassistant/components/metoffice/const.py index 0b275f301cd..e413b102898 100644 --- a/homeassistant/components/metoffice/const.py +++ b/homeassistant/components/metoffice/const.py @@ -2,6 +2,7 @@ from datetime import timedelta from homeassistant.components.weather import ( + ATTR_CONDITION_CLEAR_NIGHT, ATTR_CONDITION_CLOUDY, ATTR_CONDITION_EXCEPTIONAL, ATTR_CONDITION_FOG, @@ -37,6 +38,7 @@ MODE_DAILY = "daily" MODE_DAILY_LABEL = "Daily" CONDITION_CLASSES = { + ATTR_CONDITION_CLEAR_NIGHT: ["0"], ATTR_CONDITION_CLOUDY: ["7", "8"], ATTR_CONDITION_FOG: ["5", "6"], ATTR_CONDITION_HAIL: ["19", "20", "21"], @@ -47,7 +49,7 @@ CONDITION_CLASSES = { ATTR_CONDITION_RAINY: ["9", "10", "11", "12"], ATTR_CONDITION_SNOWY: ["22", "23", "24", "25", "26", "27"], ATTR_CONDITION_SNOWY_RAINY: ["16", "17", "18"], - ATTR_CONDITION_SUNNY: ["0", "1"], + ATTR_CONDITION_SUNNY: ["1"], ATTR_CONDITION_WINDY: [], ATTR_CONDITION_WINDY_VARIANT: [], ATTR_CONDITION_EXCEPTIONAL: [], diff --git a/tests/components/metoffice/test_weather.py b/tests/components/metoffice/test_weather.py index 21b2196804c..76e01b638c3 100644 --- a/tests/components/metoffice/test_weather.py +++ b/tests/components/metoffice/test_weather.py @@ -231,7 +231,7 @@ async def test_two_weather_sites_running(hass, requests_mock, legacy_patchable_t weather.attributes.get("forecast")[18]["datetime"] == "2020-04-27T21:00:00+00:00" ) - assert weather.attributes.get("forecast")[18]["condition"] == "sunny" + assert weather.attributes.get("forecast")[18]["condition"] == "clear-night" assert weather.attributes.get("forecast")[18]["temperature"] == 9 assert weather.attributes.get("forecast")[18]["wind_speed"] == 4 assert weather.attributes.get("forecast")[18]["wind_bearing"] == "NW"