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 # Settings
from secret import ecodevice,use_eco,gx,gxsn,chgbleu,chgblanc,chgrouge,minbleu,minblanc,minrouge,prowlkey from secret import ecodevice,use_eco,gx,gxsn,chgbleu,chgblanc,chgrouge,minbleu,minblanc,minrouge,prowlkey
# Lancer ceci du 01 Oct au 31 mai # Lancer ceci du 01 Oct au 31 mai
# une fois avant 22h / une fois apres 22h # une fois avant 22h / une fois apres 22h
@ -51,7 +52,8 @@ def on_disconnect(client, userdata, rc):
flagConntected = 0 flagConntected = 0
loggerinfo("Broker disconnected.") loggerinfo("Broker disconnected.")
client = mqtt.Client("clientdynTEMPO") ##client = mqtt.Client("clientdynTEMPO")
client = mqtt.Client(mqtt.CallbackAPIVersion.VERSION1)
flagConntected = 0 flagConntected = 0
client.on_connect = on_connect client.on_connect = on_connect
client.on_message = on_message client.on_message = on_message