mirror of
https://github.com/esphome/esphome.git
synced 2024-12-04 04:28:19 +01:00
Fix MQTT python 3 stringify IPAddress Type (#864)
Fixes https://github.com/esphome/issues/issues/850
This commit is contained in:
parent
e41a9875e3
commit
dd7c8dabb1
1 changed files with 2 additions and 2 deletions
|
@ -67,7 +67,7 @@ def initialize(config, subscriptions, on_message, username, password, client_id)
|
||||||
tls_version=tls_version, ciphers=None)
|
tls_version=tls_version, ciphers=None)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
client.connect(config[CONF_MQTT][CONF_BROKER], config[CONF_MQTT][CONF_PORT])
|
client.connect(str(config[CONF_MQTT][CONF_BROKER]), config[CONF_MQTT][CONF_PORT])
|
||||||
except socket.error as err:
|
except socket.error as err:
|
||||||
raise EsphomeError("Cannot connect to MQTT broker: {}".format(err))
|
raise EsphomeError("Cannot connect to MQTT broker: {}".format(err))
|
||||||
|
|
||||||
|
@ -127,7 +127,7 @@ def clear_topic(config, topic, username=None, password=None, client_id=None):
|
||||||
|
|
||||||
# From marvinroger/async-mqtt-client -> scripts/get-fingerprint/get-fingerprint.py
|
# From marvinroger/async-mqtt-client -> scripts/get-fingerprint/get-fingerprint.py
|
||||||
def get_fingerprint(config):
|
def get_fingerprint(config):
|
||||||
addr = config[CONF_MQTT][CONF_BROKER], config[CONF_MQTT][CONF_PORT]
|
addr = str(config[CONF_MQTT][CONF_BROKER]), config[CONF_MQTT][CONF_PORT]
|
||||||
_LOGGER.info("Getting fingerprint from %s:%s", addr[0], addr[1])
|
_LOGGER.info("Getting fingerprint from %s:%s", addr[0], addr[1])
|
||||||
try:
|
try:
|
||||||
cert_pem = ssl.get_server_certificate(addr)
|
cert_pem = ssl.get_server_certificate(addr)
|
||||||
|
|
Loading…
Reference in a new issue