diff options
author | Daniel Høyer Iversen <mail@dahoiv.net> | 2020-03-04T21·27+0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-04T21·27+0100 |
commit | af95fa2446b7d8bf804c827e7bf4a8a9e67b4026 (patch) | |
tree | 265d56606d4fa2ac39eff61d473b8c8bb80bea72 /cli/broadlink_cli | |
parent | e151a14a7bea0084dcb1bb1de0ca30210b822c66 (diff) |
Add --joinwifi option to configure the device with Wifi details (#296)
Diffstat (limited to 'cli/broadlink_cli')
-rwxr-xr-x | cli/broadlink_cli | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/cli/broadlink_cli b/cli/broadlink_cli index 2de44aa4357a..5045c5c1082f 100755 --- a/cli/broadlink_cli +++ b/cli/broadlink_cli @@ -85,6 +85,7 @@ parser.add_argument("--learnfile", help="save learned command to a specified fil parser.add_argument("--durations", action="store_true", help="use durations in micro seconds instead of the Broadlink format") parser.add_argument("--convert", action="store_true", help="convert input data to durations") +parser.add_argument("--joinwifi", nargs=2, help="Args are SSID PASSPHRASE to configure Broadlink device with"); parser.add_argument("data", nargs='*', help="Data to send or convert") args = parser.parse_args() @@ -102,6 +103,9 @@ if args.host or args.device: dev = broadlink.gendevice(type, (host, 80), mac) dev.auth() +if args.joinwifi: + broadlink.setup(args.joinwifi[0], args.joinwifi[1], 4) + if args.convert: data = bytearray.fromhex(''.join(args.data)) durations = to_microseconds(data) |