hueshift 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/hueshift/version.rb +1 -1
- data/lib/hueshift.rb +11 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6096b52b63596c72088581e714eab8f7b8b9779f
|
4
|
+
data.tar.gz: 86ce9e4f8de24f3634d4b182ac8f6c328539b717
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f0732f971af7cae0a4f74760350dfa3304430c7013f711bed99cbc5a71cc7770aa3956835b5b8623aded6ed5101a7d6cf53a786d9016effea9da24a9d7392ad1
|
7
|
+
data.tar.gz: 7785a54fe3c9a4b2325d90c5933e03c64e567efb1220918efd8077e0d297b5837f718bffc45a3e95eef3c5924315386285a46eca24bb8bbc9bb96ba4934dd28e
|
data/lib/hueshift/version.rb
CHANGED
data/lib/hueshift.rb
CHANGED
@@ -14,10 +14,10 @@ class Numeric
|
|
14
14
|
end
|
15
15
|
|
16
16
|
module Hueshift
|
17
|
-
LAT = ENV.fetch "LAT", 35.779
|
18
|
-
LON = ENV.fetch "LON", -78.6465
|
19
|
-
DAY_TEMP = ENV.fetch "DAY_TEMP", 5500
|
20
|
-
NIGHT_TEMP = ENV.fetch "NIGHT_TEMP", 1900
|
17
|
+
LAT = (ENV.fetch "LAT", 35.779).to_f
|
18
|
+
LON = (ENV.fetch "LON", -78.6465).to_f
|
19
|
+
DAY_TEMP = (ENV.fetch "DAY_TEMP", 5500).to_i
|
20
|
+
NIGHT_TEMP = (ENV.fetch "NIGHT_TEMP", 1900).to_i
|
21
21
|
|
22
22
|
def redshift
|
23
23
|
client = Hue::Client.new
|
@@ -34,7 +34,13 @@ module Hueshift
|
|
34
34
|
|
35
35
|
def redshift_server(sleepytime: 30)
|
36
36
|
loop do
|
37
|
-
|
37
|
+
begin
|
38
|
+
redshift
|
39
|
+
rescue Exception => e
|
40
|
+
puts "#{Time.now}: Received #{e.class}: #{e.message}"
|
41
|
+
e.backtrace.each { |line| puts "\t#{line}" }
|
42
|
+
#puts e.backtrace
|
43
|
+
end
|
38
44
|
sleep sleepytime
|
39
45
|
end
|
40
46
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hueshift
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Toniazzo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-10-
|
11
|
+
date: 2015-10-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|