diff options
Diffstat (limited to 'mqtt_client')
| -rw-r--r-- | mqtt_client/main.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/mqtt_client/main.py b/mqtt_client/main.py index 0ba9f10..6df96c7 100644 --- a/mqtt_client/main.py +++ b/mqtt_client/main.py @@ -40,6 +40,8 @@ def on_connect(client, userdata, flags, reason_code, properties): def on_message(client, userdata, msg): payload = json.loads(msg.payload) topic = msg.topic.split('/')[-1] + print(f"GOT MESSAGE {payload}") + if topic.isnumeric(): stationId = int(topic) else: @@ -80,7 +82,7 @@ except KeyError: mqttc = mqtt.Client(mqtt.CallbackAPIVersion.VERSION2, protocol=MQTTProtocolVersion.MQTTv5) mqttc.on_connect = on_connect mqttc.on_message = on_message -mqttc.username_pw_set(user_name, user_pass) +#mqttc.username_pw_set(user_name, user_pass) connected = False |
