diff --git a/homeassistant/components/metoffice/sensor.py b/homeassistant/components/metoffice/sensor.py index b707bf604e6..c6b9f96514b 100644 --- a/homeassistant/components/metoffice/sensor.py +++ b/homeassistant/components/metoffice/sensor.py @@ -241,7 +241,7 @@ class MetOfficeCurrentSensor( if ( self.entity_description.native_attr_name == "significantWeatherCode" - and value + and value is not None ): value = CONDITION_MAP.get(value) diff --git a/homeassistant/components/metoffice/weather.py b/homeassistant/components/metoffice/weather.py index c7ce0db6c50..3496e88c046 100644 --- a/homeassistant/components/metoffice/weather.py +++ b/homeassistant/components/metoffice/weather.py @@ -180,7 +180,7 @@ class MetOfficeWeather( weather_now = self.coordinator.data.now() value = get_attribute(weather_now, "significantWeatherCode") - if value: + if value is not None: return CONDITION_MAP.get(value) return None