Skip to content

Commit

Permalink
update readme and setup
Browse files Browse the repository at this point in the history
  • Loading branch information
petretiandrea committed Mar 7, 2021
1 parent 1994ceb commit 0771d42
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,18 @@ The purpose of this fork is to provide the library as PyPi package.

# Code example
```python
from plugp100 import p100
from plugp100 import TapoSwitch, TapoLight

switch = p100.P100("<ip_address>")
switch.handshake()
switch.login_request("<username>", "<password>")
# create plug
sw = TapoSwitch("<ip>", "<email>", "<passwd>")
sw.login()
sw.off()
print(sw.get_state())

# change state of plug
switch.change_state(1, "88-00-DE-AD-52-E1") # (0 -> off, 1 -> on)

# retrieve the state of plug
is_on = switch.is_on()
state = switch.get_state() # this retrieve a complete status
# create light
light = TapoLight("<ip>", "<email>", "<passwd>")
light.login()
light.on()
light.set_brightness(100)
```

4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

setup_args = dict(
name='plugp100',
version='2.0',
description='Controller for TP-Link Tapo P100',
version='2.1',
description='Controller for TP-Link Tapo P100 and other devices',
long_description_content_type="text/markdown",
long_description=README,
license='GPL3',
Expand Down

0 comments on commit 0771d42

Please sign in to comment.