Fix mqtt API

This commit is contained in:
Xavier Beaudouin
2024-12-13 16:20:12 +01:00
parent 758bfff35c
commit feef76b9b5

View File

@ -12,6 +12,7 @@ from datetime import date,datetime
# Settings
from secret import ecodevice,use_eco,gx,gxsn,chgbleu,chgblanc,chgrouge,minbleu,minblanc,minrouge,prowlkey
# Lancer ceci du 01 Oct au 31 mai
# une fois avant 22h / une fois apres 22h
@ -23,7 +24,7 @@ ESSwoBL = 10 # ESS "Optimized without BatteryLife)
p = pyprowl.Prowl(prowlkey)
def sendprowl(foo):
p.notify(event='EDF TEMPO', description='Attention EDF Tarif: '+foo,
p.notify(event='EDF TEMPO', description='Attention EDF Tarif: '+foo,
priority=0, appName='EDF TEMPO')
# Log !
@ -51,7 +52,8 @@ def on_disconnect(client, userdata, rc):
flagConntected = 0
loggerinfo("Broker disconnected.")
client = mqtt.Client("clientdynTEMPO")
##client = mqtt.Client("clientdynTEMPO")
client = mqtt.Client(mqtt.CallbackAPIVersion.VERSION1)
flagConntected = 0
client.on_connect = on_connect
client.on_message = on_message