From 20a06eec3efc669c1f9564744a6da7cc2542295a Mon Sep 17 00:00:00 2001 From: Jason Benaim Date: Sat, 24 Nov 2018 03:15:38 -0800 Subject: [PATCH] Add scan command for wifi AP scanning --- README.md | 1 + hs100.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/README.md b/README.md index 7d63770..d5622cc 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ Command can be: - `off`: turn the power off - `reboot`: reboot the plug - `reset-yes-really`: factory reset the plug +- `scan`: scan for nearby wifi APs (probably only 2.4 GHz ones) - Alternatively, you can supply a JSON string to be sent directly to the device. Note that the JSON string must be quoted, like so: `hs100 '{"system":{"set_relay_state":{"state":1}}}'` diff --git a/hs100.c b/hs100.c index b93004c..7750c16 100644 --- a/hs100.c +++ b/hs100.c @@ -33,6 +33,12 @@ struct cmd_s cmds[] = { .help = "reboot\t\treboot the plug", .json = "{\"system\":{\"reboot\":{\"delay\":0}}}", }, + { + .command = "scan", + .help = "scan\t\tscan for nearby wifi APs (probably only 2.4" + " GHz ones)", + .json = "{\"netif\":{\"get_scaninfo\":{\"refresh\":1}}}", + }, { .end = 1, },