about summary refs log tree commit diff
path: root/cli/broadlink_cli
diff options
context:
space:
mode:
authorTocho Tochev <tocho@tochev.net>2018-04-19T20·45+0300
committerTocho Tochev <tocho@tochev.net>2018-04-19T20·45+0300
commitb2c4bed94a3fb942797bba6c46717edf8187be1f (patch)
tree16f411ea32e1a40ca0695b3c71d23c68da44ce7a /cli/broadlink_cli
parent9c238e17174a6ea2b0522e2a4a1ac1552a185c23 (diff)
Add energy option to broadlink_cli
Diffstat (limited to 'cli/broadlink_cli')
-rwxr-xr-xcli/broadlink_cli3
1 files changed, 3 insertions, 0 deletions
diff --git a/cli/broadlink_cli b/cli/broadlink_cli
index 4c0c5d7a72..4b0e81f67e 100755
--- a/cli/broadlink_cli
+++ b/cli/broadlink_cli
@@ -68,6 +68,7 @@ parser.add_argument("--type", type=auto_int, default=0x2712, help="type of devic
 parser.add_argument("--host", help="host address")
 parser.add_argument("--mac", help="mac address (hex reverse), as used by python-broadlink library")
 parser.add_argument("--temperature",action="store_true", help="request temperature from device")
+parser.add_argument("--energy",action="store_true", help="request energy consumption from device")
 parser.add_argument("--check", action="store_true", help="check current power state")
 parser.add_argument("--checknl", action="store_true", help="check current nightlight state")
 parser.add_argument("--turnon", action="store_true", help="turn on device")
@@ -104,6 +105,8 @@ if args.convert:
     print format_durations(durations)
 if args.temperature:
     print dev.check_temperature()
+if args.energy:
+    print dev.get_energy()
 if args.sensors:
     try:
         data = dev.check_sensors()