Updated ics_calendar
This commit is contained in:
@@ -286,18 +286,15 @@ class ICSCalendarData: # pylint: disable=R0902
|
||||
minutes=device_data[CONF_DOWNLOAD_INTERVAL]
|
||||
),
|
||||
},
|
||||
)
|
||||
|
||||
self._calendar_data.set_headers(
|
||||
).headers(
|
||||
device_data[CONF_USERNAME],
|
||||
device_data[CONF_PASSWORD],
|
||||
device_data[CONF_USER_AGENT],
|
||||
device_data[CONF_ACCEPT_HEADER],
|
||||
)
|
||||
|
||||
if device_data.get(CONF_SET_TIMEOUT):
|
||||
self._calendar_data.set_timeout(
|
||||
device_data[CONF_CONNECTION_TIMEOUT]
|
||||
self._calendar_data.timeout(
|
||||
device_data.get(CONF_CONNECTION_TIMEOUT)
|
||||
)
|
||||
|
||||
async def async_get_events(
|
||||
@@ -313,7 +310,9 @@ class ICSCalendarData: # pylint: disable=R0902
|
||||
event_list: list[ParserEvent] = []
|
||||
if await self._calendar_data.download_calendar():
|
||||
_LOGGER.debug("%s: Setting calendar content", self.name)
|
||||
self.parser.set_content(self._calendar_data.get())
|
||||
await self._hass.async_add_executor_job(
|
||||
lambda: self.parser.set_content(self._calendar_data.get())
|
||||
)
|
||||
try:
|
||||
event_list = self.parser.get_event_list(
|
||||
start=start_date,
|
||||
@@ -345,7 +344,9 @@ class ICSCalendarData: # pylint: disable=R0902
|
||||
parser_event: ParserEvent | None = None
|
||||
if await self._calendar_data.download_calendar():
|
||||
_LOGGER.debug("%s: Setting calendar content", self.name)
|
||||
self.parser.set_content(self._calendar_data.get())
|
||||
await self._hass.async_add_executor_job(
|
||||
lambda: self.parser.set_content(self._calendar_data.get())
|
||||
)
|
||||
try:
|
||||
parser_event: ParserEvent | None = self.parser.get_current_event(
|
||||
include_all_day=self.include_all_day,
|
||||
|
||||
Reference in New Issue
Block a user