Skip to main content

Lightweight Python module to discover and control WeMo devices

Project description

Lightweight Python 2 and Python 3 module to discover and control WeMo devices.

This is a stripped down version of the Python API for WeMo devices, ouimeaux, with simpler dependencies.

Dependencies

pyWeMo depends on Python packages: requests, ifaddr and six

How to use

>> import pywemo

>> devices = pywemo.discover_devices()
>> print(devices)
[<WeMo Insight "AC Insight">]

>> devices[0].toggle()

If discovery doesn’t work on your network

On some networks discovery doesn’t work reliably, in that case if you can find the ip address of your Wemo device you can use the following code.

>> import pywemo

>> address = "192.168.100.193"
>> port = pywemo.ouimeaux_device.probe_wemo(address)
>> url = 'http://%s:%i/setup.xml' % (address, port)
>> device = pywemo.discovery.device_from_description(url, None)
>> print(device)
<WeMo Insight "AC Insight">

Please note that you need to use ip addresses as shown above, rather than hostnames, otherwise the subscription update logic won’t work.

License

The code in pywemo/ouimeaux_device is written and copyright by Ian McCracken and released under the BSD license. The rest is released under the MIT license.

Project details


Release history Release notifications | RSS feed

This version

0.5.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pywemo-0.5.0.tar.gz (42.2 kB view details)

Uploaded Source

Built Distribution

pywemo-0.5.0-py3-none-any.whl (50.0 kB view details)

Uploaded Python 3

File details

Details for the file pywemo-0.5.0.tar.gz.

File metadata

  • Download URL: pywemo-0.5.0.tar.gz
  • Upload date:
  • Size: 42.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.10 CPython/3.7.9 Linux/5.4.0-1023-azure

File hashes

Hashes for pywemo-0.5.0.tar.gz
Algorithm Hash digest
SHA256 81d3be6ea67864277f5eeb9b76a41d7978a33d8a73f228f8d2f9f860ad64f22e
MD5 61275048eb1a812ae3b187bd48d85438
BLAKE2b-256 411287fb75923e3c3520ee1afa8b5904dbd5d8df4604573c63c4cc19183d18f8

See more details on using hashes here.

Provenance

File details

Details for the file pywemo-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: pywemo-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 50.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.10 CPython/3.7.9 Linux/5.4.0-1023-azure

File hashes

Hashes for pywemo-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 acecc88285c1df924de8994bf8a22854293309843a53b4445e23be735e7ff9bf
MD5 22cce19d43442ba833aae28aa719b8e2
BLAKE2b-256 294f924a3a6f6b0a1861b98ae9a54a6214f78de7a804a0103c6149e24c452547

See more details on using hashes here.

Provenance

Supported by

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