From 5682a93297917c9e22f5aec811922d3d4579fac4 Mon Sep 17 00:00:00 2001 From: Andrew Kreps Date: Mon, 15 Aug 2016 23:12:13 -0700 Subject: [PATCH] Added scale sensitivity for windows. --- lib/lita/handlers/forecasts.rb | 4 ++-- lita-onewheel-forecast-io.gemspec | 2 +- spec/lita/handlers/forecast_io_spec.rb | 7 +++++++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/lita/handlers/forecasts.rb b/lib/lita/handlers/forecasts.rb index e9754c4..c8f1345 100644 --- a/lib/lita/handlers/forecasts.rb +++ b/lib/lita/handlers/forecasts.rb @@ -497,12 +497,12 @@ def do_the_windows_thing(forecast) time_at = Time.at(time_to_close_the_windows).to_datetime local_time = timezone.utc_to_local(time_at) - output = "Close the windows at #{local_time.strftime('%k:%M')}, it will be #{window_close_temp}°F. " + output = "Close the windows at #{local_time.strftime('%k:%M')}, it will be #{get_temperature window_close_temp}. " if time_to_open_the_windows open_time = timezone.utc_to_local(Time.at(time_to_open_the_windows).to_datetime) output += "Open them back up at #{open_time.strftime('%k:%M')}. " end - output += "The high today will be #{high_temp}°F." + output += "The high today will be #{get_temperature high_temp}." end end end diff --git a/lita-onewheel-forecast-io.gemspec b/lita-onewheel-forecast-io.gemspec index 1116d12..616a237 100644 --- a/lita-onewheel-forecast-io.gemspec +++ b/lita-onewheel-forecast-io.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |spec| spec.name = 'lita-onewheel-forecast-io' - spec.version = '1.4.13' + spec.version = '1.4.14' spec.authors = ['Andrew Kreps'] spec.email = ['andrew.kreps@gmail.com'] spec.description = <<-EOS diff --git a/spec/lita/handlers/forecast_io_spec.rb b/spec/lita/handlers/forecast_io_spec.rb index e980a61..77fd83b 100644 --- a/spec/lita/handlers/forecast_io_spec.rb +++ b/spec/lita/handlers/forecast_io_spec.rb @@ -516,6 +516,13 @@ def mock_up(filename) 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.') end + it '!windows in c' do + mock_up 'windows' + send_command 'set scale c' + send_command 'windows' + expect(replies.last).to eq('Close the windows at 16:00, it will be 22.22°C. Open them back up at 17:00. The high today will be 22.22°C.') + end + it 'will not say a 28.000000000000004% chance of rain' do mock_up '28000000000004percent' send_command 'dailyrain'