LightwaveSmartHome / homeassistant-lightwave-smart

Lightwave custom component for Home Assistant. Requires a Link Plus hub (Smart Series / generation 2), but will control both generation 1 ("Connect Series") and generation 2 ("Smart Series") devices.
https://www.lightwaverf.com
8 stars 1 forks source link

Error setting up entry #10

Open totalitarian opened 5 months ago

totalitarian commented 5 months ago

Hi, I get this error every day. Only way to fix it seems to be to delete the component and re-add each time. Any ideas?

Logger: homeassistant.config_entries
Source: config_entries.py:504
First occurred: 19:53:42 (1 occurrences)
Last logged: 19:53:42

Error setting up entry xxxx@gmail.com for lightwave_smart
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 504, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/lightwave_smart/__init__.py", line 89, in async_setup_entry
    await link.async_get_hierarchy()
  File "/usr/local/lib/python3.12/site-packages/lightwave_smart/lightwave_smart.py", line 625, in async_get_hierarchy
    await self.async_update_featureset_states()
  File "/usr/local/lib/python3.12/site-packages/lightwave_smart/lightwave_smart.py", line 676, in async_update_featureset_states
    await self._ws._async_sendmessage(message, process_read_item_cb)
  File "/usr/local/lib/python3.12/site-packages/lightwave_smart/lightwave_smart.py", line 361, in _async_sendmessage
    elif _retry >= MAX_RETRIES:
         ^^^^^^^^^^^^^^^^^^^^^
TypeError: '>=' not supported between instances of 'function' and 'int'
safzal commented 5 months ago

Hi I am getting error as well but mine is little different:

Source: config_entries.py:504
First occurred: 00:11:56 (1 occurrences)
Last logged: 00:11:56

Error setting up entry xxxxx@xxxx.com for lightwave_smart
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 504, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/lightwave_smart/__init__.py", line 86, in async_setup_entry
    connected = await link.async_connect(max_tries = 1, force_keep_alive_secs=0)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/lightwave_smart/lightwave_smart.py", line 797, in async_connect
    return await self._ws.async_connect(max_tries, force_keep_alive_secs)
                 ^^^^^^^^
AttributeError: 'LWLink2Public' object has no attribute '_ws'
safzal commented 5 months ago

I have just fixed my error by just added

 File "/config/custom_components/lightwave_smart/__init__.py", line 86, in async_setup_entry
    connected = await link.async_connect(max_tries = 1, force_keep_alive_secs=0)

->> 

 File "/config/custom_components/lightwave_smart/__init__.py", line 86, in async_setup_entry
    connected = await link.async_connect(max_tries = 1, force_keep_alive_secs=30)

so by every 30 sec with will check then 0 sec

ikb42 commented 5 months ago

Hi, will try to reproduce this issue locally and revert back here.