Controller for TP-Link Tapo P100 and other devices
Project description
Plug 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
Code example
import asyncio
import os
from plugp100.api.light_effect_preset import LightEffectPreset
from plugp100.api.tapo_client import TapoClient, AuthCredential
async def main():
# create generic tapo api
username = os.getenv('USERNAME', '<tapo_email>')
password = os.getenv('PASSWORD', '<tapo_password>')
credential = AuthCredential(username, password)
client = await TapoClient.connect(credential, "<ip_address>")
print(await client.get_device_info())
print(await client.get_device_usage())
print(await client.get_energy_usage())
print(await client.get_current_power())
print(await client.get_child_device_list())
print(await client.get_child_device_component_list())
print(await client.set_lighting_effect(LightEffectPreset.Aurora.to_effect()))
# plug = PlugDevice(TapoClient(username, password), "<tapo_device_ip>")
# light = LightDevice(TapoClient(username, password), "<tapo_device_ip>")
# ledstrip = LedStripDevice(TapoClient(username, password), "<tapo_device_ip>")
if __name__ == "__main__":
loop = asyncio.new_event_loop()
loop.run_until_complete(main())
loop.run_until_complete(asyncio.sleep(0.1))
loop.close()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
plugp100-3.10.2.tar.gz
(44.2 kB
view hashes)
Built Distribution
plugp100-3.10.2-py3-none-any.whl
(63.5 kB
view hashes)
Close
Hashes for plugp100-3.10.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 83be6baef84e978f56a5a2896f0fc052e4591823d83c140c2d8ad80e83d8fb15 |
|
MD5 | 838d9d2b1ddfe58742a4c6f7e28667a1 |
|
BLAKE2b-256 | 8019936472f60ac3c7ae3b49a60c6c4d8f7c34c30624e7e64b9124d097b33e5e |