mirror of
https://github.com/home-assistant/core.git
synced 2025-07-28 15:47:12 +00:00
Update ical + gcal-sync (#149413)
This commit is contained in:
parent
a33760bc1a
commit
ea2b3b3ff3
@ -230,7 +230,7 @@ async def async_setup_entry(
|
|||||||
calendar_info = calendars[calendar_id]
|
calendar_info = calendars[calendar_id]
|
||||||
else:
|
else:
|
||||||
calendar_info = get_calendar_info(
|
calendar_info = get_calendar_info(
|
||||||
hass, calendar_item.dict(exclude_unset=True)
|
hass, calendar_item.model_dump(exclude_unset=True)
|
||||||
)
|
)
|
||||||
new_calendars.append(calendar_info)
|
new_calendars.append(calendar_info)
|
||||||
|
|
||||||
@ -467,7 +467,7 @@ class GoogleCalendarEntity(
|
|||||||
else:
|
else:
|
||||||
start = DateOrDatetime(date=dtstart)
|
start = DateOrDatetime(date=dtstart)
|
||||||
end = DateOrDatetime(date=dtend)
|
end = DateOrDatetime(date=dtend)
|
||||||
event = Event.parse_obj(
|
event = Event.model_validate(
|
||||||
{
|
{
|
||||||
EVENT_SUMMARY: kwargs[EVENT_SUMMARY],
|
EVENT_SUMMARY: kwargs[EVENT_SUMMARY],
|
||||||
"start": start,
|
"start": start,
|
||||||
@ -538,7 +538,7 @@ async def async_create_event(entity: GoogleCalendarEntity, call: ServiceCall) ->
|
|||||||
|
|
||||||
if EVENT_IN in call.data:
|
if EVENT_IN in call.data:
|
||||||
if EVENT_IN_DAYS in call.data[EVENT_IN]:
|
if EVENT_IN_DAYS in call.data[EVENT_IN]:
|
||||||
now = datetime.now()
|
now = datetime.now().date()
|
||||||
|
|
||||||
start_in = now + timedelta(days=call.data[EVENT_IN][EVENT_IN_DAYS])
|
start_in = now + timedelta(days=call.data[EVENT_IN][EVENT_IN_DAYS])
|
||||||
end_in = start_in + timedelta(days=1)
|
end_in = start_in + timedelta(days=1)
|
||||||
@ -547,7 +547,7 @@ async def async_create_event(entity: GoogleCalendarEntity, call: ServiceCall) ->
|
|||||||
end = DateOrDatetime(date=end_in)
|
end = DateOrDatetime(date=end_in)
|
||||||
|
|
||||||
elif EVENT_IN_WEEKS in call.data[EVENT_IN]:
|
elif EVENT_IN_WEEKS in call.data[EVENT_IN]:
|
||||||
now = datetime.now()
|
now = datetime.now().date()
|
||||||
|
|
||||||
start_in = now + timedelta(weeks=call.data[EVENT_IN][EVENT_IN_WEEKS])
|
start_in = now + timedelta(weeks=call.data[EVENT_IN][EVENT_IN_WEEKS])
|
||||||
end_in = start_in + timedelta(days=1)
|
end_in = start_in + timedelta(days=1)
|
||||||
|
@ -7,5 +7,5 @@
|
|||||||
"documentation": "https://www.home-assistant.io/integrations/google",
|
"documentation": "https://www.home-assistant.io/integrations/google",
|
||||||
"iot_class": "cloud_polling",
|
"iot_class": "cloud_polling",
|
||||||
"loggers": ["googleapiclient"],
|
"loggers": ["googleapiclient"],
|
||||||
"requirements": ["gcal-sync==7.1.0", "oauth2client==4.1.3", "ical==10.0.4"]
|
"requirements": ["gcal-sync==8.0.0", "oauth2client==4.1.3", "ical==11.0.0"]
|
||||||
}
|
}
|
||||||
|
@ -221,7 +221,7 @@ def _get_calendar_event(event: Event) -> CalendarEvent:
|
|||||||
end = start + timedelta(days=1)
|
end = start + timedelta(days=1)
|
||||||
|
|
||||||
return CalendarEvent(
|
return CalendarEvent(
|
||||||
summary=event.summary,
|
summary=event.summary or "",
|
||||||
start=start,
|
start=start,
|
||||||
end=end,
|
end=end,
|
||||||
description=event.description,
|
description=event.description,
|
||||||
|
@ -7,5 +7,5 @@
|
|||||||
"documentation": "https://www.home-assistant.io/integrations/local_calendar",
|
"documentation": "https://www.home-assistant.io/integrations/local_calendar",
|
||||||
"iot_class": "local_polling",
|
"iot_class": "local_polling",
|
||||||
"loggers": ["ical"],
|
"loggers": ["ical"],
|
||||||
"requirements": ["ical==10.0.4"]
|
"requirements": ["ical==11.0.0"]
|
||||||
}
|
}
|
||||||
|
@ -5,5 +5,5 @@
|
|||||||
"config_flow": true,
|
"config_flow": true,
|
||||||
"documentation": "https://www.home-assistant.io/integrations/local_todo",
|
"documentation": "https://www.home-assistant.io/integrations/local_todo",
|
||||||
"iot_class": "local_polling",
|
"iot_class": "local_polling",
|
||||||
"requirements": ["ical==10.0.4"]
|
"requirements": ["ical==11.0.0"]
|
||||||
}
|
}
|
||||||
|
@ -98,7 +98,7 @@ def _get_calendar_event(event: Event) -> CalendarEvent:
|
|||||||
"""Return a CalendarEvent from an API event."""
|
"""Return a CalendarEvent from an API event."""
|
||||||
|
|
||||||
return CalendarEvent(
|
return CalendarEvent(
|
||||||
summary=event.summary,
|
summary=event.summary or "",
|
||||||
start=(
|
start=(
|
||||||
dt_util.as_local(event.start)
|
dt_util.as_local(event.start)
|
||||||
if isinstance(event.start, datetime)
|
if isinstance(event.start, datetime)
|
||||||
|
@ -8,5 +8,5 @@
|
|||||||
"iot_class": "cloud_polling",
|
"iot_class": "cloud_polling",
|
||||||
"loggers": ["ical"],
|
"loggers": ["ical"],
|
||||||
"quality_scale": "silver",
|
"quality_scale": "silver",
|
||||||
"requirements": ["ical==10.0.4"]
|
"requirements": ["ical==11.0.0"]
|
||||||
}
|
}
|
||||||
|
4
requirements_all.txt
generated
4
requirements_all.txt
generated
@ -995,7 +995,7 @@ gardena-bluetooth==1.6.0
|
|||||||
gassist-text==0.0.14
|
gassist-text==0.0.14
|
||||||
|
|
||||||
# homeassistant.components.google
|
# homeassistant.components.google
|
||||||
gcal-sync==7.1.0
|
gcal-sync==8.0.0
|
||||||
|
|
||||||
# homeassistant.components.geniushub
|
# homeassistant.components.geniushub
|
||||||
geniushub-client==0.7.1
|
geniushub-client==0.7.1
|
||||||
@ -1210,7 +1210,7 @@ ibmiotf==0.3.4
|
|||||||
# homeassistant.components.local_calendar
|
# homeassistant.components.local_calendar
|
||||||
# homeassistant.components.local_todo
|
# homeassistant.components.local_todo
|
||||||
# homeassistant.components.remote_calendar
|
# homeassistant.components.remote_calendar
|
||||||
ical==10.0.4
|
ical==11.0.0
|
||||||
|
|
||||||
# homeassistant.components.caldav
|
# homeassistant.components.caldav
|
||||||
icalendar==6.1.0
|
icalendar==6.1.0
|
||||||
|
4
requirements_test_all.txt
generated
4
requirements_test_all.txt
generated
@ -865,7 +865,7 @@ gardena-bluetooth==1.6.0
|
|||||||
gassist-text==0.0.14
|
gassist-text==0.0.14
|
||||||
|
|
||||||
# homeassistant.components.google
|
# homeassistant.components.google
|
||||||
gcal-sync==7.1.0
|
gcal-sync==8.0.0
|
||||||
|
|
||||||
# homeassistant.components.geniushub
|
# homeassistant.components.geniushub
|
||||||
geniushub-client==0.7.1
|
geniushub-client==0.7.1
|
||||||
@ -1050,7 +1050,7 @@ ibeacon-ble==1.2.0
|
|||||||
# homeassistant.components.local_calendar
|
# homeassistant.components.local_calendar
|
||||||
# homeassistant.components.local_todo
|
# homeassistant.components.local_todo
|
||||||
# homeassistant.components.remote_calendar
|
# homeassistant.components.remote_calendar
|
||||||
ical==10.0.4
|
ical==11.0.0
|
||||||
|
|
||||||
# homeassistant.components.caldav
|
# homeassistant.components.caldav
|
||||||
icalendar==6.1.0
|
icalendar==6.1.0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user