sebcaps / atmofrance

About Home assistant component to get air quality for french cities
MIT License
7 stars 3 forks source link

Error : "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 300, #8

Closed prohand closed 10 months ago

prohand commented 10 months ago

Bonjour,

L'erreur suivante s'est affiché dans les logs :

Logger: custom_components.atmofrance
Source: helpers/update_coordinator.py:300
Integration: Atmo France ([documentation](https://github.com/sebcaps/atmofrance), [issues](https://github.com/sebcaps/atmofrance/issues))
First occurred: 13:24:30 (1 occurrences)
Last logged: 13:24:30

Unexpected error fetching Atmo France data: string indices must be integers, not 'str'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 300, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 256, in _async_update_data
    return await self.update_method()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/atmofrance/__init__.py", line 60, in _update_method
    data = await self.api.get_data(self.config.data[CONF_INSEE_CODE])
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/atmofrance/api.py", line 64, in get_data
    if len(json["features"]) > 0:  # At least one result
           ~~~~^^^^^^^^^^^^
TypeError: string indices must be integers, not 'str'

Est-il possible de voir pour corriger le problème svp ? :)

sebcaps commented 10 months ago

Bonjour, Peux tu stp preciser le code postal/code INSEE stp ? Cela facilitera l'investigation/correction. Merci

prohand commented 10 months ago

Oui Code postal 69500 Insee 69149

merci

sebcaps commented 10 months ago

@prohand je n'ai pas réussi à reproduire, le pb, plus exactement j'ai réussi à récupérer les données avec le CP (69500, bron) image Peux tu réésayer ? As tu la dernière version ? Il est possible qu'il y ai eu un pb temporaire dans les données fournies par AtmoData.(?)

prohand commented 10 months ago

Merci pour le retour. Je n'ai plus eu le problème donc on va miser sur un problème temporaire ;)