Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion kasa/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,13 @@ def _device_to_serializable(val: SmartDevice):
@click.option(
"--json", default=False, is_flag=True, help="Output raw device response as JSON."
)
@click.option(
"--timeout",
envvar="KASA_TIMEOUT",
default=5,
required=False,
help="Timeout for device communications.",
)
@click.option(
"--discovery-timeout",
envvar="KASA_DISCOVERY_TIMEOUT",
Expand Down Expand Up @@ -163,6 +170,7 @@ async def cli(
debug,
type,
json,
timeout,
discovery_timeout,
username,
password,
Expand Down Expand Up @@ -234,7 +242,7 @@ def _nop_echo(*args, **kwargs):
if type is not None:
device_type = DeviceType.from_value(type)
dev = await SmartDevice.connect(
host, credentials=credentials, device_type=device_type
host, credentials=credentials, device_type=device_type, timeout=timeout
)
else:
echo("No --type defined, discovering..")
Expand Down