lita-onewheel-forecast-io 1.4.15 → 1.4.16

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7d01c1425f26307a10f9619f5c9de28f61376686
4
- data.tar.gz: de49f45b0557d21bd0d383952ea645a9a2e96680
3
+ metadata.gz: 9e35daf91ea87627eff8a13a7add8b932bd6708d
4
+ data.tar.gz: cdfaa2b93fdefcba65695904afc440a4f98de6ba
5
5
  SHA512:
6
- metadata.gz: 91e0c969e3dfd0985f226fdbec95b93a5f39ef42503087c9a75cf36bd3ffb5f12b64d5cd1fb32041e16aff24ff7416dfb564a21df30b22206ede9d18ffeaefc6
7
- data.tar.gz: aeea06f95e67f4587881929f8212dcf46dc5f0937b3b2903cdf994f97d570836436640337fd1d7620b315730bbe6e6e4da50fd8ca0a43cb0c9ebd3262eb90678
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
- time_to_close_the_windows = hour['time']
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
- output = "Close the windows at #{local_time.strftime('%k:%M')}, it will be #{get_temperature window_close_temp}. "
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')}. "
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'lita-onewheel-forecast-io'
3
- spec.version = '1.4.15'
3
+ spec.version = '1.4.16'
4
4
  spec.authors = ['Andrew Kreps']
5
5
  spec.email = ['andrew.kreps@gmail.com']
6
6
  spec.description = <<-EOS
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.15
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-18 00:00:00.000000000 Z
11
+ date: 2016-08-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lita