From 0ecceb601b7819745cb4f58f07dd4fd21b9ef52a Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Wed, 5 Jul 2017 06:47:30 +0200 Subject: [PATCH] Temporary fix for the client_id generation (fixes #8315) (#8336) * Temporary fix for the client_id generation (fixes #8315) * Fix comment * Move client id setting. * Lint --- homeassistant/components/mqtt/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/homeassistant/components/mqtt/__init__.py b/homeassistant/components/mqtt/__init__.py index 90c89b3193d..64e804d7715 100644 --- a/homeassistant/components/mqtt/__init__.py +++ b/homeassistant/components/mqtt/__init__.py @@ -315,6 +315,10 @@ 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