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

List index out of range #13

Open
lesensei opened this issue Mar 30, 2021 · 2 comments
Open

List index out of range #13

lesensei opened this issue Mar 30, 2021 · 2 comments

Comments

@lesensei
Copy link

Hello !

I'm trying to use the "Suez Water" integration on home assistant, but it looks like it's having a problem rooted in this library. Here's the stacktrace I'm getting:

2021-03-30 10:12:15 ERROR (MainThread) [homeassistant.components.sensor] suez_water: Error on device update!
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 360, in _async_add_entity
await entity.async_device_update(warning=False)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 465, in async_device_update
await task
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/suez_water/sensor.py", line 124, in update
self._fetch_data()
File "/usr/src/homeassistant/homeassistant/components/suez_water/sensor.py", line 88, in _fetch_data
self.client.update()
File "/usr/local/lib/python3.8/site-packages/pysuez/client.py", line 234, in update
self._fetch_data()
File "/usr/local/lib/python3.8/site-packages/pysuez/client.py", line 111, in _fetch_data
self.state = int(float(data.json()[int(
IndexError: list index out of range

Please tell me if there's any additional info that may help solving this.

Thanks for your work !

@laurent-martin
Copy link

Home assistant uses an older version of this library.
I had the same error.
I have manually replaced this lib with the latest version, and now it works in home assistant.
There was one problem though: the newer version expects one aditional mandatory argument : provider.
I have made a pull request to add a default value for this parameter, so that Home assistant can use next version without code change...

@ooii
Copy link
Owner

ooii commented Oct 30, 2023

Guys,
I'm sorry for not responding to these issues. I was very busy with other stuff and, to be honest, the integration was not satisfactory for me, so I stopped using it (and looking to this repo). I got some complaints recently and decided to give a look and discovered all these issues.
I'll try to bring a new and better integration that takes into consideration all the issues and sub-providers, and I'll try to make it doable from the UI. Please, be patient.

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

3 participants