mirror of
https://github.com/esphome/esphome.git
synced 2025-09-27 23:52:28 +01:00
allow to implement show_logs as external component (#10523)
This commit is contained in:
@@ -459,6 +459,13 @@ def upload_program(
|
||||
|
||||
|
||||
def show_logs(config: ConfigType, args: ArgsProtocol, devices: list[str]) -> int | None:
|
||||
try:
|
||||
module = importlib.import_module("esphome.components." + CORE.target_platform)
|
||||
if getattr(module, "show_logs")(config, args, devices):
|
||||
return 0
|
||||
except AttributeError:
|
||||
pass
|
||||
|
||||
if "logger" not in config:
|
||||
raise EsphomeError("Logger is not configured!")
|
||||
|
||||
|
Reference in New Issue
Block a user