add start and stop mqtt loop
This commit is contained in:
parent
2ab134d58a
commit
a12cec5377
@ -57,8 +57,10 @@ def subscribe(client: mqtt_client, topic):
|
||||
def on_message(client, userdata, msg):
|
||||
print(f"Received `{msg.payload.decode()}` from `{msg.topic}` topic")
|
||||
|
||||
client.loop_start()
|
||||
client.subscribe(topic)
|
||||
client.on_message = on_message
|
||||
client.loop_stop()
|
||||
|
||||
def monitor(charge_point_power):
|
||||
try:
|
||||
|
Loading…
Reference in New Issue
Block a user