lifx_http 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lifx_http/api.rb +10 -11
- data/lib/lifx_http/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9299bf84401f2d80472d5251cab1805bb8e843c0
|
4
|
+
data.tar.gz: 5c980d4955ed4c9ea59d6be2bd9eace0702bc5da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9d71f0f10e00b945967057bcfb222008779ba06fd0d1fa184d8ef27be123443c9228d84b111629312619a7607606ca6987662bfa8d073ec223460c34ba19b297
|
7
|
+
data.tar.gz: b0c26bf5a004e804c5ef179fef7664c1972224cb8a7c15ca814d6b499e64813f1bc61ad55be29070d499e9d52cf198694c00ecec3181824dfc14b8a4bcc5160d
|
data/lib/lifx_http/api.rb
CHANGED
@@ -11,20 +11,19 @@ module LifxHttp
|
|
11
11
|
|
12
12
|
def set_color(selector, color, options = { duration: 2.0,
|
13
13
|
power_on: true})
|
14
|
-
HTTParty.put(color_url(selector),
|
14
|
+
response = HTTParty.put(color_url(selector),
|
15
15
|
headers: authorization_headers,
|
16
16
|
query: options.merge({
|
17
17
|
color: color
|
18
|
-
}))
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
end
|
18
|
+
}))
|
19
|
+
if response.success?
|
20
|
+
puts "info: set #{selector} to #{color}" if ENV["DEBUG"]
|
21
|
+
puts response.to_s if ENV["DEBUG"]
|
22
|
+
nil
|
23
|
+
else
|
24
|
+
puts "warning: light status - #{response}"
|
25
|
+
-1
|
26
|
+
end
|
28
27
|
end
|
29
28
|
|
30
29
|
def get_info(selector)
|
data/lib/lifx_http/version.rb
CHANGED