Skip to content

Commit

Permalink
Added scale sensitivity for windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
onewheelskyward committed Aug 16, 2016
1 parent 8ec4c1d commit 5682a93
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/lita/handlers/forecasts.rb
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion 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
Expand Down
7 changes: 7 additions & 0 deletions spec/lita/handlers/forecast_io_spec.rb
Expand Up @@ -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'
Expand Down

0 comments on commit 5682a93

Please sign in to comment.