Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This pull request adds support for
TAPO/TP-Link
programmable power strips and single socket devices using python-kasa.This feature is used to manage
TAPO
power strip or single socket from Labgrid. It addstapo
model toNetworkPowerPort
. As allTapo
devices require credentials this feature requires user to setKASA_LOGIN
andKASA_PASSWORD
env 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 -r
command (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 P300
power strip andTapo P100
socket. So it should work with allTapo
strips and sockets.While there already is support for
KASA/TP-Link
products 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 oftplink
model I decided to implement support forTapo
devices 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
tplink
model.This solution is based on the
tplink
model. Two key differences are:P100
that ignores value ofindex
Tapo
cloud credentials in order to communicate with devicesChecklist