purpleair 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/exe/purpleair_mqtt_bridge +13 -11
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2143ce19877835c3d83b337743675af5c194910ca865d1aaacaf9bfe21ee7b29
4
- data.tar.gz: 1bd57fc1dace7670e0693d6cce7c0d1098a9b878ebf83401f4e04fa82cb804b6
3
+ metadata.gz: 9f3d6dee601c1c13ccff9f49ca964e081b3f40b24851b3c2cabaa0f4224cf941
4
+ data.tar.gz: 99284c1bd6bdb66c21fb8acd241682d19fdacbbd6b790aa05cf104d9baafd770
5
5
  SHA512:
6
- metadata.gz: 3c0140b849c7f2180ed406d46b8142e69bce2425c0acf8e37a7543adc882b2ee23f6f66a852081bf86f28e85dd778fc4a99e2ce3f50c51cd825ef6e5559c0906
7
- data.tar.gz: cdd9d8987c19cdb3734dec4514333169efb34e38bf8a0d1d1c7a9f585d3cb1ab435acf369606469d25afdcb8d9e93e17e7a37e9d689ae8247a4c0622cdb3bfeb
6
+ metadata.gz: d587ef13d5d78fb56130facb45244e3d90d0e08b086dbafd6365470ed223d7ab65dd0876bba095396278342ac44f9af8ff49d34d827888a07504a21295fb657a
7
+ data.tar.gz: d37580e242f2726a0b42f76c83266f8c845993aed0c3b24ab8d64fe7b7bea0dfd852d4423161fd408d608508f2e6ef8631b705eae864314865263b046bd19b7f
@@ -178,17 +178,19 @@ homie.publish
178
178
 
179
179
  loop do
180
180
  data = purple.get.body
181
- device["temperature"].value = data["current_temp_f"]
182
- device["relative-humidity"].value = data["current_humidity"]
183
- device["dewpoint"].value = data["current_dewpoint_f"]
184
- device["pressure"].value = data["pressure"]
185
- device["rssi"].value = data["rssi"]
186
-
187
- CHANNELS.each do |channel_id|
188
- fields = get_fields(data, channel_id)
189
- channel = homie[channel_id]
190
- FIELDS.each do |field|
191
- channel[field.gsub(/[._]/, "-")].value = fields[field]
181
+ homie.mqtt.batch_publish do
182
+ device["temperature"].value = data["current_temp_f"]
183
+ device["relative-humidity"].value = data["current_humidity"]
184
+ device["dewpoint"].value = data["current_dewpoint_f"]
185
+ device["pressure"].value = data["pressure"]
186
+ device["rssi"].value = data["rssi"]
187
+
188
+ CHANNELS.each do |channel_id|
189
+ fields = get_fields(data, channel_id)
190
+ channel = homie[channel_id]
191
+ FIELDS.each do |field|
192
+ channel[field.gsub(/[._]/, "-")].value = fields[field]
193
+ end
192
194
  end
193
195
  end
194
196
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: purpleair
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cody Cutrer
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-12-14 00:00:00.000000000 Z
11
+ date: 2022-02-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday_middleware