mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-04-30 18:46:24 +00:00
Remove --ip which was just an alias to --host (#6)
This commit is contained in:
parent
4a25cbfff7
commit
3c68d295da
13
kasa/cli.py
13
kasa/cli.py
@ -13,14 +13,6 @@ pass_dev = click.make_pass_decorator(SmartDevice)
|
|||||||
|
|
||||||
|
|
||||||
@click.group(invoke_without_command=True)
|
@click.group(invoke_without_command=True)
|
||||||
@click.option(
|
|
||||||
"--ip",
|
|
||||||
envvar="KASA_IP",
|
|
||||||
required=False,
|
|
||||||
help="The IP address of the device to connect to. This option "
|
|
||||||
"is deprecated and will be removed in the future; use --host "
|
|
||||||
"instead.",
|
|
||||||
)
|
|
||||||
@click.option(
|
@click.option(
|
||||||
"--host",
|
"--host",
|
||||||
envvar="KASA_HOST",
|
envvar="KASA_HOST",
|
||||||
@ -45,7 +37,7 @@ pass_dev = click.make_pass_decorator(SmartDevice)
|
|||||||
@click.option("--strip", default=False, is_flag=True)
|
@click.option("--strip", default=False, is_flag=True)
|
||||||
@click.version_option()
|
@click.version_option()
|
||||||
@click.pass_context
|
@click.pass_context
|
||||||
def cli(ctx, ip, host, alias, target, debug, bulb, plug, strip):
|
def cli(ctx, host, alias, target, debug, bulb, plug, strip):
|
||||||
"""A cli tool for controlling TP-Link smart home plugs.""" # noqa
|
"""A cli tool for controlling TP-Link smart home plugs.""" # noqa
|
||||||
if debug:
|
if debug:
|
||||||
logging.basicConfig(level=logging.DEBUG)
|
logging.basicConfig(level=logging.DEBUG)
|
||||||
@ -55,9 +47,6 @@ def cli(ctx, ip, host, alias, target, debug, bulb, plug, strip):
|
|||||||
if ctx.invoked_subcommand == "discover":
|
if ctx.invoked_subcommand == "discover":
|
||||||
return
|
return
|
||||||
|
|
||||||
if ip is not None and host is None:
|
|
||||||
host = ip
|
|
||||||
|
|
||||||
if alias is not None and host is None:
|
if alias is not None and host is None:
|
||||||
click.echo("Alias is given, using discovery to find host %s" % alias)
|
click.echo("Alias is given, using discovery to find host %s" % alias)
|
||||||
host = find_host_from_alias(alias=alias, target=target)
|
host = find_host_from_alias(alias=alias, target=target)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user