mirror of
https://github.com/home-assistant/core.git
synced 2025-04-25 17:57:55 +00:00
Add day to event end to correct TwenteMilieu event timespan (#89028)
[TwenteMilieu] Add day to event end to correct event timespan Co-authored-by: Allen Porter <allen@thebends.org>
This commit is contained in:
parent
1bd9767d8c
commit
b27b094e27
@ -1,7 +1,7 @@
|
|||||||
"""Support for Twente Milieu Calendar."""
|
"""Support for Twente Milieu Calendar."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from datetime import date, datetime
|
from datetime import date, datetime, timedelta
|
||||||
|
|
||||||
from twentemilieu import WasteType
|
from twentemilieu import WasteType
|
||||||
|
|
||||||
@ -58,7 +58,7 @@ class TwenteMilieuCalendar(TwenteMilieuEntity, CalendarEntity):
|
|||||||
CalendarEvent(
|
CalendarEvent(
|
||||||
summary=WASTE_TYPE_TO_DESCRIPTION[waste_type],
|
summary=WASTE_TYPE_TO_DESCRIPTION[waste_type],
|
||||||
start=waste_date,
|
start=waste_date,
|
||||||
end=waste_date,
|
end=waste_date + timedelta(days=1),
|
||||||
)
|
)
|
||||||
for waste_date in waste_dates
|
for waste_date in waste_dates
|
||||||
if start_date.date() <= waste_date <= end_date.date()
|
if start_date.date() <= waste_date <= end_date.date()
|
||||||
@ -89,7 +89,7 @@ class TwenteMilieuCalendar(TwenteMilieuEntity, CalendarEntity):
|
|||||||
self._event = CalendarEvent(
|
self._event = CalendarEvent(
|
||||||
summary=WASTE_TYPE_TO_DESCRIPTION[next_waste_pickup_type],
|
summary=WASTE_TYPE_TO_DESCRIPTION[next_waste_pickup_type],
|
||||||
start=next_waste_pickup_date,
|
start=next_waste_pickup_date,
|
||||||
end=next_waste_pickup_date,
|
end=next_waste_pickup_date + timedelta(days=1),
|
||||||
)
|
)
|
||||||
|
|
||||||
super()._handle_coordinator_update()
|
super()._handle_coordinator_update()
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
dict({
|
dict({
|
||||||
'description': None,
|
'description': None,
|
||||||
'end': dict({
|
'end': dict({
|
||||||
'date': '2022-01-06',
|
'date': '2022-01-07',
|
||||||
}),
|
}),
|
||||||
'location': None,
|
'location': None,
|
||||||
'recurrence_id': None,
|
'recurrence_id': None,
|
||||||
@ -30,7 +30,7 @@
|
|||||||
'attributes': ReadOnlyDict({
|
'attributes': ReadOnlyDict({
|
||||||
'all_day': True,
|
'all_day': True,
|
||||||
'description': '',
|
'description': '',
|
||||||
'end_time': '2022-01-06 00:00:00',
|
'end_time': '2022-01-07 00:00:00',
|
||||||
'friendly_name': 'Twente Milieu',
|
'friendly_name': 'Twente Milieu',
|
||||||
'icon': 'mdi:delete-empty',
|
'icon': 'mdi:delete-empty',
|
||||||
'location': '',
|
'location': '',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user