generated from Nemesis/Exemple
passage de hubeau en V1 et selection de parametres
This commit is contained in:
parent
45f4e994cf
commit
7262d190ba
1 changed files with 4 additions and 2 deletions
|
@ -31,7 +31,7 @@ RTE_SECRET = None # Bot's RTE SECRET
|
||||||
#ecowatt_url = 'https://digital.iservices.rte-france.com/open_api/ecowatt/v4/sandbox/signals'
|
#ecowatt_url = 'https://digital.iservices.rte-france.com/open_api/ecowatt/v4/sandbox/signals'
|
||||||
ecowatt_url = 'https://digital.iservices.rte-france.com/open_api/ecowatt/v4/signals'
|
ecowatt_url = 'https://digital.iservices.rte-france.com/open_api/ecowatt/v4/signals'
|
||||||
commune_url = 'https://geo.api.gouv.fr/communes?<TYPE>=<NOM>&fields=nom,code,codesPostaux,population&format=json'
|
commune_url = 'https://geo.api.gouv.fr/communes?<TYPE>=<NOM>&fields=nom,code,codesPostaux,population&format=json'
|
||||||
eau_url = 'https://hubeau.eaufrance.fr/api/vbeta/qualite_eau_potable/resultats_dis?<TYPE>=<NOM>&size=5'
|
eau_url = 'https://hubeau.eaufrance.fr/api/v1/qualite_eau_potable/resultats_dis?<TYPE>=<NOM>&size=20&code_parametre=1301,1302,1312,1313,1305,1335,1339,1340,1350,1433,1377,1338,6276,1295,1382,1383,1388,1387,1392'
|
||||||
|
|
||||||
wattobj = None
|
wattobj = None
|
||||||
|
|
||||||
|
@ -1748,6 +1748,7 @@ async def eau(room, message):
|
||||||
if (len(eaux["data"]) > 0):
|
if (len(eaux["data"]) > 0):
|
||||||
try:
|
try:
|
||||||
f = True
|
f = True
|
||||||
|
comp_msg=""
|
||||||
for eau in eaux["data"]:
|
for eau in eaux["data"]:
|
||||||
if (f):
|
if (f):
|
||||||
nom = eau["nom_commune"]
|
nom = eau["nom_commune"]
|
||||||
|
@ -1764,7 +1765,8 @@ async def eau(room, message):
|
||||||
if (limite == "(None)"):
|
if (limite == "(None)"):
|
||||||
limite = ""
|
limite = ""
|
||||||
param = eau["libelle_parametre"] + " " + limite
|
param = eau["libelle_parametre"] + " " + limite
|
||||||
await msg(room, "Résultat du " + date + " : " + res + unite + " / " + param + ".", sender)
|
comp_msg = comp_msg + "Résultat du " + date + " : " + res + unite + " / " + param + ".\n"
|
||||||
|
await msg(room, comp_msg, sender)
|
||||||
except:
|
except:
|
||||||
await msg(room, str(eaux), sender)
|
await msg(room, str(eaux), sender)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue