Fix mqtt API
This commit is contained in:
@ -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
|
||||
|
||||
Reference in New Issue
Block a user