From 34347e59aeea05c2c2dc0e229dc1d20e5ef26b1a Mon Sep 17 00:00:00 2001 From: Teemu Rytilahti <tpr@iki.fi> Date: Tue, 17 Oct 2017 00:53:18 +0200 Subject: [PATCH] cli: add 'time' command to get the current time from the device --- pyHS100/cli.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pyHS100/cli.py b/pyHS100/cli.py index 323c6ed5..10f59b55 100644 --- a/pyHS100/cli.py +++ b/pyHS100/cli.py @@ -187,6 +187,13 @@ def led(dev, state): click.echo("LED state: %s" % dev.led) +@cli.command() +@pass_dev +def time(dev): + """Get the device time.""" + click.echo(dev.time) + + @cli.command() @pass_dev def on(plug):