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.45.tar.gz
.
File metadata
- Download URL: pywemo-0.4.45.tar.gz
- Upload date:
- Size: 41.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ca179a83effb7d2d8d68d0dd04974c542abae834f9ee17cfa557d482737cee3 |
|
MD5 | 3efffd9803710ab4c8d08b1a6435c997 |
|
BLAKE2b-256 | 1a23ef4ed8890f79d69c78d25138151b6bc7a36c48a7cffec1107d6fcb6a0616 |
Provenance
File details
Details for the file pywemo-0.4.45-py2.py3-none-any.whl
.
File metadata
- Download URL: pywemo-0.4.45-py2.py3-none-any.whl
- Upload date:
- Size: 49.5 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 139bb4ff2865669cca205e5c6789d80db56435c30130934d472ef036b7d5a3d9 |
|
MD5 | 3df88cee32e07668c73ac9685f66e6a3 |
|
BLAKE2b-256 | b527dc6c701551ba55182e24065a91bb151bf62da6f2abb3851642b12c5d5e3e |