mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-12-24 21:50:21 +00:00
Cleanup discovery & add tests (#212)
* Cleanup discovery & add tests * discovered_devices_raw is not anymore available, as that can be accessed directly from the device objects * test most of the discovery code paths * some minor cleanups to test handling * update discovery docs * Move category check to be after the definitions * skip a couple of tests requiring asyncmock not available on py37 * Remove return_raw usage from cli.discover
This commit is contained in:
@@ -143,13 +143,11 @@ async def discover(ctx, timeout, discover_only, dump_raw):
|
||||
"""Discover devices in the network."""
|
||||
target = ctx.parent.params["target"]
|
||||
click.echo(f"Discovering devices on {target} for {timeout} seconds")
|
||||
found_devs = await Discover.discover(
|
||||
target=target, timeout=timeout, return_raw=dump_raw
|
||||
)
|
||||
found_devs = await Discover.discover(target=target, timeout=timeout)
|
||||
if not discover_only:
|
||||
for ip, dev in found_devs.items():
|
||||
if dump_raw:
|
||||
click.echo(dev)
|
||||
click.echo(dev.sys_info)
|
||||
continue
|
||||
ctx.obj = dev
|
||||
await ctx.invoke(state)
|
||||
|
||||
Reference in New Issue
Block a user