Add option to specify mqtt port
This commit is contained in:
parent
eae0539912
commit
6e44778cbb
2 changed files with 3 additions and 2 deletions
|
@ -1,4 +1,5 @@
|
||||||
mqtt_ip = "1.2.3.5" # MQTT broker IP or hostname
|
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
|
mqtt_topic = "testing/airPurifierBridge" # MQTT topic to use
|
||||||
|
|
||||||
miot_ip ="1.2.3.4" # Xiaomi arpurfier 3H IP or hostname
|
miot_ip ="1.2.3.4" # Xiaomi arpurfier 3H IP or hostname
|
||||||
|
|
|
@ -126,9 +126,9 @@ ap = miio.airpurifier_miot.AirPurifierMiot(ip=miot_ip, token=miot_token)
|
||||||
|
|
||||||
## The MQTT Client object
|
## The MQTT Client object
|
||||||
mqtt_clientId = "apBridge_" + socket.gethostname() + "_" + configfile
|
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 = paho.Client(mqtt_clientId)
|
||||||
mqttClient.connect(mqtt_ip)
|
mqttClient.connect(mqtt_ip, port=mqtt_port)
|
||||||
time.sleep(5)
|
time.sleep(5)
|
||||||
|
|
||||||
|
|
||||||
|
|
Reference in a new issue