Skip to main content

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())
  1. This project does not implement UPnP interface for device discovery, instead talking to plugs directly by IP address. It is highly recommended to set static IPs for plugs. Discovery may be added at a later date if a suitable library can be found.

Project details


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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyblinky-4.1.0-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

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

Hashes for pyblinky-4.1.0.tar.gz
Algorithm Hash digest
SHA256 6320d21ae3c7e5b0a8edf106c4bcea70b2b20adeca57d08f273178f4c1a842c8
MD5 61d2499d676e73a9cdc94d07a08106fb
BLAKE2b-256 5ecc08c48884494566c12cf5cfc246d4ec579df98b64f2add95bd423e8ed1f24

See more details on using hashes here.

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

Hashes for pyblinky-4.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d6fdf14ac3683eaf397f0b0f63931a4d3533eb70ff1fae44df27845b0eb2528e
MD5 54c4269a3714b19c98aeb42be7e7bc12
BLAKE2b-256 daad7891b4d6f5ce500a15827b864e227d27c291717fd365c7dacb0f724c2aca

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page