Skip to content

Commit

Permalink
#27 more max for 7dayrain!
Browse files Browse the repository at this point in the history
  • Loading branch information
onewheelskyward committed Dec 16, 2015
1 parent 4e00698 commit 2f32ffa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/lita/handlers/forecasts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,9 @@ def do_the_seven_day_rain_thing(forecast)
str = get_colored_string(data, 'precipProbability', str, get_rain_range_colors)
end

"7day #{precip_type}s |#{str}|"
max = get_max_by_data_key(forecast, 'daily', 'precipProbability')

"7day #{precip_type}s |#{str}| max #{max * 100}%"
end

def do_the_daily_rain_thing(forecast)
Expand Down
2 changes: 1 addition & 1 deletion spec/lita/handlers/forecast_io_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@

it '!7dayrain' do
send_message '7dayrain'
expect(replies.last).to eq("Portland, OR 7day snows |\u000302_▁▁\u000306▃\u000313█\u000303▅▅\u000310▃\u0003|")
expect(replies.last).to eq("Portland, OR 7day snows |\u000302_▁▁\u000306▃\u000313█\u000303▅▅\u000310▃\u0003| max 100%")
end

it '!ansiozone' do
Expand Down

0 comments on commit 2f32ffa

Please sign in to comment.