Adds additional comments, for better compliance with the Apache license

This commit is contained in:
Georgi Kirichkov 2016-10-17 15:17:28 +03:00
parent 093899c588
commit 9cd61fdcc8

View File

@ -223,6 +223,11 @@ class SmartPlug(object):
def _encrypt(self, string): def _encrypt(self, string):
"""Encrypts a command.""" """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 key = 171
result = "\0\0\0\0" result = "\0\0\0\0"
for i in string: for i in string:
@ -237,6 +242,11 @@ class SmartPlug(object):
def _decrypt(self, string): def _decrypt(self, string):
"""Decrypts a command.""" """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: if sys.version_info.major > 2:
string = string.decode('latin-1') string = string.decode('latin-1')