softScheck / tplink-smartplug

TP-Link WiFi SmartPlug Client and Wireshark Dissector
Apache License 2.0
1.14k stars 296 forks source link

Added verbose flag to print verbose output #15

Closed djhworld closed 4 years ago

djhworld commented 7 years ago

This makes integrating this script into other scripts that accept JSON simpler.

If users wish to see verbose output (i.e. the Sent and Received sections) they can use the -v or --verbose flag

Default output

tmp/tplink-smartplug|master ✔ ▶ python tplink-smartplug.py -t <my-ip> -c on
{"system":{"set_relay_state":{"err_code":0}}}

Verbose output

tmp/tplink-smartplug|master ✔ ▶ python tplink-smartplug.py -v -t <my-ip>  -c on
Sent:      {"system":{"set_relay_state":{"state":1}}}
Received:  {"system":{"set_relay_state":{"err_code":0}}}
softScheck commented 4 years ago

This function was added by another pull request.