Controller for TP-Link Tapo P100 and other devices
Maintained. Last release 6 weeks ago, commits in 2 of the last 26 weeks. Weaker on commit activity.
pip install plugp100Plug P100
This is a fork of original work of @K4CZP3R
The purpose of this fork is to provide the library as PyPi package.
How to install
pip install plugp100
Development
uv sync
uv run pytest tests/unit
uv run black --check .
Library Architecture
The library was rewritten by taking inspiration from Component Gaming Design Pattern to achieve better decoupling from device and its capabilities.
Each Tapo Device, now, is something like a container of Device Component. A Device Component represent a specific feature, so a Tapo Device can be composed by multiple device component.
e.g. EnergyComponent, OverheatComponent, OnOffComponent and so on.
There 3 main Tapo Device class family, which simplify access to underlying components:
- TapoBulb
- TapoPlug
- TapoHub
Supported Devices
This library supports a wide range of Tapo devices, including:
- Tapo Smart Plugs
- Tapo Smart Plug Strip
- Tapo Smart Led Strip
- Tapo Smart Bulb
- Tapo HUB H100
- Water Leak
- Trigger Button (like S200)
- Switch
- Smart Door
- Temperature Humidity Sensor
Every device class has more than one component which enrich the basic capability of Tapo Device.
You can see the supported components inside the plugp100/components package.
Usage
Replace <tapo_username>, <tapo_password>, and <tapo_device_ip> with your Tapo account credentials and device IP address.
To run the bundled example, copy .env.example to .env, fill in the device
credentials, and install the optional dependency with
pip install "plugp100[example]" (or uv sync --extra example when developing).
Authentication
Before using the library, make sure to have your Tapo credentials ready:
from plugp100.common.credentials import AuthCredential
credentials = AuthCredential("<tapo_username>", "<tapo_password>")