some additions
This commit is contained in:
parent
b798e138fa
commit
5338490503
@ -9,7 +9,7 @@ Used protocol for interaction: mqtt (paho-mqtt module)
|
|||||||
|
|
||||||
# imports
|
# imports
|
||||||
import paho.mqtt.client as mqtt
|
import paho.mqtt.client as mqtt
|
||||||
from software.defines import MQTT_BROKER_LOCAL, MQTT_BROKER_GLOBAL, Topics
|
from software.defines import MQTT_BROKER_LOCAL, MQTT_BROKER_GLOBAL, Topics, BACKEND_CLIENT_ID
|
||||||
from plantdatabase import PlantDataBase
|
from plantdatabase import PlantDataBase
|
||||||
import data_functions
|
import data_functions
|
||||||
|
|
||||||
@ -64,7 +64,7 @@ def on_connect(client: mqtt.Client, userdata, flags, rc):
|
|||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
client = mqtt.Client()
|
client = mqtt.Client(BACKEND_CLIENT_ID)
|
||||||
client.on_connect = on_connect
|
client.on_connect = on_connect
|
||||||
client.connect(MQTT_BROKER_GLOBAL)
|
client.connect(MQTT_BROKER_GLOBAL)
|
||||||
client.loop_forever()
|
client.loop_forever()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user