From 9cd61fdcc8038d865662fe3d19a5b72bb89aae79 Mon Sep 17 00:00:00 2001 From: Georgi Kirichkov Date: Mon, 17 Oct 2016 15:17:28 +0300 Subject: [PATCH] Adds additional comments, for better compliance with the Apache license --- pyHS100/pyHS100.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pyHS100/pyHS100.py b/pyHS100/pyHS100.py index a68d17fd..a5051b53 100644 --- a/pyHS100/pyHS100.py +++ b/pyHS100/pyHS100.py @@ -223,6 +223,11 @@ class SmartPlug(object): def _encrypt(self, string): """Encrypts a command.""" + + """ + Taken from https://raw.githubusercontent.com/softScheck/tplink-smartplug/master/tplink-smartplug.py + Changes: the return value is encoded in latin-1 in Python 3 and later + """ key = 171 result = "\0\0\0\0" for i in string: @@ -237,6 +242,11 @@ class SmartPlug(object): def _decrypt(self, string): """Decrypts a command.""" + + """ + Taken from https://raw.githubusercontent.com/softScheck/tplink-smartplug/master/tplink-smartplug.py + Changes: the string parameter is decoded from latin-1 in Python 3 and later + """ if sys.version_info.major > 2: string = string.decode('latin-1')