lita-onewheel-aqi 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: '0449f2926e7b3170f465631d795000ef17840603'
4
- data.tar.gz: 3de732d584ce510414117b0ce09f92c05ad994e7
3
+ metadata.gz: 1718ac9cefb5363670b2ae7372a4c724cbd4a775
4
+ data.tar.gz: b4c06144a240f7e331cffdee4c584566466954b4
5
5
  SHA512:
6
- metadata.gz: 6f50e387aea137640878045c14319309fc14386f8f11f5c33a0ea6d919fc641b599829c7784ff41dc13da0db142d29c6c1bec6d153d7a27107d073b75bad9240
7
- data.tar.gz: 6c38929597f86e3159cde7bbf092f345ca1e7d1920adf7e129422f78f7ca2f8f86a728dc86452cae8ad1e50449b4145cf8e7013d1f99e5bf91995df8fa48fe99
6
+ metadata.gz: 0a0ab305267ae4221469f86efaf805203316955c05fd6df66f87e869f39ad457f23876b58dad71959b554ef9e74064824e853249a2b6468caccd11249c1ae16b
7
+ data.tar.gz: 4da4e27f04a59a770cfa99165831893e1770c4d86fe892619f1fb64aeb1b966c393c9d71f362c1d7c7a6f4fe9e8187189ac2796959d907875600449240795d4b
@@ -62,20 +62,20 @@ module Lita
62
62
  observed_aqi = JSON.parse(observed_response)
63
63
  Lita.logger.debug 'Observed response: ' + observed_aqi.inspect
64
64
 
65
- observed_aqi = extract_pmtwofive(observed_aqi)
65
+ observed_pm25 = extract_pmtwofive(observed_aqi)
66
66
 
67
67
  reply = "AQI for #{loc[:name]}, "
68
68
  # unless forecasted_aqi == []
69
69
  # reply += "Forecasted: #{(forecasted_aqi['ActionDay'] == 'true')? 'Action Day! ' : ''}#{forecasted_aqi['AQI']} #{forecasted_aqi['Category']['Name']} "
70
70
  # end
71
71
 
72
- banner_str = "(aqicn.org)"
72
+ banner_str = "(#{observed_aqi['data']['city']['url']})"
73
73
  if config.colors
74
74
  banner_str = "\x03#{colors[:grey]}#{banner_str}\x03"
75
75
  end
76
76
 
77
77
  unless observed_aqi == []
78
- reply += "Observed: #{color_str(observed_aqi)} #{banner_str}"
78
+ reply += "Observed PM25: #{color_str(observed_pm25)} #{banner_str}"
79
79
  end
80
80
  response.reply reply
81
81
  end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'lita-onewheel-aqi'
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 = 'AQI data retrieval bot'
@@ -1 +1,52 @@
1
- {"status":"ok","data":{"aqi":76,"idx":8371,"attributions":[{"url":"http://worldweather.wmo.int","name":"World Meteorological Organization - surface synoptic observations (WMO-SYNOP)"},{"url":"http://www.deq.state.or.us/","name":"Oregon Department of Environmental Quality (DEQ)"},{"url":"http://www.airnow.gov/","name":"Air Now - US EPA"}],"city":{"geo":[45.28845,-121.782775],"name":"Government Camp - Multorpor Visibility, Oregon","url":"http://aqicn.org/city/usa/oregon/government-camp-multorpor-visibility/"},"dominentpol":"pm25","iaqi":{"h":{"v":11},"p":{"v":1014},"pm10":{"v":40},"pm25":{"v":76},"t":{"v":34.65}},"time":{"s":"2017-08-11 15:00:00","tz":"-08:00","v":1502463600}}}
1
+ {
2
+ "status": "ok",
3
+ "data": {
4
+ "aqi": 76,
5
+ "idx": 8371,
6
+ "attributions": [
7
+ {
8
+ "url": "http://worldweather.wmo.int",
9
+ "name": "World Meteorological Organization - surface synoptic observations (WMO-SYNOP)"
10
+ },
11
+ {
12
+ "url": "http://www.deq.state.or.us/",
13
+ "name": "Oregon Department of Environmental Quality (DEQ)"
14
+ },
15
+ {
16
+ "url": "http://www.airnow.gov/",
17
+ "name": "Air Now - US EPA"
18
+ }
19
+ ],
20
+ "city": {
21
+ "geo": [
22
+ 45.28845,
23
+ -121.782775
24
+ ],
25
+ "name": "Government Camp - Multorpor Visibility, Oregon",
26
+ "url": "http://aqicn.org/city/usa/oregon/government-camp-multorpor-visibility/"
27
+ },
28
+ "dominentpol": "pm25",
29
+ "iaqi": {
30
+ "h": {
31
+ "v": 11
32
+ },
33
+ "p": {
34
+ "v": 1014
35
+ },
36
+ "pm10": {
37
+ "v": 40
38
+ },
39
+ "pm25": {
40
+ "v": 76
41
+ },
42
+ "t": {
43
+ "v": 34.65
44
+ }
45
+ },
46
+ "time": {
47
+ "s": "2017-08-11 15:00:00",
48
+ "tz": "-08:00",
49
+ "v": 1502463600
50
+ }
51
+ }
52
+ }
@@ -29,6 +29,6 @@ describe Lita::Handlers::OnewheelAqi, lita_handler: true do
29
29
 
30
30
  it 'queries the aqi' do
31
31
  send_command 'aqi'
32
- expect(replies.last).to include("AQI for Portland, OR, USA, Observed: \u00030876\u0003 \u000314(aqicn.org)\u0003")
32
+ expect(replies.last).to include("AQI for Portland, OR, USA, Observed PM25: \u00030876\u0003 \u000314(http://aqicn.org/city/usa/oregon/government-camp-multorpor-visibility/)\u0003")
33
33
  end
34
34
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita-onewheel-aqi
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
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-14 00:00:00.000000000 Z
11
+ date: 2017-08-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lita