From 1bc69128a960ad2ff020e214c6d39f993d42d60a Mon Sep 17 00:00:00 2001 From: Gerard Date: Sat, 26 Mar 2022 09:46:26 +0100 Subject: [PATCH] Fix weather forecast Show the correct day and icon for day 2 --- apps/nspanel-lovelace-ui/luibackend/pages.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/nspanel-lovelace-ui/luibackend/pages.py b/apps/nspanel-lovelace-ui/luibackend/pages.py index 66042351..17ec9994 100644 --- a/apps/nspanel-lovelace-ui/luibackend/pages.py +++ b/apps/nspanel-lovelace-ui/luibackend/pages.py @@ -98,13 +98,13 @@ class LuiPagesGen(object): wOF2 = self._config.get("weatherOverrideForecast2") if wOF2 is None: - up2 = we.attributes.forecast[0]['datetime'] + up2 = we.attributes.forecast[1]['datetime'] up2 = datetime.datetime.fromisoformat(up2) if babel_spec is not None: up2 = babel.dates.format_date(up2, "E", locale=self._locale) else: up2 = up2.strftime("%a") - icon2 = get_icon_id_ha("weather", state=we.attributes.forecast[0]['condition']) + icon2 = get_icon_id_ha("weather", state=we.attributes.forecast[1]['condition']) down2 = we.attributes.forecast[1]['temperature'] else: LOGGER.info(f"Forecast 2 is overrriden with {wOF2}")