diff --git a/esphome/__main__.py b/esphome/__main__.py index e5456cf8e5..0796dead43 100644 --- a/esphome/__main__.py +++ b/esphome/__main__.py @@ -389,7 +389,8 @@ def command_config(args, config): output = re.sub( r"(password|key|psk|ssid)\: (.+)", r"\1: \\033[5m\2\\033[6m", output ) - safe_print(output) + if not CORE.quiet: + safe_print(output) _LOGGER.info("Configuration is valid!") return 0 diff --git a/esphome/core/__init__.py b/esphome/core/__init__.py index 60bd17b481..3c3b27a79d 100644 --- a/esphome/core/__init__.py +++ b/esphome/core/__init__.py @@ -522,6 +522,8 @@ class EsphomeCore: self.component_ids = set() # Whether ESPHome was started in verbose mode self.verbose = False + # Whether ESPHome was started in quiet mode + self.quiet = False def reset(self): self.dashboard = False diff --git a/esphome/log.py b/esphome/log.py index b5d72e774c..23dc453d32 100644 --- a/esphome/log.py +++ b/esphome/log.py @@ -78,6 +78,7 @@ def setup_log( CORE.verbose = True elif quiet: log_level = logging.CRITICAL + CORE.quiet = True else: log_level = logging.INFO logging.basicConfig(level=log_level)