limitless-led 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/examples/demo.rb +1 -1
- data/lib/limitless_led.rb +4 -4
- data/lib/limitless_led/bridge.rb +3 -3
- data/lib/limitless_led/version.rb +1 -1
- data/limitless_led.gemspec +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 901d84dcf4e4266d3e24ee4950c04bab3bf4389f
|
4
|
+
data.tar.gz: a1df28ae5787020c6ba8140f8d64051b059eb959
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fad09f649db90300f7e37a6f2d83835e63b705b90e97eeb9d67608b3e47b53b09b7924c94a853a788d9fd353bde48b6914fcb8046a068290682c740dbbffd8d7
|
7
|
+
data.tar.gz: 44ab3440c26c8e0875c1ec3c600957d1210e33d207f820cc4740faa5ec61ed95b1ab7a70ba31a1f3430151d4d5da607505037762f10259879b772ccee780e610
|
data/README.md
CHANGED
@@ -3,6 +3,7 @@
|
|
3
3
|
[![Build Status](https://travis-ci.org/jpsilvashy/limitless-led.png?branch=master)](https://travis-ci.org/jpsilvashy/limitless-led)
|
4
4
|
[![Dependency Status](https://gemnasium.com/jpsilvashy/limitless-led.png)](https://gemnasium.com/jpsilvashy/limitless-led)
|
5
5
|
[![Code Climate](https://codeclimate.com/github/jpsilvashy/limitless-led.png)](https://codeclimate.com/github/jpsilvashy/limitless-led)
|
6
|
+
[![Coverage Status](https://coveralls.io/repos/jpsilvashy/limitless-led/badge.png)](https://coveralls.io/r/jpsilvashy/limitless-led)
|
6
7
|
|
7
8
|
A Ruby gem for controlling the [LimitlessLED v3.0 RGBW color-changing light bulbs](http://www.limitlessled.com/), based on the official [LimitlessLED API documentation](http://www.limitlessled.com/dev/).
|
8
9
|
|
data/examples/demo.rb
CHANGED
@@ -4,7 +4,7 @@ require 'limitless_led'
|
|
4
4
|
|
5
5
|
# If you don't have a LimitlessLED handy you can start the development
|
6
6
|
# server by running bin/server, it logs to stdout
|
7
|
-
bridge = LimitlessLed::Bridge.new(host:
|
7
|
+
bridge = LimitlessLed::Bridge.new(host: "107.3.148.126", port: 8899)
|
8
8
|
|
9
9
|
# Send in hex like this:
|
10
10
|
bridge.color "#ff0000"
|
data/lib/limitless_led.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
#!/usr/bin/ruby
|
2
|
-
require "limitless_led/version"
|
2
|
+
require "./lib/limitless_led/version"
|
3
3
|
|
4
|
-
require "limitless_led/logger"
|
5
|
-
require "limitless_led/bridge"
|
6
|
-
require "limitless_led/server"
|
4
|
+
require "./lib/limitless_led/logger"
|
5
|
+
require "./lib/limitless_led/bridge"
|
6
|
+
require "./lib/limitless_led/server"
|
7
7
|
|
8
8
|
module LimitlessLed
|
9
9
|
class CommandNotImplemented < StandardError; end
|
data/lib/limitless_led/bridge.rb
CHANGED
@@ -59,13 +59,13 @@ module LimitlessLed
|
|
59
59
|
|
60
60
|
# receive color as string like #ff0000 or a triplet
|
61
61
|
# transform to HSL color
|
62
|
-
color = Color::RGB.from_html(color).to_hsl
|
62
|
+
# color = Color::RGB.from_html(color).to_hsl
|
63
63
|
|
64
64
|
# Transform color into value out of 255
|
65
|
-
hue = color.hue
|
65
|
+
# hue = ((-(color.to_hsl.hue - 240) % 360) / 360.0 * 255.0).to_i
|
66
66
|
|
67
67
|
# send command
|
68
|
-
send_packet "\x40#{
|
68
|
+
send_packet "\x40#{ color.to_i.chr }\x55"
|
69
69
|
end
|
70
70
|
|
71
71
|
end
|
data/limitless_led.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: limitless-led
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joseph Silvashy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-01-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -139,3 +139,4 @@ test_files:
|
|
139
139
|
- spec/logger_spec.rb
|
140
140
|
- spec/server_spec.rb
|
141
141
|
- spec/spec_helper.rb
|
142
|
+
has_rdoc:
|