Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loading fails when missing last_status #148

Closed
MTrab opened this issue May 20, 2023 · 2 comments · Fixed by #149
Closed

Loading fails when missing last_status #148

MTrab opened this issue May 20, 2023 · 2 comments · Fixed by #149
Labels
bug Something isn't working

Comments

@MTrab
Copy link
Owner

MTrab commented May 20, 2023

Zone mapping renders an error when key "last_status" is missing in dat dictionary.

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 387, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/config/custom_components/landroid_cloud/__init__.py", line 63, in async_setup_entry
    result = await _async_setup(hass, entry)
  File "/config/custom_components/landroid_cloud/__init__.py", line 206, in _async_setup
    await hass.async_add_executor_job(cloud.connect)
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.10/site-packages/pyworxcloud/__init__.py", line 235, in connect
    self._fetch()
  File "/usr/local/lib/python3.10/site-packages/pyworxcloud/__init__.py", line 516, in _fetch
    device = DeviceHandler(self._api, mower)
  File "/usr/local/lib/python3.10/site-packages/pyworxcloud/utils/devices.py", line 46, in __init__
    self.__mapinfo(api, mower)
  File "/usr/local/lib/python3.10/site-packages/pyworxcloud/utils/devices.py", line 100, in __mapinfo
    self.zone = Zone(data)
  File "/usr/local/lib/python3.10/site-packages/pyworxcloud/utils/zone.py", line 22, in __init__
    self["index"] = data["last_status"]["payload"]["dat"]["lz"]
KeyError: 'lz'

Reported in MTrab/landroid_cloud#372

@yack1
Copy link

yack1 commented May 22, 2023

I updated to the latest version 3.0.0 and this error still occurs when trying to run the integration.

Logger: homeassistant.config_entries
Source: custom_components/landroid_cloud/init.py:206
Integration: Landroid Cloud (documentation, issues)
First occurred: 12:38:54 (1 occurrences)
Last logged: 12:38:54

Error setting up entry Worx -(*************)@gmail.com for landroid_cloud
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 387, in async_setup
result = await component.async_setup_entry(hass, self)
File "/config/custom_components/landroid_cloud/init.py", line 63, in async_setup_entry
result = await _async_setup(hass, entry)
File "/config/custom_components/landroid_cloud/init.py", line 206, in _async_setup
await hass.async_add_executor_job(cloud.connect)
File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.10/site-packages/pyworxcloud/init.py", line 235, in connect
self._fetch()
File "/usr/local/lib/python3.10/site-packages/pyworxcloud/init.py", line 516, in _fetch
device = DeviceHandler(self._api, mower)
File "/usr/local/lib/python3.10/site-packages/pyworxcloud/utils/devices.py", line 46, in init
self.__mapinfo(api, mower)
File "/usr/local/lib/python3.10/site-packages/pyworxcloud/utils/devices.py", line 100, in __mapinfo
self.zone = Zone(data)
File "/usr/local/lib/python3.10/site-packages/pyworxcloud/utils/zone.py", line 22, in init
self["index"] = data["last_status"]["payload"]["dat"]["lz"]
TypeError: 'NoneType' object is not subscriptable

@MTrab
Copy link
Owner Author

MTrab commented May 22, 2023

As you can see, the issue is still active in landroid cloud. The fix hasn't been fixed in landroid cloud, only in the parent module

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants