about summary refs log tree commit diff
diff options
context:
space:
mode:
authorcarlos-alarcon <carlos.alarcon@ionide.es>2019-07-29T06·39+0200
committerDaniel Høyer Iversen <mail@dahoiv.net>2019-07-29T06·39+0300
commit1cea255dce6b966c1c7745a7a3327569735ed18e (patch)
treeebdebe0f6982b293f093b74f26fb25778851df22
parent9d9b49c3db96a8e92c3b267aa07f764eff659e2b (diff)
Allow to specify local_ip_address when discovering (#272)
-rwxr-xr-xcli/broadlink_discovery4
1 files changed, 3 insertions, 1 deletions
diff --git a/cli/broadlink_discovery b/cli/broadlink_discovery
index 2bb8d998d93f..74f36ed51fa5 100755
--- a/cli/broadlink_discovery
+++ b/cli/broadlink_discovery
@@ -6,10 +6,11 @@ import argparse
 
 parser = argparse.ArgumentParser(fromfile_prefix_chars='@');
 parser.add_argument("--timeout", type=int, default=5, help="timeout to wait for receiving discovery responses")
+parser.add_argument("--ip", default=None, help="ip address to use in the discovery")
 args = parser.parse_args()
 
 print("Discovering...")
-devices = broadlink.discover(timeout=args.timeout)
+devices = broadlink.discover(timeout=args.timeout, local_ip_address=args.ip)
 for device in devices:
     if device.auth():
         print("###########################################")
@@ -22,3 +23,4 @@ for device in devices:
         print("")
     else:
         print("Error authenticating with device : {}".format(device.host))
+