lita-onewheel-forecast-io 1.4.15 → 1.4.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lita/handlers/forecasts.rb +11 -5
- data/lita-onewheel-forecast-io.gemspec +1 -1
- 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: 9e35daf91ea87627eff8a13a7add8b932bd6708d
|
4
|
+
data.tar.gz: cdfaa2b93fdefcba65695904afc440a4f98de6ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 030467008da6f2b6ceeb035a2e96ce95680f081f8b640a0cb7276453ed8ebb84b9586ef6affdd749cf3d95667c583e412dbaac4cd0370baae0b4c8dade3c1704
|
7
|
+
data.tar.gz: 8f41fec613e741c004d2236d8b4054e55a1de78e83c59c4e1e5541ac775722f1e65577fb1a341db747a74091f524fec4d907ed57722c1633329ea8c989ec1f18
|
@@ -469,14 +469,16 @@ module ForecastIo
|
|
469
469
|
last_temp = 0
|
470
470
|
|
471
471
|
forecast['hourly']['data'].each_with_index do |hour, index|
|
472
|
-
tm = Time.at(hour['time']).to_datetime.strftime('%k:%M')
|
473
|
-
|
474
472
|
if hour['temperature'] > high_temp
|
475
473
|
high_temp = hour['temperature'].to_i
|
476
474
|
end
|
477
|
-
|
475
|
+
puts index
|
478
476
|
if !time_to_close_the_windows and hour['temperature'].to_i >= 71
|
479
|
-
|
477
|
+
if index == 0
|
478
|
+
time_to_close_the_windows = 'now'
|
479
|
+
else
|
480
|
+
time_to_close_the_windows = hour['time']
|
481
|
+
end
|
480
482
|
window_close_temp = hour['temperature']
|
481
483
|
end
|
482
484
|
|
@@ -497,7 +499,11 @@ module ForecastIo
|
|
497
499
|
time_at = Time.at(time_to_close_the_windows).to_datetime
|
498
500
|
local_time = timezone.utc_to_local(time_at)
|
499
501
|
|
500
|
-
|
502
|
+
if time_to_close_the_windows == 'now'
|
503
|
+
output = "Close the windows now! It is #{get_temperature window_close_temp}. "
|
504
|
+
else
|
505
|
+
output = "Close the windows at #{local_time.strftime('%k:%M')}, it will be #{get_temperature window_close_temp}. "
|
506
|
+
end
|
501
507
|
if time_to_open_the_windows
|
502
508
|
open_time = timezone.utc_to_local(Time.at(time_to_open_the_windows).to_datetime)
|
503
509
|
output += "Open them back up at #{open_time.strftime('%k:%M')}. "
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lita-onewheel-forecast-io
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kreps
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-08-
|
11
|
+
date: 2016-08-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lita
|