mirror of
https://github.com/jdejaegh/irm-kmi-ha.git
synced 2025-06-27 03:35:56 +02:00
Fix lowest temperature for next day if it is currently the night
This commit is contained in:
parent
f4cd89e3fe
commit
974d6baca2
1 changed files with 3 additions and 1 deletions
|
@ -106,10 +106,12 @@ class IrmKmiWeather(CoordinatorEntity, WeatherEntity):
|
|||
data: list[Forecast] = self.coordinator.data.get('daily_forecast')
|
||||
if not isinstance(data, list):
|
||||
return None
|
||||
if len(data) > 1 and not data[0].get('is_daytime') and data[1].get('native_templow') is None:
|
||||
data[1]['native_templow'] = data[0].get('native_templow')
|
||||
if len(data) > 0 and not data[0].get('is_daytime'):
|
||||
return data
|
||||
if len(data) > 1 and data[0].get('native_templow') is None and not data[1].get('is_daytime'):
|
||||
data[0]['native_templow'] = data[1]['native_templow']
|
||||
data[0]['native_templow'] = data[1].get('native_templow')
|
||||
return [f for f in data if f.get('is_daytime')]
|
||||
|
||||
async def async_forecast_hourly(self) -> list[Forecast] | None:
|
||||
|
|
Loading…
Add table
Reference in a new issue