about summary refs log tree commit diff
path: root/cli/broadlink_cli
diff options
context:
space:
mode:
authorSergey Bogatyrets <serj.sj@gmail.com>2017-11-26T19·10+0300
committerMatthew Garrett <mjg59-github@srcf.ucam.org>2017-11-26T19·10-0800
commit9ff6fa817b6d4314fcc9b805e480290f3a1ba20e (patch)
treebf38a52121a2854e79e978e8f990025023ebaab7 /cli/broadlink_cli
parent8bc67af6d73c75587d40f6dbfa3b975c7d69a8a4 (diff)
Checking device arg too for defining dev instance (#129)
Diffstat (limited to 'cli/broadlink_cli')
-rwxr-xr-xcli/broadlink_cli5
1 files changed, 2 insertions, 3 deletions
diff --git a/cli/broadlink_cli b/cli/broadlink_cli
index 3acf168a920d..e9e63d5718aa 100755
--- a/cli/broadlink_cli
+++ b/cli/broadlink_cli
@@ -87,7 +87,7 @@ elif args.mac:
     host = args.host
     mac = bytearray.fromhex(args.mac)
 
-if args.host:
+if args.host or args.device:
     dev = broadlink.gendevice(type, (host, 80), mac)
     dev.auth()
 
@@ -123,11 +123,10 @@ if args.learn or args.learnfile:
             if args.durations \
             else ''.join(format(x, '02x') for x in bytearray(data))
         if args.learn:
-            print learned    
+            print learned
         if args.learnfile:
             print "Saving to {}".format(args.learnfile)
             with open(args.learnfile, "w") as text_file:
                 text_file.write(learned)
     else:
         print "No data received..."
-