1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-27 15:42:22 +01:00

allow to implement show_logs as external component (#10523)

This commit is contained in:
tomaszduda23
2025-09-09 18:45:42 +02:00
committed by GitHub
parent 8993f4e6b4
commit 39212f0d7f

View File

@@ -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!")