A Ruby client library for controlling the LimitlessLED v3.0 RGBW color-changing light bulbs
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 44 commits ahead, 12 commits behind hired:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin
examples
lib
spec
.gitignore
.rspec
.travis.yml
Gemfile
LICENSE.txt
README.md
Rakefile
limitless_led.gemspec

README.md

LimitlessLed

Build Status Dependency Status Code Climate Coverage Status

A Ruby gem for controlling the LimitlessLED v3.0 RGBW color-changing light bulbs, based on the official LimitlessLED API documentation.

Installation

Add this line to your application's Gemfile:

gem 'limitless-led'

And then execute:

$ bundle

Or install it yourself as:

$ gem install limitless-led

Usage

require 'limitless_led'

# If you don't have a LimitlessLED handy you can start the development
# server by running bin/server, it logs to stdout
bridge = LimitlessLed::Bridge.new(host: 'localhost', port: 8899)

# Send in hex like this:
bridge.color "#ff0000"

# You can send a triple
bridge.color "#f00"

# Send data straight to the bridge:
bridge.send_packet "\x40\x00\x55"

# Send a lot of data to the bridge very quickly:
10.times do
  (0..255).each do |int|
    bridge.send_packet "\x40#{ int.chr }\x55"
    sleep 0.005
  end
end

# Again if you don't have the LimitlessLED, you can create an instance
# of the development server
server = LimitlessLed::Server.new(host: 'localhost', port: 8899)

# Then you can see what the server does when it receives messages
server.receive_data("\x40\x00\xff")

View more demos in the /examples directory

If you are using the development server you should see this output:

Output

As a note, since we are transforming the colors from RGB to HSL and then back for representing the color in the console (which additionally is more limiting than the true color space offered by the LED) some of the hex values may not exactly match, especially near the dark limit. Since we are controlling the the brightness of the LED separately, and do not have access to the saturation some colors maybe be harder to reproduce than others, especially dark colors.

Contributors

*This originally was a fork of hired/limitless-led but quickly grew larger in scope so I decided to move it to a new repo.

Contributing

  1. Fork it ( http://github.com/jpsilvashy/limitless-led/fork )
  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