mirror of
https://github.com/jdejaegh/irm-kmi-ha.git
synced 2025-06-27 11:39:26 +02:00
Return tonight's forecast after sunset in daily view
This commit is contained in:
parent
becd6418de
commit
f4cd89e3fe
1 changed files with 2 additions and 0 deletions
|
@ -106,6 +106,8 @@ class IrmKmiWeather(CoordinatorEntity, WeatherEntity):
|
||||||
data: list[Forecast] = self.coordinator.data.get('daily_forecast')
|
data: list[Forecast] = self.coordinator.data.get('daily_forecast')
|
||||||
if not isinstance(data, list):
|
if not isinstance(data, list):
|
||||||
return None
|
return None
|
||||||
|
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'):
|
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]['native_templow']
|
||||||
return [f for f in data if f.get('is_daytime')]
|
return [f for f in data if f.get('is_daytime')]
|
||||||
|
|
Loading…
Add table
Reference in a new issue