1
0
mirror of https://github.com/taigrr/tplinkController synced 2025-01-18 04:43:13 -08:00

Add reboot and reset commands

This commit is contained in:
Jason Benaim 2018-11-24 02:18:02 -08:00
parent 629708555c
commit 5ccb2fd24d
2 changed files with 22 additions and 7 deletions

View File

@ -1,18 +1,25 @@
# hs100 # hs100
A small program for flipping TP-Link HS100/HS105/HS110 wi-fi smart plugs on A tool for using TP-Link HS100/HS105/HS110 wi-fi smart plugs. You can turn
and off. them on or off, reboot them, and factory reset them.
Tested to work on Linux, OSX, IRIX, and Windows under WSL.
Loosely based on [pyHS100](https://github.com/GadgetReactor/pyHS100) and Loosely based on [pyHS100](https://github.com/GadgetReactor/pyHS100) and
[research from softScheck](https://www.softscheck.com/en/reverse-engineering-tp-link-hs110/). [research from softScheck](https://www.softscheck.com/en/reverse-engineering-tp-link-hs110/).
Tested to work on Linux, OSX, and IRIX.
## Usage ## Usage
```hs100 <ip of plug> <json command blob>```
As a convenience, you can supply the words 'on' or 'off' in place of a json `hs100 <ip> <command>`
command blob.
Command can be:
- `on`: turn the power on
- `off`: turn the power off
- `reboot`: reboot the plug
- `reset-yes-really`: factory reset the plug
- 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 <ip> '{"system":{"set_relay_state":{"state":1}}}'`
## Todo ## Todo

View File

@ -23,6 +23,14 @@ struct cmd_alias_s cmd_aliases[] = {
.alias = "on", .alias = "on",
.command = "{\"system\":{\"set_relay_state\":{\"state\":1}}}", .command = "{\"system\":{\"set_relay_state\":{\"state\":1}}}",
}, },
{
.alias = "reboot",
.command = "{\"system\":{\"reboot\":{\"delay\":0}}}",
},
{
.alias = "reset-yes-really",
.command = "{\"system\":{\"reset\":{\"delay\":0}}}",
},
{ {
.end = 1, .end = 1,
}, },