wemo control library
Project description
w3mo
Control your wemo devices!
Installation
pip3 install w3mo
Usage
- Device Discovery
import w3mo
#returns a dictionary of devices with the device name as the key
#{'name':{'ip':device_ip,'obj':instantiated w3mo control class}}
x = w3mo.discover(return_type=dict)
#returns a list of devices
#[{'name':'device_name_1','ip':'device_ip':,'obj':instantiated w3mo control class}]
x = w3mo.discover(return_type=list)
- Device Control
import w3mo
import time
devices = w3mo.discover(return_type=list)
#define device as the control class instantiation at index 0 of devices
device = devices[0]['obj']
#device name and state are set at instantiation and updated throughout use
print("Device Name = {}".format(device.name))
print("Device State = {}".format(device.state))
#turn on
device.set_state(1)
#time.sleep(.25)
#turn off
#device.set_state(0)
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
w3mo-0.1.2.tar.gz
(9.2 kB
view hashes)
Built Distribution
w3mo-0.1.2-py3-none-any.whl
(5.4 kB
view hashes)