Restructered project
This commit is contained in:
22
miflora-master/main.py
Normal file
22
miflora-master/main.py
Normal file
@@ -0,0 +1,22 @@
|
||||
import paho.mqtt.client as mqtt
|
||||
import json
|
||||
|
||||
device_1 = {}
|
||||
device_1["mac"] = "C4:7C:8D:67:2E:1C"
|
||||
device_1["name"] = "Pflanze 1"
|
||||
device_1["client"] = "Controller_id_1"
|
||||
|
||||
device_2 = {}
|
||||
device_2["max"] = "C4:7C:8D:67:2E:4A"
|
||||
device_2["name"] = "Pflanze 2"
|
||||
device_2["client"] = "Controller_id_1"
|
||||
|
||||
devices = {}
|
||||
devices["devices"] = [device_1, device_2]
|
||||
|
||||
client = mqtt.Client()
|
||||
|
||||
client.connect("chimaera", 1883, 60)
|
||||
|
||||
client.publish("dev/mqtt-miflora/device-configuration", json.dumps(devices), qos=1, retain=True)
|
||||
|
||||
Reference in New Issue
Block a user