Bugfix: prevent error notification when octoprint server auto detected but no configuration present. (#20303)

This commit is contained in:
Fabien Piuzzi 2019-01-22 06:21:59 +01:00 committed by Paulus Schoutsen
parent 6511e11ec9
commit 3e056a24dd

View file

@ -92,6 +92,10 @@ def setup(hass, config):
discovery.listen(hass, SERVICE_OCTOPRINT, device_discovered) discovery.listen(hass, SERVICE_OCTOPRINT, device_discovered)
if DOMAIN not in config:
# Skip the setup if there is no configuration present
return True
for printer in config[DOMAIN]: for printer in config[DOMAIN]:
name = printer[CONF_NAME] name = printer[CONF_NAME]
ssl = 's' if printer[CONF_SSL] else '' ssl = 's' if printer[CONF_SSL] else ''