-
Notifications
You must be signed in to change notification settings - Fork 230
driver/power: Add support for TAPO devices #1630
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
driver/power: Add support for TAPO devices #1630
Conversation
Signed-off-by: Marek Szczypiński <[email protected]>
d41c2fa to
e544fc0
Compare
labgrid/driver/power/tapo.py
Outdated
| # Somewhere between python-kasa 0.7.7 and 0.10.2 the API changed | ||
| # Labgrid on Python <= 3.10 uses python-kasa 0.7.7 | ||
| # Labgrid on Python >= 3.11 uses python-kasa 0.10.2 | ||
| if sys.version_info < (3, 11): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should instead check the python-kasa version instead of relying on the indirect python dependency here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. All tests as written in the description of this PR were re-done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, @Emantor. Any update on this one? :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Emantor just a friendly reminder that I'm still waiting for review ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Emantor, still waiting for any comment ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Emantor I've fixed problem with pylint (see my comment below). Can you give it another try? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @Emantor, just a friendly reminder (checked with pylint and tox -r)
Signed-off-by: Marek Szczypiński <[email protected]>
|
No changes - just updating to the master branch |
|
Yet another update to master, nothing changed in my MR |
Suppress unexpected-keyword-arg warnings for uses_http and http_port parameters that exist in different python-kasa API versions. Additionally tapo.py and test_tapo.py are now ruff formatted. Signed-off-by: Marek Szczypiński <[email protected]>
|
Added
|
|
Yet another update to master, nothing changed in my MR. |
|
Yet another update to master, nothing changed in my MR. |
Description
This pull request adds support for
TAPO/TP-Linkprogrammable power strips and single socket devices using python-kasa.This feature is used to manage
TAPOpower strip or single socket from Labgrid. It addstapomodel toNetworkPowerPort. As allTapodevices require credentials this feature requires user to setKASA_LOGINandKASA_PASSWORDenv variables to work (see python-kasa website for details).I have tested it manually with Labgrid (client build and run wth Python3.9 and 3.12). Additionally I wrote unit tests for it and also I have run the
tox -rcommand (Python: 3.9, 3.10, 3.11 and 3.12). All worked without errors and all the tests passed.I have used this driver with
Tapo P300power strip andTapo P100socket. So it should work with allTapostrips and sockets.While there already is support for
KASA/TP-Linkproducts in Labgrid using python-kasa, it doesn't work with TAPO devices as they apparently use some other protocol and require password and login to work. In order to not complicate the implementation oftplinkmodel I decided to implement support forTapodevices as a separate one. Additionally KASA products are not available in Europe so I didn't have means to test current (tplink) solution, which was one more reason to separate this into another model.Because of the necessity to create credentials this solution is a bit more complicated than the
tplinkmodel.This solution is based on the
tplinkmodel. Two key differences are:P100that ignores value ofindexTapocloud credentials in order to communicate with devicesChecklist