mirror of
https://github.com/home-assistant/core.git
synced 2025-07-14 16:57:10 +00:00
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
@ -315,15 +315,14 @@ def async_setup(hass, config):
|
|||||||
client_cert = conf.get(CONF_CLIENT_CERT)
|
client_cert = conf.get(CONF_CLIENT_CERT)
|
||||||
tls_insecure = conf.get(CONF_TLS_INSECURE)
|
tls_insecure = conf.get(CONF_TLS_INSECURE)
|
||||||
protocol = conf[CONF_PROTOCOL]
|
protocol = conf[CONF_PROTOCOL]
|
||||||
|
|
||||||
# hbmqtt requires a client id to be set.
|
|
||||||
if client_id is None:
|
|
||||||
client_id = 'home-assistant'
|
|
||||||
elif broker_config:
|
elif broker_config:
|
||||||
# If no broker passed in, auto config to internal server
|
# If no broker passed in, auto config to internal server
|
||||||
broker, port, username, password, certificate, protocol = broker_config
|
broker, port, username, password, certificate, protocol = broker_config
|
||||||
# Embedded broker doesn't have some ssl variables
|
# Embedded broker doesn't have some ssl variables
|
||||||
client_key, client_cert, tls_insecure = None, None, None
|
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:
|
else:
|
||||||
err = "Unable to start MQTT broker."
|
err = "Unable to start MQTT broker."
|
||||||
if conf.get(CONF_EMBEDDED) is not None:
|
if conf.get(CONF_EMBEDDED) is not None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user