Skip to content

Commit

Permalink
Merge pull request #212 from bruxy70/development
Browse files Browse the repository at this point in the history
Calendar workaround - partial rollback
  • Loading branch information
bruxy70 authored Nov 23, 2020
2 parents a760168 + 8a99abc commit 4224b05
Showing 1 changed file with 20 additions and 14 deletions.
34 changes: 20 additions & 14 deletions custom_components/garbage_collection/calendar.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,16 @@ async def async_get_events(self, hass, start_datetime, end_datetime):
event = {
"uid": entity,
"summary": garbage_collection.name,
"start": {"date": start.strftime("%Y-%m-%d %H:%M")},
"end": {
"date": datetime.combine(
start, garbage_collection.expire_after
).strftime("%Y-%m-%d %H:%M")
},
"allDay": False,
"start": {"date": start.strftime("%Y-%m-%d")},
"end": {"date": end.strftime("%Y-%m-%d")},
"allDay": True,
# "start": {"date": start.strftime("%Y-%m-%d %H:%M")},
# "end": {
# "date": datetime.combine(
# start, garbage_collection.expire_after
# ).strftime("%Y-%m-%d %H:%M")
# },
# "allDay": False,
}
events.append(event)
start = await garbage_collection.async_find_next_date(
Expand Down Expand Up @@ -155,13 +158,16 @@ def update(self):
event = {
"uid": entity,
"summary": state_object.attributes.get("friendly_name"),
"start": {"date": start.strftime("%Y-%m-%d %H:%M")},
"end": {
"date": datetime.combine(
start, garbage_collection.expire_after
).strftime("%Y-%m-%d %H:%M")
},
"allDay": False,
"start": {"date": start.strftime("%Y-%m-%d")},
"end": {"date": end.strftime("%Y-%m-%d")},
"allDay": True,
# "start": {"date": start.strftime("%Y-%m-%d %H:%M")},
# "end": {
# "date": datetime.combine(
# start, garbage_collection.expire_after
# ).strftime("%Y-%m-%d %H:%M")
# },
# "allDay": False,
}
events.append(event)
events.sort(key=lambda x: x["start"]["date"])
Expand Down

0 comments on commit 4224b05

Please sign in to comment.