2
0
mirror of https://github.com/softScheck/tplink-smartplug synced 2026-01-11 23:38:46 +01:00

Added energy reset and runtime reset (#103)

* Add energy reset

* add engery_reset and runtime_reset commands
This commit is contained in:
chou2008
2024-10-08 10:50:11 -04:00
committed by GitHub
parent 3246a8d6ad
commit 21c14b3381
2 changed files with 21 additions and 17 deletions

View File

@@ -28,7 +28,7 @@ A full list of commands is provided in [tplink-smarthome-commands.txt](tplink-sm
Provide the target IP using `-t` and a command to send using either `-c` or `-j`. Commands for the `-c` flag: Provide the target IP using `-t` and a command to send using either `-c` or `-j`. Commands for the `-c` flag:
| Command | Description | | Command | Description |
|-----------|--------------------------------------| |---------------|--------------------------------------|
| on | Turns on the plug | | on | Turns on the plug |
| off | Turns off the plug | | off | Turns off the plug |
| info | Returns device info | | info | Returns device info |
@@ -41,6 +41,8 @@ Provide the target IP using `-t` and a command to send using either `-c` or `-j`
| reboot | Reboot the device | | reboot | Reboot the device |
| reset | Reset the device to factory settings | | reset | Reset the device to factory settings |
| energy | Return realtime voltage/current/power| | energy | Return realtime voltage/current/power|
| energy_reset | Reset energy meters |
| runtime_reset | erase runtime statistics |
| ledon | Turn on the LED indicator | | ledon | Turn on the LED indicator |
| ledoff | Turn off the LED indicator | | ledoff | Turn off the LED indicator |

View File

@@ -61,7 +61,9 @@ commands = {'info' : '{"system":{"get_sysinfo":{}}}',
'antitheft': '{"anti_theft":{"get_rules":{}}}', 'antitheft': '{"anti_theft":{"get_rules":{}}}',
'reboot' : '{"system":{"reboot":{"delay":1}}}', 'reboot' : '{"system":{"reboot":{"delay":1}}}',
'reset' : '{"system":{"reset":{"delay":1}}}', 'reset' : '{"system":{"reset":{"delay":1}}}',
'energy' : '{"emeter":{"get_realtime":{}}}' 'energy' : '{"emeter":{"get_realtime":{}}}',
'energy_reset' : '{"emeter":{"erase_emeter_stat":{}}}',
'runtime_reset' : '{"schedule":{"erase_runtime_stat":{}}}'
} }
# Encryption and Decryption of TP-Link Smart Home Protocol # Encryption and Decryption of TP-Link Smart Home Protocol