Project

ruby_hue

0.0
No commit activity in last 3 years
No release in over 3 years
RubyHue is a library for interacting with Hue light bulbs from Phillips.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.5.1gua
~> 2.13.0
~> 0.6.2
~> 1.11.0

Runtime

~> 0.10.2
~> 1.7.2
 Project Readme

RubyHue

RubyHue is a library to interact with Hue lights.

http://meethue.com/

Code Climate Gem Version

Installation

Add this line to your application's Gemfile:

gem 'ruby_hue'

And then execute:

$ bundle

Or install it yourself as:

$ gem install ruby_hue

Usage

RubyHue starts mostly at the Bridge class.

bridge = RubyHue::Bridge.new("192.168.1.100", "yourbridgeusername")

To get all lights for the bridge:

bridge = RubyHue::Bridge.new("192.168.1.100", "yourbridgeusername")
lights = bridge.lights

lights.state.on = true
lights.state.save # This will turn on all lights on the bridge

Light Usage

RubyHue comes with a Light class that you initialize with an ID and Bridge instance. Most interactions will happen with an instance of this class.

bridge = RubyHue::Bridge.new("192.168.1.100", "yourbridgeusername")
light = RubyHue::Light.new("1", bridge)

Now you're ready to ask for the current state of the light (on, brightness, hue, etc...)

light = RubyHue::Light.new("1", bridge)
light.state.brightness
# => 50

light.state.brightness = 255
light.state.save
#=> [{"success"=>{"/lights/1/state/bri"=>255}}, ....

Here's the list of states you can change:

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