Project

wemote

0.01
No commit activity in last 3 years
No release in over 3 years
Wemote is a Ruby-agnostic gem for Wemo light switches
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 1.1.6, ~> 1.1
 Project Readme

Wemote Build Status Gem Version Code Climate

Wemote is an interface for controlling WeMo light switches (and possibly outlets in the future). Unlike other implementations, it does not rely upon playful for upnp discovery, which makes it compatible with alternative Ruby engines, such as JRuby.

Installation

Add this line to your application's Gemfile:

gem 'wemote'

And then execute:

$ bundle

Or install it yourself as:

$ gem install wemote

Usage

You can fetch all lightswitches on your network (providing you've set them up with your smartphone), via:

switches = Wemote::Switch.all #=> [#<Wemote::Switch:0x27f33aef @host="192.168.1.11", @name="Kitchen Switch", @port="49154">

Or select a switch by its friendly name:

switch = Wemote::Switch.find('Kitchen Switch') #=> #<Wemote::Switch:0x27f33aef @host="192.168.1.11", @name="Kitchen Switch", @port="49154">

Given a Switch instance, you can call the following methods:

switch.off? #=> [true,false]
switch.on? #=> [true,false]
switch.on!
switch.off!
switch.toggle!

Performance

Wemote is designed to be performant - and as such, it will leverage the best HTTP library available for making requests. Currently, Wemote will use (in order of preference): manticore, typhoeus, and finally (miserably) net/http. Because you probably like things fast too, we recommend you gem install manticore on JRuby, or gem install typhoeus on another engine. In order to keep the gem as flexible as possible, none of these are direct dependencies. They just make Wemote happy and fast.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request