This applies what was the intended fix in #8336. moves the fallback for setting client_id to the case when no mqtt config was provided at all. This should reflect the most common use case that fails. This commit is a workaround and should be reverted when hbmqtt is fixed to allow empty client_id again.
This commit is contained in:
parent
20a9899354
commit
c63bdd5afe
1 changed files with 3 additions and 4 deletions
|
@ -315,15 +315,14 @@ def async_setup(hass, config):
|
|||
client_cert = conf.get(CONF_CLIENT_CERT)
|
||||
tls_insecure = conf.get(CONF_TLS_INSECURE)
|
||||
protocol = conf[CONF_PROTOCOL]
|
||||
|
||||
# hbmqtt requires a client id to be set.
|
||||
if client_id is None:
|
||||
client_id = 'home-assistant'
|
||||
elif broker_config:
|
||||
# If no broker passed in, auto config to internal server
|
||||
broker, port, username, password, certificate, protocol = broker_config
|
||||
# Embedded broker doesn't have some ssl variables
|
||||
client_key, client_cert, tls_insecure = None, None, None
|
||||
# hbmqtt requires a client id to be set.
|
||||
if client_id is None:
|
||||
client_id = 'home-assistant'
|
||||
else:
|
||||
err = "Unable to start MQTT broker."
|
||||
if conf.get(CONF_EMBEDDED) is not None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue