我正在使用存储库中的基本脚本尝试连接到Tapo P110插件。显然,我正在使用我的ip/电子邮件/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:\Users\xxxx\xxxx\Add-hoc analysis projects\tapo_plug_energy_monitor\Python\Basic_Tapo_script.py", line 9, in <module>
p110.getDeviceInfo()
File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\PyP100\PyP100.py", line 236, in getDeviceInfo
URL = f"http://{self.ipAddress}/app?token={self.token}"
AttributeError: 'P110' object has no attribute 'token'我应该注意的是,我试图将ip和所有数据包正确发送和接收。导致错误的是login(),但是我检查了登录详细信息,它们似乎是正确的。任何帮助都很感激。
发布于 2022-10-16 17:03:03
所以问题在于Tapo P110固件版本1.0.16的更新。
当前的解决方案是对PyP100.py做一个小的更改,参见下面的链接。
https://stackoverflow.com/questions/74088325
复制相似问题