diff --git a/esphomeyaml/__main__.py b/esphomeyaml/__main__.py index 4c7782d267..e6c0d5ae32 100644 --- a/esphomeyaml/__main__.py +++ b/esphomeyaml/__main__.py @@ -91,7 +91,12 @@ def run_platformio(*cmd, **kwargs): def run_miniterm(config, port, escape=False): import serial - baud_rate = config.get(CONF_LOGGER, {}).get(CONF_BAUD_RATE, 115200) + if CONF_LOGGER not in config: + _LOGGER.info("Logger is not enabled. Not starting UART logs.") + return + baud_rate = config['logger'][CONF_BAUD_RATE] + if baud_rate == 0: + _LOGGER.info("UART logging is disabled (baud_rate=0). Not starting UART logs.") _LOGGER.info("Starting log output from %s with baud rate %s", port, baud_rate) with serial.Serial(port, baudrate=baud_rate) as ser: diff --git a/esphomeyaml/components/logger.py b/esphomeyaml/components/logger.py index 14a19db739..46debd66cf 100644 --- a/esphomeyaml/components/logger.py +++ b/esphomeyaml/components/logger.py @@ -35,7 +35,7 @@ LogComponent = esphomelib_ns.LogComponent CONFIG_SCHEMA = vol.All(vol.Schema({ cv.GenerateID(): cv.declare_variable_id(LogComponent), - vol.Optional(CONF_BAUD_RATE): cv.positive_int, + vol.Optional(CONF_BAUD_RATE, default=115200): cv.positive_int, vol.Optional(CONF_TX_BUFFER_SIZE): cv.validate_bytes, vol.Optional(CONF_LEVEL): is_log_level, vol.Optional(CONF_LOGS): vol.Schema({