From c3cd60e0cb66f2ddae5165d652b091cec2ed8b96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Sun, 21 May 2023 22:17:26 +0200 Subject: [PATCH] Fix pressure for AEMET stations close to sea level (#87094) --- homeassistant/components/aemet/weather_update_coordinator.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/homeassistant/components/aemet/weather_update_coordinator.py b/homeassistant/components/aemet/weather_update_coordinator.py index 1c64206891c..5242540748f 100644 --- a/homeassistant/components/aemet/weather_update_coordinator.py +++ b/homeassistant/components/aemet/weather_update_coordinator.py @@ -26,6 +26,7 @@ from aemet_opendata.const import ( AEMET_ATTR_STATION_DATE, AEMET_ATTR_STATION_HUMIDITY, AEMET_ATTR_STATION_LOCATION, + AEMET_ATTR_STATION_PRESSURE, AEMET_ATTR_STATION_PRESSURE_SEA, AEMET_ATTR_STATION_TEMPERATURE, AEMET_ATTR_STORM_PROBABILITY, @@ -318,6 +319,8 @@ class WeatherUpdateCoordinator(DataUpdateCoordinator): pressure = format_float( station_data[AEMET_ATTR_STATION_PRESSURE_SEA] ) + elif AEMET_ATTR_STATION_PRESSURE in station_data: + pressure = format_float(station_data[AEMET_ATTR_STATION_PRESSURE]) if AEMET_ATTR_STATION_TEMPERATURE in station_data: temperature = format_float( station_data[AEMET_ATTR_STATION_TEMPERATURE]