mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-30 22:53:59 +00:00 
			
		
		
		
	Suppress full config output of "esphome config" when -q option is used. (#5852)
This commit is contained in:
		| @@ -389,6 +389,7 @@ def command_config(args, config): | |||||||
|         output = re.sub( |         output = re.sub( | ||||||
|             r"(password|key|psk|ssid)\: (.+)", r"\1: \\033[5m\2\\033[6m", output |             r"(password|key|psk|ssid)\: (.+)", r"\1: \\033[5m\2\\033[6m", output | ||||||
|         ) |         ) | ||||||
|  |     if not CORE.quiet: | ||||||
|         safe_print(output) |         safe_print(output) | ||||||
|     _LOGGER.info("Configuration is valid!") |     _LOGGER.info("Configuration is valid!") | ||||||
|     return 0 |     return 0 | ||||||
|   | |||||||
| @@ -522,6 +522,8 @@ class EsphomeCore: | |||||||
|         self.component_ids = set() |         self.component_ids = set() | ||||||
|         # Whether ESPHome was started in verbose mode |         # Whether ESPHome was started in verbose mode | ||||||
|         self.verbose = False |         self.verbose = False | ||||||
|  |         # Whether ESPHome was started in quiet mode | ||||||
|  |         self.quiet = False | ||||||
|  |  | ||||||
|     def reset(self): |     def reset(self): | ||||||
|         self.dashboard = False |         self.dashboard = False | ||||||
|   | |||||||
| @@ -78,6 +78,7 @@ def setup_log( | |||||||
|         CORE.verbose = True |         CORE.verbose = True | ||||||
|     elif quiet: |     elif quiet: | ||||||
|         log_level = logging.CRITICAL |         log_level = logging.CRITICAL | ||||||
|  |         CORE.quiet = True | ||||||
|     else: |     else: | ||||||
|         log_level = logging.INFO |         log_level = logging.INFO | ||||||
|     logging.basicConfig(level=log_level) |     logging.basicConfig(level=log_level) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user