mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-10-11 01:48:03 +00:00
add 'alias' command for querying and setting the alias (#126)
* add 'alias' command for querying and setting the alias * calculate coverage only on library files, e.g., ignoring cli and test files * remove py34 and add py37 * readd py33, remove it from travis as it seems to be a travis limitation only * use xenial dist for travis, regular does not support py37..
This commit is contained in:
@@ -111,6 +111,18 @@ def state(ctx, dev):
|
||||
ctx.invoke(emeter)
|
||||
|
||||
|
||||
@cli.command()
|
||||
@pass_dev
|
||||
@click.argument('new_alias', required=False, default=None)
|
||||
def alias(dev, new_alias):
|
||||
"""Get or set the device alias."""
|
||||
if new_alias is not None:
|
||||
click.echo("Setting alias to %s" % new_alias)
|
||||
dev.alias = new_alias
|
||||
|
||||
click.echo("Alias: %s" % dev.alias)
|
||||
|
||||
|
||||
@cli.command()
|
||||
@pass_dev
|
||||
@click.option('--year', type=Datetime(format='%Y'),
|
||||
|
Reference in New Issue
Block a user