fishbigger / TapoP100

A module for controlling the TP-Link Tapo P100 Plugs
MIT License
567 stars 140 forks source link

Invalid systax for b64decode(key.encode("UTF-8")) #22

Closed milotiger closed 2 years ago

milotiger commented 3 years ago

Hi guys, I am facing this issue after following the instruction example:

Traceback (most recent call last):
  File "p100_test.py", line 1, in <module>
    from PyP100 import PyP100
  File "/home/pi/.local/lib/python3.5/site-packages/PyP100/PyP100.py", line 73
    decode: bytes = b64decode(key.encode("UTF-8"))
          ^
SyntaxError: invalid syntax

My code:

from PyP100 import PyP100

p100 = PyP100.P100("192.168.1.163", "xxxxx@gmail.com", "12345") #Creating a P100 plug object

p100.handshake() #Creates the cookies required for further methods
p100.login() #Sends credentials to the plug and creates AES Key and IV for further methods

p100.turnOn() #Sends the turn on request
p100.setBrightness(100) #Sends the set brightness request
p100.turnOff() #Sends the turn off request
p100.getDeviceInfo() #Returns dict with all the device info

Thanks in advanced 😁

fishbigger commented 3 years ago

Hi,it seems this issue stems from a feature that requires python 3.6+. I will work on a fix for this ASAP but until then you can try upgrading to a later version.