From a14f3ab6b1bb4398c1ec81f959055b1ef5b8da3d Mon Sep 17 00:00:00 2001 From: avee87 <6134677+avee87@users.noreply.github.com> Date: Mon, 26 May 2025 14:43:28 +0100 Subject: [PATCH] Fix clear night weather condition for metoffice (#145470) --- homeassistant/components/metoffice/sensor.py | 2 +- homeassistant/components/metoffice/weather.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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