driver/power: Add support for TAPO devices#1630
driver/power: Add support for TAPO devices#1630MarekSzczypinski wants to merge 5 commits intolabgrid-project:masterfrom
Conversation
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.
We should instead check the python-kasa version instead of relying on the indirect python dependency here.
There was a problem hiding this comment.
Done. All tests as written in the description of this PR were re-done.
There was a problem hiding this comment.
Hey, @Emantor. Any update on this one? :-)
There was a problem hiding this comment.
@Emantor just a friendly reminder that I'm still waiting for review ;-)
There was a problem hiding this comment.
Hi @Emantor, still waiting for any comment ;)
There was a problem hiding this comment.
Hey @Emantor, just a friendly reminder (checked with pylint and tox -r)
There was a problem hiding this comment.
@Emantor maybe someone else would have time to take a look?
There was a problem hiding this comment.
@Emantor just a friendly reminder that I'm still waiting for review ;-)
There was a problem hiding this comment.
@Emantor friendly reminder that I'm still here waiting.
|
No changes - just updating to the master branch |
|
Yet another update to master, nothing changed in my MR |
|
Added
|
|
Yet another update to master, nothing changed in my MR. |
|
Yet another update to master, nothing changed in my MR. |
2 similar comments
|
Yet another update to master, nothing changed in my MR. |
|
Yet another update to master, nothing changed in my MR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1630 +/- ##
========================================
+ Coverage 45.8% 45.9% +0.1%
========================================
Files 182 183 +1
Lines 14718 14768 +50
========================================
+ Hits 6743 6793 +50
Misses 7975 7975
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
|
I've done unit tests refactoring for my driver. Apart from that - bunch of updates to current master branch. |
|
Yay!! Happy anniversary to this PR! ;-) |
|
Please do a clean rebase on top of master without the merge commits. Sorry for the wait. |
cb34dd5 to
44f6bb1
Compare
@Emantor Done. No worries :) |
|
IMO the commits can also be squashed down into one commit or do you see value in keeping the individual commits? |
For sure, but I've already rebased the branch anyways. Edit: |
44f6bb1 to
b72ca70
Compare
Signed-off-by: Marek Szczypiński <markacy@gmail.com>
Signed-off-by: Marek Szczypiński <markacy@gmail.com>
Signed-off-by: Marek Szczypiński <markacy@gmail.com>
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 <markacy@gmail.com>
Signed-off-by: Marek Szczypiński <markacy@gmail.com>
b72ca70 to
1d2c4ac
Compare
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