GithubHelp home page GithubHelp logo

bpaauwe / pywemo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pywemo/pywemo

0.0 1.0 0.0 244 KB

Lightweight Python module to discover and control WeMo devices.

Python 99.89% Shell 0.11%

pywemo's Introduction

pyWeMo Build Status

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.

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.

pywemo's People

Contributors

pavoni avatar sqldiablo avatar balloob avatar jaharkes avatar tomwilkie avatar kk7ds avatar stu-gott avatar meatheadmike avatar mcspr avatar deftdawg avatar angel12 avatar cbrunet avatar carlosperate avatar vividboarder avatar pjz avatar mickeprag avatar mrstegeman avatar markadr avatar vemek avatar exxamalte avatar kylejohnson avatar gstorer avatar roost avatar bpaauwe avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.