Tapo插件使用python与PyP100库登录错误



我正在使用存储库中的基本脚本尝试连接到Tapo P110插头。很明显,我在使用我的ip/email/pword。

from PyP100 import PyP110
p110 = PyP110.P110("192.168.X.X", "email@gmail.com", "Password123") #Creating a P110 plug object
p110.handshake() #Creates the cookies required for further methods
p110.login() #Sends credentials to the plug and creates AES Key and IV for further methods
#PyP110 has all PyP100 functions and additionally allows to query energy usage infos
p110.getEnergyUsage() #Returns dict with all the energy usage

但我犯了这个错误。

Traceback (most recent call last):
File "c:UsersxxxxxxxxAdd-hoc analysis projectstapo_plug_energy_monitorPythonBasic_Tapo_script.py", line 9, in <module>
p110.getDeviceInfo()
File "C:UsersxxxxAppDataLocalProgramsPythonPython39libsite-packagesPyP100PyP100.py", line 236, in getDeviceInfo
URL = f"http://{self.ipAddress}/app?token={self.token}"     
AttributeError: 'P110' object has no attribute 'token'

我应该注意的是,我试着ping了ip,所有发送和接收的数据包都是正确的。导致错误的是login((,但我已经检查了登录详细信息,它们似乎是正确的。感谢您的帮助。

所以问题是因为Tapo P110固件版本1.0.16 的更新

当前的解决方案是对PyP100.py进行一个小的更改,请参阅下面的链接。

https://github.com/fishbigger/TapoP100/issues/76

最新更新