balboa_worldwide_app 2.0.2 → 2.0.6

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
  SHA256:
3
- metadata.gz: '0291c14ad60589f11fdeffee50a92741cad4b43bf0f8ea84f7fe08f23d7e0182'
4
- data.tar.gz: b9ece98fd0e7b52130e67e633bbd06cc8cb9638fac0a4b9d19b213312c20a351
3
+ metadata.gz: f98b3b4e56ddb3c9616fec737a7ae9df0af3cf6d0878b71fa290d72f8e12d8a6
4
+ data.tar.gz: c96c5fc591aeb27859b25107771bf05e2e03bb1a4492433bc8a47769930ea455
5
5
  SHA512:
6
- metadata.gz: 2f8342fe70025de40baa56a8a9b030cbec20a891ec7a4aaadb3ea3107b8d7b40441b840ad85333db043ccee752e4994f4dc8bdc2c4874e8ae31e1a05ca2cda5e
7
- data.tar.gz: '057971154699cd8a293928119368c5a54862720315cc99e2c5f621f515caa6da6c58ff9627a3e4f22b33ca06cb28a8b8af85799dc72e8087762ac85de04854f4'
6
+ metadata.gz: dad20a7cf67d11e97f4fae5d1679fc8309e5e8d9974b03c05bc451d702496bdf3771d0a47e6316eedff63e27db8476820bb4624e60c3f9f6cbc95fabf85fa580
7
+ data.tar.gz: ec482f620eb4ae5ce138b12e8f03de615616d024394f24ceec4243ef301e0f194c3a0d684fb5db954fd18313a254536e9fd45a67a81eb25a72ef1b7987bdfff2
data/exe/bwa_mqtt_bridge CHANGED
@@ -137,6 +137,13 @@ class MQTTBridge
137
137
  allow_toggle = lambda do |value|
138
138
  next value if value == "toggle"
139
139
  end
140
+ allow_toggle_or_speed = lambda do |value|
141
+ next value if value == "toggle"
142
+ next true if value == "true"
143
+ next false if value == "false"
144
+
145
+ value.to_i if value.match?(/^\d+$/)
146
+ end
140
147
 
141
148
  @homie.node("spa", "Hot Tub", @bwa.model) do |spa|
142
149
  spa.property("hold",
@@ -216,7 +223,7 @@ class MQTTBridge
216
223
  spa.property("blower",
217
224
  "Blower",
218
225
  *args,
219
- non_standard_value_check: allow_toggle,
226
+ non_standard_value_check: allow_toggle_or_speed,
220
227
  **kwargs) do |value|
221
228
  next @bwa.toggle_blower if value == "toggle"
222
229
 
@@ -261,7 +268,7 @@ class MQTTBridge
261
268
  spa.property("pump#{i + 1}",
262
269
  name,
263
270
  *args,
264
- non_standard_value_check: allow_toggle,
271
+ non_standard_value_check: allow_toggle_or_speed,
265
272
  **kwargs) do |value|
266
273
  next @bwa.toggle_pump(i) if value == "toggle"
267
274
 
data/lib/bwa/client.rb CHANGED
@@ -64,9 +64,15 @@ module BWA
64
64
  @buffer = @buffer[bytes_read..-1] if bytes_read
65
65
  method = @io.respond_to?(:readpartial) ? :readpartial : :read
66
66
  unless message
67
+ # one EOF is just serial ports saying they have no data;
68
+ # several EOFs in a row is the file is dead and gone
69
+ eofs = 0
67
70
  begin
68
71
  @buffer.concat(@io.__send__(method, 64 * 1024))
69
72
  rescue EOFError
73
+ eofs += 1
74
+ raise if eofs == 5
75
+
70
76
  @io.wait_readable
71
77
  retry
72
78
  end
@@ -160,7 +166,8 @@ module BWA
160
166
  return unless status && configuration
161
167
 
162
168
  desired = 0 if desired == false
163
- desired = 1 if desired == true
169
+ desired = configuration.pumps[index] if desired == true
170
+ desired = [desired, configuration.pumps[index]].min
164
171
  times = (desired - status.pumps[index]) % (configuration.pumps[index] + 1)
165
172
  times.times do
166
173
  toggle_pump(index)
@@ -191,7 +198,8 @@ module BWA
191
198
  return unless status && configuration
192
199
 
193
200
  desired = 0 if desired == false
194
- desired = 1 if desired == true
201
+ desired = configuration.blower if desired == true
202
+ desired = [desired, configuration.blower].min
195
203
  times = (desired - status.blower) % (configuration.blower + 1)
196
204
  times.times do
197
205
  toggle_blower
data/lib/bwa/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BWA
4
- VERSION = "2.0.2"
4
+ VERSION = "2.0.6"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: balboa_worldwide_app
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.0.6
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-12 00:00:00.000000000 Z
11
+ date: 2022-01-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ccutrer-serialport