Skip to content

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

MarekSzczypinski
Copy link

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 adds tapo model to NetworkPowerPort. As all Tapo devices require credentials this feature requires user to set KASA_LOGIN and KASA_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 and Tapo P100 socket. So it should work with all Tapo 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 of tplink model I decided to implement support for Tapo 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:

  • Support for single sockets like P100 that ignores value of index
  • Requires Tapo cloud credentials in order to communicate with devices

Checklist

  • Documentation for the feature
  • Tests for the feature
  • The arguments and description in doc/configuration.rst have been updated
  • Add a section on how to use the feature to doc/usage.rst
  • Add a section on how to use the feature to doc/development.rst
  • PR has been tested
  • Man pages have been regenerated

Sorry, something went wrong.

Signed-off-by: Marek Szczypiński <markacy@gmail.com>
@MarekSzczypinski MarekSzczypinski force-pushed the feature/add-tapo-support branch from d41c2fa to e544fc0 Compare March 23, 2025 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant