humbertogontijo / python-roborock

Python library & console tool for controlling Roborock vacuum
GNU General Public License v3.0
63 stars 29 forks source link

Error during calculating square_meter_clean_area #216

Closed michaelarnauts closed 4 months ago

michaelarnauts commented 4 months ago

I noticed the following error in my Home Assistant log.

Unexpected error fetching roborock data
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 312, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/roborock/coordinator.py", line 102, in _async_update_data
    await asyncio.gather(*(self._update_device_prop(), self.get_rooms()))
  File "/usr/src/homeassistant/homeassistant/components/roborock/coordinator.py", line 92, in _update_device_prop
    device_prop = await self.api.get_prop()
                  ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/roborock/version_1_apis/roborock_client_v1.py", line 266, in get_prop
    status, clean_summary, consumable = await asyncio.gather(
                                        ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/roborock/version_1_apis/roborock_client_v1.py", line 186, in get_clean_summary
    return CleanSummary(
           ^^^^^^^^^^^^^
  File "<string>", line 10, in __init__
  File "/usr/local/lib/python3.12/site-packages/roborock/containers.py", line 602, in __post_init__
    self.square_meter_clean_area = round(self.clean_area / 1000000, 1) if self.clean_area is not None else None
                                         ~~~~~~~~~~~~~~~~^~~~~~~~~
TypeError: unsupported operand type(s) for /: 'list' and 'int'
Lash-L commented 4 months ago

Please provide what clean area is. You can do this by calling the command get_status

michaelarnauts commented 4 months ago

It works now. I guess I got a reply that wasn't correctly formatted or parsed. I didn't have debug logging turned on, so I can't tell what the actual body was.