From e81338b4f586a2b5af18ace5abef813dcb2d3878 Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Sun, 13 Jan 2019 16:21:10 +0100 Subject: [PATCH] Fix show logs with MQTT and dashboard (#332) Fixes #327 --- esphomeyaml/__main__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/esphomeyaml/__main__.py b/esphomeyaml/__main__.py index 61eea83d40..26f42c14a2 100644 --- a/esphomeyaml/__main__.py +++ b/esphomeyaml/__main__.py @@ -211,12 +211,14 @@ def upload_program(config, args, host): def show_logs(config, args, port): + if 'logger' not in config: + raise EsphomeyamlError("Logger is not configured!") if get_port_type(port) == 'SERIAL': run_miniterm(config, port) return 0 - if get_port_type(port) == 'NETWORK': + if get_port_type(port) == 'NETWORK' and 'api' in config: return run_logs(config, port) - if get_port_type(port) == 'MQTT': + if get_port_type(port) == 'MQTT' and 'mqtt' in config: return mqtt.show_logs(config, args.topic, args.username, args.password, args.client_id) raise ValueError