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
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pywemo-0.4.43.tar.gz
.
File metadata
- Download URL: pywemo-0.4.43.tar.gz
- Upload date:
- Size: 39.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b183a0ae0ede893a9a76d085f5cbe265eb01dcc1e57e113397b65ca1ddef79f |
|
MD5 | 852c9b58d4cfad31e84c54864aea48f7 |
|
BLAKE2b-256 | 9bd9fafb02c303b82aadeb5818da4e17f02d44378d1cdf39a630567630ccffd0 |
Provenance
File details
Details for the file pywemo-0.4.43-py2.py3-none-any.whl
.
File metadata
- Download URL: pywemo-0.4.43-py2.py3-none-any.whl
- Upload date:
- Size: 47.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 71cae21fe96e4897094ed752d5b742f3c1cb037bbbfa7d172eb05e7a4732f683 |
|
MD5 | e85f4da89c80b1cfc6a62f71902fcbc5 |
|
BLAKE2b-256 | f310dc1b4788127628f421dd4f1e62c78ceeb99139bbbf45c65fb0919e135e81 |