mirror of
https://github.com/esphome/esphome.git
synced 2024-11-25 08:28:12 +01:00
parent
ffdcddc18e
commit
12f20fc3cf
2 changed files with 7 additions and 2 deletions
|
@ -91,7 +91,12 @@ def run_platformio(*cmd, **kwargs):
|
||||||
|
|
||||||
def run_miniterm(config, port, escape=False):
|
def run_miniterm(config, port, escape=False):
|
||||||
import serial
|
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)
|
_LOGGER.info("Starting log output from %s with baud rate %s", port, baud_rate)
|
||||||
|
|
||||||
with serial.Serial(port, baudrate=baud_rate) as ser:
|
with serial.Serial(port, baudrate=baud_rate) as ser:
|
||||||
|
|
|
@ -35,7 +35,7 @@ LogComponent = esphomelib_ns.LogComponent
|
||||||
|
|
||||||
CONFIG_SCHEMA = vol.All(vol.Schema({
|
CONFIG_SCHEMA = vol.All(vol.Schema({
|
||||||
cv.GenerateID(): cv.declare_variable_id(LogComponent),
|
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_TX_BUFFER_SIZE): cv.validate_bytes,
|
||||||
vol.Optional(CONF_LEVEL): is_log_level,
|
vol.Optional(CONF_LEVEL): is_log_level,
|
||||||
vol.Optional(CONF_LOGS): vol.Schema({
|
vol.Optional(CONF_LOGS): vol.Schema({
|
||||||
|
|
Loading…
Reference in a new issue