mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-10-13 10:58:02 +00:00
Leverage data from UDP discovery to initialize device structure (#132)
* avoid talking to devices after UDP discovery * formatting fix * more formatting * more formatting changes * undo gitignore changes * fixing git ignore for black Co-authored-by: dlee1j1 <dlee1j@yahoo.comm>
This commit is contained in:
@@ -174,13 +174,12 @@ async def dump_discover(ctx, scrub):
|
||||
async def discover(ctx, timeout, discover_only, dump_raw):
|
||||
"""Discover devices in the network."""
|
||||
target = ctx.parent.params["target"]
|
||||
click.echo(f"Discovering devices for {timeout} seconds")
|
||||
click.echo(f"Discovering devices on {target} for {timeout} seconds")
|
||||
found_devs = await Discover.discover(
|
||||
target=target, timeout=timeout, return_raw=dump_raw
|
||||
)
|
||||
if not discover_only:
|
||||
for ip, dev in found_devs.items():
|
||||
await dev.update()
|
||||
if dump_raw:
|
||||
click.echo(dev)
|
||||
continue
|
||||
|
Reference in New Issue
Block a user