lifx-http 0.2.3 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +26 -30
- data/README.md +6 -6
- data/lib/lifx-http.rb +3 -3
- data/lib/lifx-http/version.rb +1 -1
- metadata +2 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2c809d7428e1992d4ce1d02026ff6d1a9f40ce5b
|
|
4
|
+
data.tar.gz: 96e997f125384fd681d0a3680d950b5363f29d73
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f01d11bf43ffe267741280abb39399994222f8c483bbfdbb72bab1c20aa2b29fd19d72b5e3522ffc6adc736d3cb87e36d5364212caea958310959188803fd00c
|
|
7
|
+
data.tar.gz: e806aff9a19d8e511de18c95de5f802206e3b42fd8a053caaf7d8a473c0b4d9f45daf0923e35540aa153427296cd85a10501363df195dfff3e772a334d224915
|
data/Gemfile.lock
CHANGED
|
@@ -1,69 +1,65 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
lifx-http (0.2.
|
|
4
|
+
lifx-http (0.2.3)
|
|
5
5
|
grape (~> 0.6)
|
|
6
6
|
grape-entity (~> 0.4)
|
|
7
7
|
grape-swagger (~> 0.7)
|
|
8
8
|
lifx (= 0.4.5)
|
|
9
|
-
mdns (
|
|
9
|
+
mdns (~> 0.2)
|
|
10
10
|
rack (~> 1.5)
|
|
11
11
|
rack-cors (~> 0.2)
|
|
12
12
|
|
|
13
13
|
GEM
|
|
14
14
|
remote: https://rubygems.org/
|
|
15
15
|
specs:
|
|
16
|
-
activesupport (4.
|
|
16
|
+
activesupport (4.1.5)
|
|
17
17
|
i18n (~> 0.6, >= 0.6.9)
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
json (~> 1.7, >= 1.7.7)
|
|
19
|
+
minitest (~> 5.1)
|
|
20
20
|
thread_safe (~> 0.1)
|
|
21
|
-
tzinfo (~>
|
|
22
|
-
atomic (1.1.16)
|
|
21
|
+
tzinfo (~> 1.1)
|
|
23
22
|
axiom-types (0.1.1)
|
|
24
23
|
descendants_tracker (~> 0.0.4)
|
|
25
24
|
ice_nine (~> 0.11.0)
|
|
26
25
|
thread_safe (~> 0.3, >= 0.3.1)
|
|
27
|
-
bindata (2.
|
|
26
|
+
bindata (2.1.0)
|
|
28
27
|
builder (3.2.2)
|
|
29
28
|
coercible (1.0.0)
|
|
30
29
|
descendants_tracker (~> 0.0.1)
|
|
31
|
-
configatron (3.0
|
|
30
|
+
configatron (3.2.0)
|
|
32
31
|
descendants_tracker (0.0.4)
|
|
33
32
|
thread_safe (~> 0.3, >= 0.3.1)
|
|
34
33
|
equalizer (0.0.9)
|
|
35
|
-
grape (0.
|
|
34
|
+
grape (0.9.0)
|
|
36
35
|
activesupport
|
|
37
36
|
builder
|
|
38
|
-
hashie (>= 1.
|
|
37
|
+
hashie (>= 2.1.0)
|
|
39
38
|
multi_json (>= 1.3.2)
|
|
40
39
|
multi_xml (>= 0.5.2)
|
|
41
40
|
rack (>= 1.3.0)
|
|
42
41
|
rack-accept
|
|
43
42
|
rack-mount
|
|
44
43
|
virtus (>= 1.0.0)
|
|
45
|
-
grape-entity (0.4.
|
|
44
|
+
grape-entity (0.4.4)
|
|
46
45
|
activesupport
|
|
47
46
|
multi_json (>= 1.3.2)
|
|
48
|
-
grape-swagger (0.
|
|
49
|
-
grape
|
|
50
|
-
grape-entity
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
i18n (0.6.9)
|
|
47
|
+
grape-swagger (0.8.0)
|
|
48
|
+
grape
|
|
49
|
+
grape-entity
|
|
50
|
+
hashie (3.3.1)
|
|
51
|
+
i18n (0.6.11)
|
|
54
52
|
ice_nine (0.11.0)
|
|
55
|
-
|
|
53
|
+
json (1.8.1)
|
|
56
54
|
lifx (0.4.5)
|
|
57
55
|
bindata (~> 2.0)
|
|
58
56
|
configatron (~> 3.0)
|
|
59
57
|
timers (~> 1.0)
|
|
60
58
|
yell (~> 2.0)
|
|
61
|
-
mdns (0.
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
multi_json (1.9.2)
|
|
59
|
+
mdns (0.2.1)
|
|
60
|
+
minitest (5.4.1)
|
|
61
|
+
multi_json (1.10.1)
|
|
65
62
|
multi_xml (0.5.5)
|
|
66
|
-
net-dns (0.8.0)
|
|
67
63
|
rack (1.5.2)
|
|
68
64
|
rack-accept (0.4.5)
|
|
69
65
|
rack (>= 0.4)
|
|
@@ -71,15 +67,15 @@ GEM
|
|
|
71
67
|
rack-mount (0.8.3)
|
|
72
68
|
rack (>= 1.0.0)
|
|
73
69
|
rake (10.2.2)
|
|
74
|
-
thread_safe (0.3.
|
|
75
|
-
atomic (>= 1.1.7, < 2)
|
|
70
|
+
thread_safe (0.3.4)
|
|
76
71
|
timers (1.1.0)
|
|
77
|
-
tzinfo (
|
|
78
|
-
|
|
72
|
+
tzinfo (1.2.2)
|
|
73
|
+
thread_safe (~> 0.1)
|
|
74
|
+
virtus (1.0.3)
|
|
79
75
|
axiom-types (~> 0.1)
|
|
80
76
|
coercible (~> 1.0)
|
|
81
|
-
descendants_tracker (~> 0.0.3)
|
|
82
|
-
equalizer (~> 0.0.9)
|
|
77
|
+
descendants_tracker (~> 0.0, >= 0.0.3)
|
|
78
|
+
equalizer (~> 0.0, >= 0.0.9)
|
|
83
79
|
yell (2.0.4)
|
|
84
80
|
|
|
85
81
|
PLATFORMS
|
data/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# LIFX HTTP API
|
|
2
2
|
|
|
3
|
-
[](https://rubygems.org/gems/lifx-http)
|
|
3
|
+
[](https://rubygems.org/gems/lifx-http)
|
|
4
4
|
|
|
5
5
|
This is an **unofficial** JSON RESTful API service for controlling LIFX devices. This API adds some reliability that the [LIFX gem](https://github.com/LIFX/lifx-gem) does not include.
|
|
6
6
|
|
|
@@ -22,13 +22,13 @@ This is an **unofficial** JSON RESTful API service for controlling LIFX devices.
|
|
|
22
22
|
Run `export ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future; sudo -E gem install lifx-http`
|
|
23
23
|
* Run in foreground (no daemonizing yet): `lifx-http`
|
|
24
24
|
* Test if working: `curl http://localhost:56780/lights.json`
|
|
25
|
-
* Toggle all lights: `curl -XPUT http://localhost:56780/lights/all/toggle`
|
|
25
|
+
* Toggle all lights: `curl -XPUT http://localhost:56780/lights/all/toggle -d ''`
|
|
26
26
|
* Set all lights to green:
|
|
27
|
-
* URL params: `curl -XPUT http://localhost:56780/lights/all/color?hue=120&saturation=1&brightness=1&duration=2 -d ''`
|
|
27
|
+
* URL params: `curl -XPUT "http://localhost:56780/lights/all/color?hue=120&saturation=1&brightness=1&duration=2" -d ''`
|
|
28
28
|
* JSON body: `curl -XPUT http://localhost:56780/lights/all/color -H "Content-Type: application/json" -d '{"hue": 120, "saturation": 1, "brightness": 1, "duration":2}'`
|
|
29
|
-
* Override method by setting `_method`: `curl http://localhost:56780/lights/all/color?hue=120&saturation=1&brightness=1&duration=2&_method=put`
|
|
29
|
+
* Override method by setting `_method`: `curl "http://localhost:56780/lights/all/color?hue=120&saturation=1&brightness=1&duration=2&_method=put"`
|
|
30
30
|
* Start a slow sunrise effect:
|
|
31
|
-
* `curl -XPUT http://localhost:56780/lights/all/color?hue=35&saturation=0.37&brightness=0.65&duration=10m -d ''`
|
|
31
|
+
* `curl -XPUT "http://localhost:56780/lights/all/color?hue=35&saturation=0.37&brightness=0.65&duration=10m" -d ''`
|
|
32
32
|
|
|
33
33
|
## API
|
|
34
34
|
|
|
@@ -50,7 +50,7 @@ This is an **unofficial** JSON RESTful API service for controlling LIFX devices.
|
|
|
50
50
|
## Documentation
|
|
51
51
|
|
|
52
52
|
This API is documented using [Swagger](https://github.com/wordnik/swagger-ui).
|
|
53
|
-
To view documentation and play with the API, start the API server locally, then visit http://swagger.wordnik.com and put `http://localhost:
|
|
53
|
+
To view documentation and play with the API, start the API server locally, then visit http://petstore.swagger.wordnik.com/ and put `http://localhost:56700/swagger_doc.json` in the first text box, then hit `Explore`.
|
|
54
54
|
|
|
55
55
|
You should see something like this:
|
|
56
56
|

|
data/lib/lifx-http.rb
CHANGED
|
@@ -142,7 +142,7 @@ module LIFXHTTP
|
|
|
142
142
|
params[:brightness],
|
|
143
143
|
params[:kelvin]
|
|
144
144
|
)
|
|
145
|
-
|
|
145
|
+
|
|
146
146
|
# parse minute and hour duration forms
|
|
147
147
|
duration = case params[:duration]
|
|
148
148
|
when /m$/i # Minutes
|
|
@@ -153,7 +153,7 @@ module LIFXHTTP
|
|
|
153
153
|
params[:duration].to_f
|
|
154
154
|
end
|
|
155
155
|
|
|
156
|
-
lifx.sync { 3.times { @target.set_color(color, duration: duration) } } # Retry
|
|
156
|
+
lifx.sync { 3.times { @target.set_color(color, duration: duration) } } # Retry
|
|
157
157
|
present_target(@target)
|
|
158
158
|
end
|
|
159
159
|
end
|
|
@@ -197,7 +197,7 @@ module LIFXHTTP
|
|
|
197
197
|
end
|
|
198
198
|
end
|
|
199
199
|
|
|
200
|
-
add_swagger_documentation
|
|
200
|
+
add_swagger_documentation
|
|
201
201
|
end
|
|
202
202
|
end
|
|
203
203
|
require "lifx-http/version"
|
data/lib/lifx-http/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: lifx-http
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jack Chen (chendo)
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2014-
|
|
11
|
+
date: 2014-09-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rack
|
|
@@ -181,4 +181,3 @@ signing_key:
|
|
|
181
181
|
specification_version: 4
|
|
182
182
|
summary: A HTTP API for interacting with LIFX devices.
|
|
183
183
|
test_files: []
|
|
184
|
-
has_rdoc:
|