Belkin brand Wemo plug control
Project description
pyblinky
Control Belkin brand Wemo smart plugs synchronously or asynchronously.
Options
| Parameter | Default | Description |
|---|---|---|
| ip | Required | Network location of plug1 |
| timeout | 3 | Seconds to wait for response |
| name_cache_age | 0 | Seconds to store plug name before re-querying it |
Actions
| Action | Parameters | Description |
|---|---|---|
| on | None | Turn plug on |
| off | None | Turn plug off |
| toggle | None | Change plug status |
| burst | seconds | Turn on plug, wait num seconds, then turn off |
| status | None | Get status of plug as (bool) |
| identify | None | Get name of plug (str) |
| rename | name | Rename plug |
A more thorough list of available actions on the plug is documented here and some may be implemented here in the future.
Examples
Synchronous
from pyblinky import Wemo
plug = Wemo('192.168.1.87')
print(plug.status())
print(plug.identify())
plug.on()
Asynchronous
import asyncio
from pyblinky import AsyncWemo
plugs = [
AsyncWemo('192.168.1.87'),
AsyncWemo('192.168.1.88'),
AsyncWemo('192.168.1.89')
]
async def main():
result = await asyncio.gather(
*(
[
x.status()
for x in plugs
] +
[
y.identify()
for y in plugs
]
)
)
print(result)
if __name__ == '__main__':
asyncio.run(main())
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
pyblinky-4.1.0.tar.gz
(5.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyblinky-4.1.0.tar.gz.
File metadata
- Download URL: pyblinky-4.1.0.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6320d21ae3c7e5b0a8edf106c4bcea70b2b20adeca57d08f273178f4c1a842c8
|
|
| MD5 |
61d2499d676e73a9cdc94d07a08106fb
|
|
| BLAKE2b-256 |
5ecc08c48884494566c12cf5cfc246d4ec579df98b64f2add95bd423e8ed1f24
|
File details
Details for the file pyblinky-4.1.0-py3-none-any.whl.
File metadata
- Download URL: pyblinky-4.1.0-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d6fdf14ac3683eaf397f0b0f63931a4d3533eb70ff1fae44df27845b0eb2528e
|
|
| MD5 |
54c4269a3714b19c98aeb42be7e7bc12
|
|
| BLAKE2b-256 |
daad7891b4d6f5ce500a15827b864e227d27c291717fd365c7dacb0f724c2aca
|