Lightweight Python module to discover and control WeMo devices
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](https://github.com/iancmcc/ouimeaux) with simpler dependencies.
pyWeMo depends on Python packages requests, netifaces and six.
How to use
>> import pywemo >> devices = pywemo.discover_devices() >> print(devices) [<WeMo Insight "AC Insight">] >> devices.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 scbscription update logic won’t work.
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.
Release history Release notifications
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size & hash SHA256 hash help||File type||Python version||Upload date|
|pywemo-0.4.39-py2.py3-none-any.whl (47.1 kB) Copy SHA256 hash SHA256||Wheel||py2.py3|
|pywemo-0.4.39.tar.gz (39.1 kB) Copy SHA256 hash SHA256||Source||None|