lita-onewheel-forecast-io 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 77c5b6efb523b81ab8adf7891cb2a6488785eac9
4
- data.tar.gz: 2bcf85609075407b966c58f3b5803504adf9a850
3
+ metadata.gz: 9e7939943f8bb42823cc685f74687541f8099cf3
4
+ data.tar.gz: dd6ab041be109af577e9988caca667c389782ee2
5
5
  SHA512:
6
- metadata.gz: 2cb80ea485d8e9290670ab8e43b931d78d00d82022eca445eb8f7c966f4846e7389fb1d32e9306b0e5b0c182da3d7843da2abe67e6e4151bdaa3a5d27aaceb17
7
- data.tar.gz: 85e8836c3307ec22242c9052f34edec05715380fe4a0149948353f7cdd9a3c35dbd62d3e4e1a404e9455bc93a363c7dab297c98aa3e14f05fb27f9332a84b3be
6
+ metadata.gz: 17a04e305e21c1e4ec04f7405c58be6882999e1516c9edaeadc71eecd6c89755894b69a81f0aedcbdc45fe8837b06f7cbce366a00e848f490e87bd14989ce57a
7
+ data.tar.gz: 95fb3a33b960f4fc540b9bb5893ffdb4800cfaa67f5a26bf0e74a8ca38287d3c2a512b6a3d4b36d0b9b6259f9d7e42144adb466da80736bf4564086374590e1a
@@ -191,18 +191,19 @@ module ForecastIo
191
191
  key = 'cloudCover'
192
192
  data_points = []
193
193
  data = forecast['hourly']['data']
194
+ sun_mod_data = []
194
195
 
195
196
  data.each do |datum|
196
197
  data_points.push (1 - datum[key]).to_f # It's a cloud cover percentage, so let's inverse it to give us sun cover.
197
- datum[key] = (1 - datum[key]).to_f # Mod the source data for the get_dot_str call below.
198
+ sun_mod_data << {key => (1 - datum[key]).to_f} # Mod the source data for the get_dot_str call below.
198
199
  end
199
200
 
200
201
  differential = data_points.max - data_points.min
201
202
 
202
- str = get_dot_str(chars, data, data_points.min, differential, key)
203
+ str = get_dot_str(chars, sun_mod_data, data_points.min, differential, key)
203
204
 
204
205
  if config.colors
205
- str = get_colored_string(data, key, str, get_sun_range_colors)
206
+ str = get_colored_string(sun_mod_data, key, str, get_sun_range_colors)
206
207
  end
207
208
 
208
209
  max = 1 - get_min_by_data_key(forecast, 'hourly', key)
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'lita-onewheel-forecast-io'
3
- spec.version = '1.1.0'
3
+ spec.version = '1.1.1'
4
4
  spec.authors = ['Andrew Kreps']
5
5
  spec.email = ['andrew.kreps@gmail.com']
6
6
  spec.description = <<-EOS
@@ -293,7 +293,7 @@ describe Lita::Handlers::OnewheelForecastIo, lita_handler: true do
293
293
 
294
294
  it '!ansisun' do
295
295
  send_command 'ansisun'
296
- expect(replies.last).to eq("Portland, OR 48hr sun forecast |\u000308████████████████████\u000307▇▇▅\u000309▅▅▃\u000303▁_▁\u000309▃▃▃\u000303▁▁▁▁▃\u000309▃▅\u000307▇▇▇▇\u000308▇▇▇▇▇▇\u0003| max 88%")
296
+ expect(replies.last).to eq("Portland, OR 48hr sun forecast |\u000308████████████████████\u000307▇▇▅\u000309▅▅▃\u000303▁_▁\u000309▃▃▃\u000303▁▁▁▁▃\u000309▃▅\u000307▇▇▇▇\u000308▇▇▇▇▇▇\u0003| max 100%")
297
297
  end
298
298
 
299
299
  it '!dailysun' do
@@ -303,7 +303,7 @@ describe Lita::Handlers::OnewheelForecastIo, lita_handler: true do
303
303
 
304
304
  it '!asciisun' do
305
305
  send_command 'asciisun'
306
- expect(replies.last).to eq("Portland, OR 48hr sun forecast |\u000308''''''''''''''''''''\u000307**~\u000309~~-\u000303._.\u000309---\u000303....-\u000309-~\u000307****\u000308******\u0003| max 88%")
306
+ expect(replies.last).to eq("Portland, OR 48hr sun forecast |\u000308''''''''''''''''''''\u000307**~\u000309~~-\u000303._.\u000309---\u000303....-\u000309-~\u000307****\u000308******\u0003| max 100%")
307
307
  end
308
308
 
309
309
  it '!ansicloud' do
@@ -444,8 +444,8 @@ describe Lita::Handlers::OnewheelForecastIo, lita_handler: true do
444
444
  expect(replies[2]).to include("|\u000302_\u000313▅\u000310▁\u000303▃\u000309▃\u000311▃\u000308▅\u000307▅\u000304▅\u000313▅\u000302___________________________________________________\u0003|")
445
445
  expect(replies[3]).to eq("Portland, OR 24 hr temps: 28.3°F |\u000306_▁▃\u000310▅▇█\u000303██\u000310██▇▅\u000306▅▃▃▃▃▃▃▁▁▁▁\u0003| 28.4°F Range: 28.3°F - 39.0°F")
446
446
  expect(replies[4]).to eq("Portland, OR 48h wind direction 4.3 mph|\u000306↓\u000310↙←\u000311↖↑↗\u000308→↘\u000311↓←←←←←←\u000310←←←←←←←\u000306←←←←←\u000302←←←↙↙↙↙↓↓↓\u000306↓↓↓↓↓↓↓↓↙↙\u0003|4.18 mph Range: 1.39 mph - 12.71 mph")
447
- expect(replies[5]).to eq("Portland, OR 48hr sun forecast |\u000308████████████████████\u000307▇▇▅\u000309▅▅▃\u000303▁_▁\u000309▃▃▃\u000303▁▁▁▁▃\u000309▃▅\u000307▇▇▇▇\u000308▇▇▇▇▇▇\u0003| max 88%")
448
- expect(replies[6]).to eq("Portland, OR 24h cloud cover |████████████████████▇▇▇| range 51.0% - 100.0%")
447
+ expect(replies[5]).to eq("Portland, OR 48hr sun forecast |\u000308████████████████████\u000307▇▇▅\u000309▅▅▃\u000303▁_▁\u000309▃▃▃\u000303▁▁▁▁▃\u000309▃▅\u000307▇▇▇▇\u000308▇▇▇▇▇▇\u0003| max 100%")
448
+ expect(replies[6]).to eq("Portland, OR 24h cloud cover |___________▁▁▁▁▁▁▁▁▃▅▅▅| range 0% - 49.0%")
449
449
  expect(replies[7]).to eq("Portland, OR 48 hr snows |\u000302_______________________❄❄❄❄▁▁▁▁▁▁▁▁▁▁▁▁▁❄❄❄❄❄❄❄❄_\u0003| max 4.0%")
450
450
  end
451
451
 
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.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kreps