Phype / purei9_unofficial

This project includes a client/library to connect to Electrolux and AEG cleaner robots.
https://pypi.org/project/purei9-unofficial
MIT License
29 stars 6 forks source link

'NoneType' object is not iterable #30

Open Ekman opened 5 hours ago

Ekman commented 5 hours ago

I started getting the below error, as of a couple of days ago:

2024-11-24 17:32:48.550 ERROR (MainThread) [custom_components.purei9.coordinator] Unexpected error fetching 900277466035000711100106 data: 'NoneType' object is not iterable
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 300, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/purei9/coordinator.py", line 34, in _async_update_data
    return await self.hass.async_add_executor_job(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/purei9/coordinator.py", line 62, in update_and_create_params
    params.maps = list(map(purei9.params_map_create, self._robot.getMaps()))
                                                     ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/purei9_unofficial/cloudv3.py", line 148, in getMaps
    return list(map(lambda x: CloudMap(self, x), r.json()))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/purei9_unofficial/cloudv3.py", line 148, in <lambda>
    return list(map(lambda x: CloudMap(self, x), r.json()))
                              ^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/purei9_unofficial/cloudv3.py", line 302, in __init__
    self.zones = list(map(lambda x: CloudZone(self, x), js["zones"]))
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not iterable

Any suggestions what it could be?

EDIT: To be clear. It worked and then stopped a couple of days ago. Feels like the API might've changed.

Ekman commented 5 hours ago

Hm, looks like one of my vacuums added a new map. It should detect the existing one, but it didn't and instead created a new map. The new map contains 0 zones.