PTST / O365-HomeAssistant

Office 365 integration for Home Assistant
MIT License
69 stars 13 forks source link

Invalid Timezone #28

Closed briis closed 4 years ago

briis commented 4 years ago

Describe the bug The integration is setup and access is granted. But when restarting HASS I get the below error:

office365calendar: Error on device update!
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 299, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 461, in async_device_update
    await self.hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/office365calendar/sensor.py", line 248, in update
    self._state = self.device_state_attributes["event_active"]
  File "/config/custom_components/office365calendar/sensor.py", line 149, in device_state_attributes
    limit=999, query=query, include_recurring=True
  File "/usr/local/lib/python3.7/site-packages/O365/calendar.py", line 1680, in <genexpr>
    for event in data.get('value', []))
  File "/usr/local/lib/python3.7/site-packages/O365/calendar.py", line 873, in __init__
    cc('recurrence'), None))
  File "/usr/local/lib/python3.7/site-packages/O365/calendar.py", line 125, in __init__
    get_windows_tz(self.protocol.timezone))
  File "/usr/local/lib/python3.7/site-packages/O365/utils/windows_tz.py", line 642, in get_windows_tz
    "Can't find Iana TimeZone " + iana_tz.zone)
pytz.exceptions.UnknownTimeZoneError: "Can't find Iana TimeZone local"

Installation method (please select one):

Additional context Add any other context about the problem here.

github-actions[bot] commented 4 years ago

Thank you for posting an issue, please make sure to note the following Installation method: (HACS|Manual) Any logs provided by home assistant if applicable

briis commented 4 years ago

Forgot to add that, I am running Home Assistant in a Docker Container

PTST commented 4 years ago

Have you set the TZ environment variable so docker is aware of your current timezone?

briis commented 4 years ago

I was SURE I had that in my Docker Compose file - but I did not - bummer. Thanks that fixed it.