From 7fabe4574c306496224feccf71b65f15802cfcd7 Mon Sep 17 00:00:00 2001 From: Keith Chiem Date: Wed, 8 Nov 2017 02:16:45 -0800 Subject: [PATCH] make it work with hs105 --- tplink-smartplug.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tplink-smartplug.py b/tplink-smartplug.py index 3a2fde8..34b89cc 100644 --- a/tplink-smartplug.py +++ b/tplink-smartplug.py @@ -21,6 +21,7 @@ # import socket import argparse +from struct import pack version = 0.1 @@ -51,7 +52,7 @@ commands = {'info' : '{"system":{"get_sysinfo":{}}}', # XOR Autokey Cipher with starting key = 171 def encrypt(string): key = 171 - result = "\0\0\0\0" + result = pack('>I', len(string)) for i in string: a = key ^ ord(i) key = a