passage de hubeau en V1 et selection de parametres

This commit is contained in:
nemesis 2025-07-14 12:34:06 +02:00
parent 45f4e994cf
commit 7262d190ba

View file

@ -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/signals'
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
@ -1748,6 +1748,7 @@ async def eau(room, message):
if (len(eaux["data"]) > 0):
try:
f = True
comp_msg=""
for eau in eaux["data"]:
if (f):
nom = eau["nom_commune"]
@ -1764,7 +1765,8 @@ async def eau(room, message):
if (limite == "(None)"):
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:
await msg(room, str(eaux), sender)
else: