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 +4 -4
- data/lib/lita/handlers/onewheel_aqi.rb +3 -3
- data/lita-onewheel-aqi.gemspec +1 -1
- data/spec/fixtures/Output.json +52 -1
- data/spec/lita/handlers/onewheel_aqi_spec.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1718ac9cefb5363670b2ae7372a4c724cbd4a775
|
4
|
+
data.tar.gz: b4c06144a240f7e331cffdee4c584566466954b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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 = "(
|
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(
|
78
|
+
reply += "Observed PM25: #{color_str(observed_pm25)} #{banner_str}"
|
79
79
|
end
|
80
80
|
response.reply reply
|
81
81
|
end
|
data/lita-onewheel-aqi.gemspec
CHANGED
data/spec/fixtures/Output.json
CHANGED
@@ -1 +1,52 @@
|
|
1
|
-
{
|
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.
|
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-
|
11
|
+
date: 2017-08-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lita
|