Skip to content
This repository was archived by the owner on Jun 8, 2023. It is now read-only.

Commit 6cb3671

Browse files
committed
Update wunderground.coffee
Improvement based on comment in pull request #1294 by https://github.com/technicalpickles
1 parent f7c6288 commit 6cb3671

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/scripts/wunderground.coffee

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,8 @@ get_data = (robot, msg, location, service, query, cb, lifetime, stack=0) ->
8888

8989
send_forecast = (msg, location, data) ->
9090
report = data.forecast.txt_forecast.forecastday[0]
91-
if not process.env.HUBOT_WUNDERGROUND_USE_METRIC?
92-
msg.send "#{report.title} in #{location}: #{report.fcttext} (#{formatted_ttl data})"
93-
else
94-
msg.send "#{report.title} in #{location}: #{report.fcttext_metric} (#{formatted_ttl data})"
91+
useMetric = process.env.HUBOT_WUNDERGROUND_USE_METRIC?
92+
msg.send "#{report.title} in #{location}: #{if useMetric then report.fcttext_metric else report.fcttext} (#{formatted_ttl data})"
9593
send_radar = (msg, location, data) ->
9694
msg.send "#{data.radar.image_url}#.png"
9795

0 commit comments

Comments
 (0)