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

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

Open
Knobiwahn opened this issue Jan 13, 2023 · 4 comments
Open

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

Knobiwahn opened this issue Jan 13, 2023 · 4 comments

Comments

@Knobiwahn
Copy link

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()

@barisahmet
Copy link

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()

@gracar2002
Copy link

+1

@ChristophCaina
Copy link
Contributor

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

@R3inoudR
Copy link

R3inoudR commented Oct 7, 2024

Any updates about this issue?. Still recieving this error:

Unexpected error fetching sureha_sensors data
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 354, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 271, in _async_update_data
    return await self.update_method()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/sureha/__init__.py", line 112, in async_update_data
    return await spc.surepy.get_entities(refresh=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/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.12/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.12/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.12/site-packages/surepy/client.py", line 286, in call
    responselen = len(response_data.get("data", 0))
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: object of type 'int' has no len()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants