Skip to content

Commit

Permalink
Merge pull request #40 from jdejaegh/midnight_bug
Browse files Browse the repository at this point in the history
Fix midnight bug: between 12AM and 1AM hourly forecast was shifted by +1 day
  • Loading branch information
jdejaegh authored Jun 1, 2024
2 parents 2e90931 + 7bf45ac commit 2562b2b
Show file tree
Hide file tree
Showing 6 changed files with 3,313 additions and 5 deletions.
4 changes: 2 additions & 2 deletions custom_components/irm_kmi/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,8 @@ def hourly_list_to_forecast(data: List[dict] | None) -> List[Forecast] | None:
forecasts = list()
day = datetime.now(tz=pytz.timezone('Europe/Brussels')).replace(hour=0, minute=0, second=0, microsecond=0)

for f in data:
if 'dateShow' in f:
for idx, f in enumerate(data):
if 'dateShow' in f and idx > 0:
day = day + timedelta(days=1)

hour = f.get('hour', None)
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
aiohttp==3.9.5
async-timeout==4.0.3
homeassistant==2024.5.5
homeassistant==2024.6.0b4
voluptuous==0.13.1
pytz==2024.1
svgwrite==1.4.3
4 changes: 2 additions & 2 deletions requirements_tests.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
homeassistant==2024.5.5
homeassistant==2024.6.0b4
pytest
pytest_homeassistant_custom_component==0.13.125
pytest_homeassistant_custom_component==0.13.128
freezegun
isort
Loading

0 comments on commit 2562b2b

Please sign in to comment.