port must be a number
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Torma Kristóf 2020-08-06 17:18:03 +02:00
parent e59cba7603
commit 858c95220e
Signed by: tormakris
GPG Key ID: DC83C4F2C41B1047

View File

@ -1,4 +1,5 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import logging
import paho.mqtt.client as mqtt import paho.mqtt.client as mqtt
import config import config
@ -59,6 +60,7 @@ class MQTT:
""" """
self.client = mqtt.Client(client_id=self.client_id, clean_session=True, userdata=None, protocol=mqtt.MQTTv311, self.client = mqtt.Client(client_id=self.client_id, clean_session=True, userdata=None, protocol=mqtt.MQTTv311,
transport="tcp") transport="tcp")
self.port = int(self.port)
self.client.connect(host=self.host, port=self.port, keepalive=60) self.client.connect(host=self.host, port=self.port, keepalive=60)
def publish(self, message: str, subtopic: str = "") -> None: def publish(self, message: str, subtopic: str = "") -> None: