claudegel / sinope-130

Neviweb130 custom component for Home Assistant to manage devices connected via a GT130 and wifi devices from Sinopé
GNU General Public License v3.0
63 stars 13 forks source link

Unexpected exception importing platform custom_components.neviweb130.climate depuis v2.3.5 #172

Closed Guyohms closed 11 months ago

Guyohms commented 11 months ago

Depuis la dernière mise à jour, la plateforme neviweb130 ne fonctionne plus.

J'ai l'erreur suivante:

  File "/usr/src/homeassistant/homeassistant/loader.py", line 833, in get_platform
    cache[full_name] = self._import_platform(platform_name)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 850, 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/neviweb130/climate.py", line 1126
    elif self._is_low_voltage or self._is_double:
    ^^^^
SyntaxError: invalid syntax

J'ai aussi l'erreur Unable to prepare setup for platform neviweb130.climate: Platform not found (Exception importing custom_components.neviweb130.climate).

Si j'installe v2.3.4, ça semble bien fonctionner. Edit: La plateforme se charge, on peut envoyer des commandes au thermostats, mais il n'y a pas de feedback vers HA. (problème causé par les récents changements à Neviweb j'imagine).

Home Assistant 2023.8.4 Supervisor 2023.08.1 Operating System 10.5

karco commented 11 months ago

Même chose de mon côté

claudegel commented 11 months ago

Hi sorry for the bug. Sinopé is shaking the Neviweb code and many attributes are removed or renamed. I just forget to change the line 1126 in climate.py «elif» should be «if» so you can edit climate.py and remove the «el» if front of the if on line 1126. elif should be if, make sure the indentation is correct. The if should be aligned with the elif below. Or you can also copy the file climate.py in the master branch I've made the correction. If nobody report other error I'll push a new version tonight.

claudegel commented 11 months ago

J'ai produit une nouvelle version avec la correction

Merci de m'avoir rapporté cet erreur.