From ae86e96d347fa6d1bac10b62e8abe0c76ec3d2c1 Mon Sep 17 00:00:00 2001 From: Michael Davie Date: Mon, 7 Jun 2021 21:23:44 -0400 Subject: [PATCH] Fix misaligned high/low temperatures in weather card (#49826) --- homeassistant/components/environment_canada/weather.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/environment_canada/weather.py b/homeassistant/components/environment_canada/weather.py index 9abbc33bc93..5301843fc0a 100644 --- a/homeassistant/components/environment_canada/weather.py +++ b/homeassistant/components/environment_canada/weather.py @@ -202,16 +202,17 @@ def get_forecast(ec_data, forecast_type): ATTR_FORECAST_TEMP_LOW: int(half_days[1]["temperature"]), } ) + half_days = half_days[2:] else: today.update( { + ATTR_FORECAST_TEMP: None, ATTR_FORECAST_TEMP_LOW: int(half_days[0]["temperature"]), - ATTR_FORECAST_TEMP: int(half_days[1]["temperature"]), } ) + half_days = half_days[1:] forecast_array.append(today) - half_days = half_days[2:] for day, high, low in zip(range(1, 6), range(0, 9, 2), range(1, 10, 2)): forecast_array.append(