lita-onewheel-forecast-io 1.4.11 → 1.4.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 33dc9d11a270c21e86e4bcf16edfeca51a44e1ea
4
- data.tar.gz: 66208f153063969114b20b7c67fe8907bb455ff5
3
+ metadata.gz: bf1fbe563345fdf7b6c7cda182d12288bb66928d
4
+ data.tar.gz: f7ab8db809d9a73376a11e9954fb936998610ce5
5
5
  SHA512:
6
- metadata.gz: 829c0e5971290d70a7bf001444bed9e7281c2c29677056122ecd61daf8aa7cb597f8db8d6a6431a3a0d128ff9162bf2c4753a9e720408bc602c8a71d0342904e
7
- data.tar.gz: 40741740952e137111420fc642545ef9f86e7ad661fe39f6a5b9e9f3e488096fe20f581612172a29a799206bf828635bf142cf5f399ce6b2b5951d037cb9f6a3
6
+ metadata.gz: b1a9af2e0660516208c1a888d89f9a8a9a2c884ddb603b5ac229d177f2920fc820074415e1419457027078781a5dc341f2f3ebac0481060a5e2e98868830fa89
7
+ data.tar.gz: 698e37efa2717ab9a04950ff98d67f6be2ba99321b901e2c3fea10a17de6231eba4aa808dc2eb58ecab67c78de514a0dc7c083d6e6e9f1969f3e36b5647582a1
@@ -466,6 +466,7 @@ module ForecastIo
466
466
  time_to_open_the_windows = nil
467
467
  window_close_temp = 0
468
468
  high_temp = 0
469
+ last_temp = 0
469
470
 
470
471
  forecast['hourly']['data'].each_with_index do |hour, index|
471
472
  tm = Time.at(hour['time']).to_datetime.strftime('%k:%M')
@@ -479,10 +480,11 @@ module ForecastIo
479
480
  window_close_temp = hour['temperature']
480
481
  end
481
482
 
482
- if !time_to_open_the_windows and time_to_close_the_windows and hour['temperature'].to_i <= 75
483
+ if !time_to_open_the_windows and time_to_close_the_windows and hour['temperature'] < last_temp and hour['temperature'].to_i <= 75
483
484
  time_to_open_the_windows = hour['time']
484
485
  end
485
486
 
487
+ last_temp = hour['temperature']
486
488
  break if index > 12
487
489
  end
488
490
 
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'lita-onewheel-forecast-io'
3
- spec.version = '1.4.11'
3
+ spec.version = '1.4.12'
4
4
  spec.authors = ['Andrew Kreps']
5
5
  spec.email = ['andrew.kreps@gmail.com']
6
6
  spec.description = <<-EOS
@@ -513,7 +513,7 @@ describe Lita::Handlers::OnewheelForecastIo, lita_handler: true do
513
513
  it '!windows' do
514
514
  mock_up 'windows'
515
515
  send_command 'windows'
516
- expect(replies.last).to eq('Close the windows at 16:00, it will be 72°F. Open them back up at 16:00. The high today will be 72°F.')
516
+ expect(replies.last).to eq('Close the windows at 16:00, it will be 72°F. Open them back up at 17:00. The high today will be 72°F.')
517
517
  end
518
518
 
519
519
  it 'will not say a 28.000000000000004% chance of rain' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita-onewheel-forecast-io
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.11
4
+ version: 1.4.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kreps