MTrab / pyworxcloud

PyPI module for integrating with Worx Cloud devices
GNU General Public License v3.0
22 stars 19 forks source link

UnknownTimeZoneError #52

Closed en2te closed 2 years ago

en2te commented 2 years ago

I updated your landroid-integration to the latest version (skipped a few...) and am getting the following error on startup. I deleted the mower, removed the integration from hacs and re-installed everything. Stil getting the same error. any idea what goes wrong? I am using the current version of HA (2022.6.7). Mower is a landxcape LX 790i.

error setting up entry Landxcape -xxx@xxxx.de for landroid_cloud
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 339, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/config/custom_components/landroid_cloud/__init__.py", line 64, in async_setup_entry
    result = await _async_setup(hass, entry)
  File "/config/custom_components/landroid_cloud/__init__.py", line 205, in _async_setup
    await hass.async_add_executor_job(cloud.connect, False, False)
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.9/site-packages/pyworxcloud/__init__.py", line 225, in connect
    self._fetch()
  File "/usr/local/lib/python3.9/site-packages/pyworxcloud/__init__.py", line 619, in _fetch
    device = DeviceHandler(self._api, product)
  File "/usr/local/lib/python3.9/site-packages/pyworxcloud/utils/devices.py", line 37, in __init__
    self.__mapinfo(api, product)
  File "/usr/local/lib/python3.9/site-packages/pyworxcloud/utils/devices.py", line 90, in __mapinfo
    self.warranty = Warranty(data)
  File "/usr/local/lib/python3.9/site-packages/pyworxcloud/utils/warranty.py", line 20, in __init__
    self["expires_at"] = string_to_time(
  File "/usr/local/lib/python3.9/site-packages/pyworxcloud/helpers/time_format.py", line 34, in string_to_time
    timezone = pytz.timezone(tz)
  File "/usr/local/lib/python3.9/site-packages/pytz/__init__.py", line 168, in timezone
    raise UnknownTimeZoneError(None)
pytz.exceptions.UnknownTimeZoneError: None
MTrab commented 2 years ago

For some reason your mower isn't reporting any timezones?! Did you set your city in the app? Indeed a bug, as this should have been catched and defaulted in the code thou

en2te commented 2 years ago

I can't set the city in the app ... it is a really simple one. The integration did work until version 2 I think. If you added the timezone-thing in v2 that may be the problem.

MTrab commented 2 years ago

That sound strange, as I have access to a Swedish LX812i, which is reporting Europe/Stockholm as timezone. But I must admit, doesn't know anything about the Landxcape setup, so where that is set I cannot answer.

But again - should be catched in the code, so I'll release a patch some time later today.