Initial trigger logs implementation (#900)

Co-authored-by: Steven B. <51370195+sdb9696@users.noreply.github.com>
This commit is contained in:
Teemu R.
2024-11-01 16:36:09 +01:00
committed by GitHub
parent 8969b54b87
commit 70c96b5a5d
4 changed files with 47 additions and 0 deletions

View File

@@ -193,3 +193,13 @@ async def update_credentials(dev, username, password):
click.confirm("Do you really want to replace the existing credentials?", abort=True)
return await dev.update_credentials(username, password)
@device.command(name="logs")
@pass_dev_or_child
async def child_logs(dev):
"""Print child device trigger logs."""
if logs := dev.modules.get(Module.TriggerLogs):
await dev.update(update_children=True)
for entry in logs.logs:
print(entry)