1
0
Fork 0

Add option to specify mqtt port

This commit is contained in:
J. Elfring (x) 2020-11-12 18:41:41 +01:00
parent eae0539912
commit 6e44778cbb
2 changed files with 3 additions and 2 deletions

View file

@ -1,4 +1,5 @@
mqtt_ip = "1.2.3.5" # MQTT broker IP or hostname
mqtt_port = 1883 # MQTT broker port
mqtt_topic = "testing/airPurifierBridge" # MQTT topic to use
miot_ip ="1.2.3.4" # Xiaomi arpurfier 3H IP or hostname

View file

@ -126,9 +126,9 @@ ap = miio.airpurifier_miot.AirPurifierMiot(ip=miot_ip, token=miot_token)
## The MQTT Client object
mqtt_clientId = "apBridge_" + socket.gethostname() + "_" + configfile
log(1, "Connecting to MQTT broker " + mqtt_ip + " as " + mqtt_clientId)
log(1, "Connecting to MQTT broker " + mqtt_ip + ":" + str(mqtt_port) + " as " + mqtt_clientId)
mqttClient = paho.Client(mqtt_clientId)
mqttClient.connect(mqtt_ip)
mqttClient.connect(mqtt_ip, port=mqtt_port)
time.sleep(5)