claudegel / sinope-130

Neviweb130 custom component for Home Assistant to manage devices connected via a GT130 and wifi devices from Sinopé

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TypeError: string indices must be integers (core-2022.4.6)

kris2k2 opened this issue · comments

Hi Claude,

Just FYI, this came up after the recent core-2022.4.6 update that’s causing the module to fail initialization.

Logger: homeassistant.setup
Source: custom_components/neviweb130/init.py:213
Integration: neviweb130 (documentation)
First occurred: 9:02:12 PM (1 occurrences)
Last logged: 9:02:12 PM

Error during setup of component neviweb130
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 235, in _async_setup_component
result = await task
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/neviweb130/init.py", line 106, in setup
data = Neviweb130Data(hass_config[DOMAIN])
File "/config/custom_components/neviweb130/init.py", line 133, in init
self.neviweb130_client = Neviweb130Client(username, password, network)
File "/config/custom_components/neviweb130/init.py", line 159, in init
self.__get_network()
File "/config/custom_components/neviweb130/init.py", line 213, in __get_network
if network["name"] == self._network_name:
TypeError: string indices must be integers

So the issue comes from the account having exceeded its daily API quota limit because I had scan_interval defined to 5 (assuming minutes and not seconds, oops).

Rolling back to yesterdays backup confirmed this (as well as being greeted to a daily api quota exceeded error when logging in to neviweb.com)

I’ll propose a PR, when I have time, to better handle connection expectations before faulting into the array.

Your issue make me watch more on error message and I found that one of my water leak sensor had very low batt and this prevent the sensor to be loaded on reboot. I'll change my battery but I need to be able to load the sensor anyway and send warning about low bat. I'm out until friday night but I'll add better handling on connection error and low batt error this weekend.
Thank you for reporting and if you have time to propose a PR your welcome.

Hi there,

I'm having the same error (see below), but haven't made any changes recently. My scan_interval is and has always been 360. I just upgraded to 2022.8.6 but I was having this issue before while running 2022.7.x.

Logger: homeassistant.setup
Source: custom_components/neviweb130/__init__.py:213
Integration: neviweb130 ([documentation](https://github.com/claudegel/sinope-130))
First occurred: 10:03:23 PM (1 occurrences)
Last logged: 10:03:23 PM

Error during setup of component neviweb130
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 235, in _async_setup_component
    result = await task
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/neviweb130/__init__.py", line 106, in setup
    data = Neviweb130Data(hass_config[DOMAIN])
  File "/config/custom_components/neviweb130/__init__.py", line 133, in __init__
    self.neviweb130_client = Neviweb130Client(username, password, network)
  File "/config/custom_components/neviweb130/__init__.py", line 159, in __init__
    self.__get_network()
  File "/config/custom_components/neviweb130/__init__.py", line 213, in __get_network
    if network["name"] == self._network_name:
TypeError: string indices must be integers

Thanks!

This was fix on release 1.4.5. It was caused by a change in Neviweb API

Thank you Claude that fixed it. It's odd because I did look for an update recently but didn't see any. Anyway, thanks!

If you install your custom_components via HACS you will know immediately when there is an update available.