beufanet / linkyndle

Fetch dataset from Enedis portal (need Linky) and push it to grafana
53 stars 15 forks source link

Manage nonActive return #1

Closed beufanet closed 5 years ago

beufanet commented 5 years ago
2019-01-09 09:41:58,984 get Data from Enedis from 08/01/2019 to 09/01/2019
{'etat': {'valeur': 'nonActive'}, 'graphe': {}}
Traceback (most recent call last):
  File "linky2influxdays.py", line 108, in <module>
    for d in resEnedis['graphe']['data']:
KeyError: 'data'
beufanet commented 5 years ago

Sometimes, API does not expose yesterday values.

It will result in error JSON :

{'etat': {'valeur': 'nonActive'}, 'graphe': {}}