sureha icon indicating copy to clipboard operation
sureha copied to clipboard

TypeError: object of type 'int' has no len()

Open Knobiwahn opened this issue 3 years ago • 9 comments

hi any ideas with this error?

Logger: homeassistant.components.surepetcare Source: components/surepetcare/init.py:190 Integration: Sure Petcare (documentation, issues) First occurred: 18:50:30 (3 occurrences) Last logged: 18:50:48

Unexpected error fetching surepetcare data: object of type 'int' has no len() Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 225, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/components/surepetcare/init.py", line 190, in _async_update_data return await self.surepy.get_entities(refresh=True) File "/usr/local/lib/python3.10/site-packages/surepy/init.py", line 400, in get_entities await self.get_latest_anonymous_drinks(household_id=household_id) File "/usr/local/lib/python3.10/site-packages/surepy/init.py", line 216, in get_latest_anonymous_drinks household_timeline = await self.get_household_timeline(household_id, entries=50) File "/usr/local/lib/python3.10/site-packages/surepy/init.py", line 266, in get_household_timeline if timeline := await self.sac.call(method="GET", resource=resource): File "/usr/local/lib/python3.10/site-packages/surepy/client.py", line 281, in call responselen = len(response_data.get("data", 0)) TypeError: object of type 'int' has no len()

Knobiwahn avatar Jan 13 '23 17:01 Knobiwahn

Same here.

2023-08-17 17:28:11.512 ERROR (MainThread) [custom_components.sureha] Unexpected error fetching sureha_sensors data: object of type 'int' has no len()
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 283, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 242, in _async_update_data
    return await self.update_method()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/sureha/__init__.py", line 98, in async_update_data
    return await spc.surepy.get_entities(refresh=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/surepy/__init__.py", line 400, in get_entities
    await self.get_latest_anonymous_drinks(household_id=household_id)
  File "/usr/local/lib/python3.11/site-packages/surepy/__init__.py", line 216, in get_latest_anonymous_drinks
    household_timeline = await self.get_household_timeline(household_id, entries=50)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/surepy/__init__.py", line 266, in get_household_timeline
    if timeline := await self.sac.call(method="GET", resource=resource):
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/surepy/client.py", line 281, in call
    responselen = len(response_data.get("data", 0))
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: object of type 'int' has no len()

barisahmet avatar Aug 17 '23 14:08 barisahmet

+1

gracar2002 avatar Oct 18 '23 13:10 gracar2002

should be fixed with #59 (new surepy libary version)

ChristophCaina avatar Jul 19 '24 10:07 ChristophCaina