rstrouse / ESPSomfy-RTS-HA

Control your somfy shades in Home Assistant
The Unlicense
102 stars 9 forks source link

Integration doesn't reconnect properly after home assistant restart #27

Closed Ay1tsMe closed 6 months ago

Ay1tsMe commented 6 months ago

Recently having an issue where every time home assistant has been restarted, the integration doesn't reconnect back to the blinds, causing them to be labelled unavailable. I am able to access the web gui on my esp32 and operate the blinds through that so I think its something to do with the integration. A temporary fix for this is to manually reload the integration then it connects back instantly. Currently running on v2.2.2 with HACS.

Screenshot_2023-12-11-08-25-42-69_c3a231c25ed346e59462e84656a70e50

GraceO77 commented 6 months ago

I am seeing the same issue (version 2.2.2c), logs show the below: image

Calimerorulez commented 6 months ago

Same here

rstrouse commented 6 months ago

I goofed up the deployment and didn't get all the changes into the repo before generating the release. Please reload v2.2.3 and it will be fixed.

Calimerorulez commented 6 months ago

@rstrouse

Fixed! Thanks :)

Ay1tsMe commented 6 months ago

Yep seems to be working now 👍

gieljnssns commented 6 months ago

@rstrouse I'm still seeing an error like this after every restart, but the integration still works.

Logger: homeassistant.loader
Source: loader.py:842
First occurred: December 29, 2023 at 17:10:08 (1 occurrences)
Last logged: December 29, 2023 at 17:10:08

Unexpected exception importing platform custom_components.espsomfy_rts.switch
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/loader.py", line 842, in get_platform
    cache[full_name] = self._import_platform(platform_name)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 859, in _import_platform
    return importlib.import_module(f"{self.pkg_path}.{platform_name}")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 936, in exec_module
  File "<frozen importlib._bootstrap_external>", line 1074, in get_code
  File "<frozen importlib._bootstrap_external>", line 1004, in source_to_code
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/config/custom_components/espsomfy_rts/switch.py", line 28
    if "shadeType" in shade and (int(shade["shadeType"]) == 9 or int(shade["shadeType"] == 10):
                                                                                              ^
SyntaxError: invalid syntax