Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Erreur loader.py et setup.py #16

Open
Flamigni opened this issue Apr 3, 2024 · 1 comment
Open

Erreur loader.py et setup.py #16

Flamigni opened this issue Apr 3, 2024 · 1 comment

Comments

@Flamigni
Copy link

Flamigni commented Apr 3, 2024

Bonjour,
Je rencontre 2 erreurs une fois le paramétrage effectué :

Unable to prepare setup for platform 'portail_eau_fr.sensor': Platform not found (Exception importing custom_components.portail_eau_fr.sensor).

`Unexpected exception importing platform custom_components.portail_eau_fr.sensor

Traceback (most recent call last):
File "/var/www/homeassistant/lib/python3.11/site-packages/homeassistant/loader.py", line 1025, in _load_platform
cache[full_name] = self._import_platform(platform_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/www/homeassistant/lib/python3.11/site-packages/homeassistant/loader.py", line 1058, 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 "", line 1204, in _gcd_import
File "", line 1176, in _find_and_load
File "", line 1147, in _find_and_load_unlocked
File "", line 690, in _load_unlocked
File "", line 936, in exec_module
File "", line 1074, in get_code
File "", line 1004, in source_to_code
File "", line 241, in _call_with_frames_removed
File "/home/yunohost.app/homeassistant/custom_components/portail_eau_fr/sensor.py", line 43
self._name = f'{account['brandCode']} meter {api._id}'
^^^^^^^^^
SyntaxError: f-string: unmatched '['
`
Désolé je ne sais pas comment faire du debug.

Merci pour votre aide :)

@laurent-martin
Copy link
Owner

Il s'agit peut etre d'un probleme du a la version de python, j'ai mis a jour pour eviter les problemes de quote ou double quote non-matchées.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants