diff --git a/custom_components/mega/hub.py b/custom_components/mega/hub.py index 41833a1..dc93cd7 100644 --- a/custom_components/mega/hub.py +++ b/custom_components/mega/hub.py @@ -60,7 +60,7 @@ class MegaD: ): """Initialize.""" if mqtt_inputs is None or mqtt_inputs == 'None' or mqtt_inputs is False: - self.http = hass.data[DOMAIN][CONF_HTTP] + self.http = hass.data.get(DOMAIN, {}).get(CONF_HTTP) self.http.allowed_hosts |= {host} else: self.http = None