Skip to content

Latest commit

 

History

History
30 lines (25 loc) · 943 Bytes

File metadata and controls

30 lines (25 loc) · 943 Bytes

WeMo

wemo.py contains a simple Python class for the Belkin WeMo device. It uses Miranda for UPnP.

Files

  • wemo.py - The main class, supports turning the outlet on/off as well as changing the device's name. Running python wemo.py lists WeMos on the network along with their binaryState (on/off).
  • miranda.py - A slightly modified version of the miranda client.

Sample Usage

$ python
>>> from wemo import *
>>> 
>>> wemos = search()
>>> for wemo in wemos:
...     print wemo.binaryState, "\t", wemo.friendlyName
... 
True 	Master Bedroom
False 	Kitchen
True 	Staircase
>>> 
>>> w = wemos[0]
>>> w.binaryState = False
>>> w.binaryState = True
>>> w.binaryState = not w.binaryState
>>>