lita-onewheel-aqi 2.0.4 → 2.0.5
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 +4 -4
- data/lib/lita/handlers/onewheel_aqi.rb +14 -5
- data/lita-onewheel-aqi.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 57d0b0d01196082d5483222c21143c433d08d3a3
|
4
|
+
data.tar.gz: 47b86008c1b695c0aa5c913ff8ba857b61cdecf8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a971121123fe9fb7c11603f67125e97dd700fede206f5204e400ae7230dea2e153f39170c50a5438dc750c4ef268adfda5e6646e6d2321e41dc0be95d229e294
|
7
|
+
data.tar.gz: d1cf1b22aff4dc9a872188f91e1d5a1aac87f116d71eac4165eae2f8f48a62df65ddce2873ffb4d3e02ffdd0c8bfc1a2bea50f63578022df4aaa687b9ada5307
|
@@ -72,6 +72,15 @@ module Lita
|
|
72
72
|
301..500 => ':no_entry_sign: :radioactive_sign: :no_entry_sign:' }
|
73
73
|
end
|
74
74
|
|
75
|
+
def aqi_irc_emoji
|
76
|
+
{ 0..50 => '🌳',
|
77
|
+
51..100 => '⚠️',
|
78
|
+
101..150 => '🔶',
|
79
|
+
151..200 => '🚫',
|
80
|
+
201..300 => '☣️',
|
81
|
+
301..500 => '🚫☣🚫' }
|
82
|
+
end
|
83
|
+
|
75
84
|
def get_location(response)
|
76
85
|
location = if response.matches[0].to_s.casecmp('aqi').zero?
|
77
86
|
''
|
@@ -114,12 +123,12 @@ module Lita
|
|
114
123
|
reply += color_str_with_value(range_str: aqi_range_labels, range_value: aqi['data']['iaqi']['pm25']['v'].to_s)
|
115
124
|
end
|
116
125
|
|
117
|
-
if aqi['data']['iaqi']['pm10']
|
118
|
-
reply += 'pm10: ' + color_str(aqi['data']['iaqi']['pm10']['v'].to_s) + ' '
|
119
|
-
end
|
120
126
|
if aqi['data']['iaqi']['pm25']
|
121
127
|
reply += 'pm25: ' + color_str(aqi['data']['iaqi']['pm25']['v'].to_s) + ' '
|
122
128
|
end
|
129
|
+
if aqi['data']['iaqi']['pm10']
|
130
|
+
reply += 'pm10: ' + color_str(aqi['data']['iaqi']['pm10']['v'].to_s) + ' '
|
131
|
+
end
|
123
132
|
|
124
133
|
reply += banner_str
|
125
134
|
|
@@ -185,9 +194,9 @@ module Lita
|
|
185
194
|
if color_key.cover? range_value.to_i # Super secred cover sauce
|
186
195
|
color = colors[aqi_range_colors[color_key]]
|
187
196
|
if config.mode == :irc
|
188
|
-
str = "\x03#{color}#{range_str[color_key]}\x03 "
|
197
|
+
str = "#{aqi_irc_emoji[color_key]} \x03#{color}#{range_str[color_key]}\x03 #{aqi_irc_emoji[color_key]} "
|
189
198
|
elsif config.mode == :slack
|
190
|
-
str = "#{aqi_slack_emoji[color_key]} #{range_str[color_key]} #{aqi_slack_emoji[color_key]}
|
199
|
+
str = "#{aqi_slack_emoji[color_key]} #{range_str[color_key]} #{aqi_slack_emoji[color_key]} "
|
191
200
|
end
|
192
201
|
end
|
193
202
|
end
|
data/lita-onewheel-aqi.gemspec
CHANGED