lita-onewheel-aqi 2.0.1 → 2.0.2

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: e5527a6a65d040cbd279459a0768c2a88debe829
4
- data.tar.gz: 544ffa8cde8634ffdaa6f7133e5f188e33849cc0
3
+ metadata.gz: 9c5165a40a4ebb7f15ccbf1a61b59df5133db641
4
+ data.tar.gz: 8ca0e6aa63c63bbf96b00a903cd5c916fe577196
5
5
  SHA512:
6
- metadata.gz: 2283e010abe536e7b2c47fd0f7abcf946a37b97ca2204c0fb588eb0ea97626e6feca36314e0164869f34a085b423f7ff60d18d07254bc0aa80e72b0837e03187
7
- data.tar.gz: 0ff189721d4d8d1e14408f2dc802ff73b4c67b0a22a55c7e4bbeaf10eb82fd7c5c3613639de59a601c207aae3034de13adcec4ae47209cdee05dc1a74e6f657d
6
+ metadata.gz: 2973472272b235454fb418a3b8e1576104064e77a8dfa4f39aefc16b2863ba39c5accc09a813129609396d4288821e178fd05856d8f98bdedb55c625e0f453d2
7
+ data.tar.gz: 930de566af10c2ab5b0b587ff8c0cc0b82a5d3503bc48211509a8ba5c43d3b6e0eab5fe41929479688c007938eb1a5808d601787abbe6907866b1d258d50d36d
@@ -109,9 +109,11 @@ module Lita
109
109
  if config.mode == :irc
110
110
  reply += color_str_with_value(range_str: aqi_range_labels, range_value: aqi['data']['iaqi']['pm25']['v'].to_s)
111
111
  banner_str = "\x03#{colors[:grey]}#{banner_str}\x03"
112
+ elsif config.mode == :slack
113
+ reply += color_str_with_value(range_str: aqi_range_labels, range_value: aqi['data']['iaqi']['pm25']['v'].to_s)
114
+ banner_str = "\x03#{colors[:grey]}#{banner_str}\x03"
112
115
  end
113
116
 
114
-
115
117
  if aqi['data']['iaqi']['pm10']
116
118
  reply += 'pm10: ' + color_str(aqi['data']['iaqi']['pm10']['v'].to_s) + ' '
117
119
  end
@@ -133,6 +135,7 @@ module Lita
133
135
  banner_str = "(#{aqi['data']['city']['url']})"
134
136
 
135
137
  if config.mode == :irc
138
+ reply += color_str_with_value(range_str: aqi_range_labels, range_value: aqi['data']['iaqi']['pm25']['v'].to_s)
136
139
  banner_str = "\x03#{colors[:grey]}#{banner_str}\x03"
137
140
  end
138
141
 
@@ -160,13 +163,13 @@ module Lita
160
163
  end
161
164
 
162
165
  def color_str(str, value = nil)
163
- if config.mode == :irc
164
- if value.nil?
165
- value = str.to_i
166
- end
166
+ if value.nil?
167
+ value = str.to_i
168
+ end
167
169
 
168
- aqi_range_colors.keys.each do |color_key|
169
- if color_key.cover? value # Super secred cover sauce
170
+ aqi_range_colors.keys.each do |color_key|
171
+ if color_key.cover? value # Super secred cover sauce
172
+ if config.mode == :irc
170
173
  color = colors[aqi_range_colors[color_key]]
171
174
  str = "\x03#{color}#{str}\x03"
172
175
  end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'lita-onewheel-aqi'
3
- spec.version = '2.0.1'
3
+ spec.version = '2.0.2'
4
4
  spec.authors = ['Andrew Kreps']
5
5
  spec.email = ['andrew.kreps@gmail.com']
6
6
  spec.description = 'AQI data retrieval bot'
@@ -36,6 +36,6 @@ describe Lita::Handlers::OnewheelAqi, lita_handler: true do
36
36
 
37
37
  it 'queries the aqideets' do
38
38
  send_command 'aqideets'
39
- expect(replies.last).to eq("AQI for Portland, OR, USA, \u00030Moderate\u0003 humidity: 11% pressure: 1014mb pm10: \u00030340\u0003 pm25: \u00030876\u0003 temp: 34.65C \u000314(http://aqicn.org/city/usa/oregon/government-camp-multorpor-visibility/)\u0003")
39
+ expect(replies.last).to eq("AQI for Portland, OR, USA, \u000308Moderate\u0003 humidity: 11% pressure: 1014mb pm10: \u00030340\u0003 pm25: \u00030876\u0003 temp: 34.65C \u000314(http://aqicn.org/city/usa/oregon/government-camp-multorpor-visibility/)\u0003")
40
40
  end
41
41
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita-onewheel-aqi
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kreps