JohNan / home-assistant-flichub

Custom HomeAssistant integration for FlicHub
MIT License
8 stars 3 forks source link

HA-Flichub error #10

Closed nk2261 closed 1 year ago

nk2261 commented 1 year ago

It keeps saying "Failed setup, will retry" When i check the debug logs below is the error i see repeated over and over

2023-09-26 07:37:29.301 WARNING (MainThread) [pyflichub.client] FlicButton.init() missing 1 required positional argument: 'battery_timestamp' Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/pyflichub/client.py", line 131, in data_received self._handle_command(Command(msg)) File "/usr/local/lib/python3.11/site-packages/pyflichub/client.py", line 145, in _handle_command self.buttons = [FlicButton(button) for button in humps.decamelize(cmd.data)] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/pyflichub/client.py", line 145, in self.buttons = [FlicButton(**button) for button in humps.decamelize(cmd.data)] ^^^^^^^^^^^^^^^^^^^^

lindehoff commented 1 year ago

I get a different error in the logs:

Logger: pyflichub.client
Source: /usr/local/lib/python3.11/site-packages/pyflichub/client.py:133 
First occurred: 21:07:13 (13 occurrences) 
Last logged: 21:14:48

'NoneType' object is not iterable
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/pyflichub/client.py", line 131, in data_received
    self._handle_command(Command(**msg))
  File "/usr/local/lib/python3.11/site-packages/pyflichub/client.py", line 150, in _handle_command
    self.network = FlicHubInfo(**humps.decamelize(cmd.data))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pyflichub/flichub.py", line 41, in __init__
    self._dhcp.wifi.ssid = _decode_ssid(wifi_state.get('ssid', None)) if wifi_state else None
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pyflichub/flichub.py", line 34, in _decode_ssid
    return ''.join(chr(byte) for byte in ssid_list)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not iterable
JohNan commented 1 year ago

Thanks for the reports. I have published a new pre release that hopefully fixes both of the issues. Please try it and let me know!

lindehoff commented 1 year ago

Yes, now it works for me, thank you.

nk2261 commented 1 year ago

it also worked for me thank you