balboa_worldwide_app 2.0.3 → 2.0.7

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: 3fca5333c7db064572f3179a76f34ae4be4915fe54e6d00d7e1ba3ac018b2faa
4
- data.tar.gz: 4e8bb6e201feb560bdff1424802d38ce38993f91bb9adb741f629590a7e5fa87
3
+ metadata.gz: 4f47a4fef9d14e31269c10174f40b6074a78df20acf3e2943ec6915cdad9747b
4
+ data.tar.gz: ba44d2d0026e8ccab28a5831c4ee6b88c23c14f02de5c6c54b4665f6e7f3b831
5
5
  SHA512:
6
- metadata.gz: 402069abd87db291867298dc70fa9180944972965d3456f4ea99bc44c55a56472fc2592f51edcd3a67c55e9e22b9bfdb184b7f9de6105834128d40c457ea4647
7
- data.tar.gz: 74e2a3ac63a6e90ceb82dcc97139a30572e62c980420c66b7dac3c156668ddcec999be06b8414958a67fde084af4c6ea9d6312f261d3c36a4569378d7c779f49
6
+ metadata.gz: b07aa98141a94f5f53cf7ba797b6e29554de4e6d6704dba9dbabe1b2e683af16753a1aac297f0cac2c093694faf109a6b08cd967f5accca3432c15e3b4e4df8d
7
+ data.tar.gz: c20a3bf9a5da5adc70a79f9d3c1be001ca5fbee6d62755b994c08611c445f27591b7e1d86e44e8d4ddbbafa11600b165c64cc21d82b604f6f4f4b4126865be22
data/exe/bwa_mqtt_bridge CHANGED
@@ -139,6 +139,8 @@ class MQTTBridge
139
139
  end
140
140
  allow_toggle_or_speed = lambda do |value|
141
141
  next value if value == "toggle"
142
+ next true if value == "true"
143
+ next false if value == "false"
142
144
 
143
145
  value.to_i if value.match?(/^\d+$/)
144
146
  end
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,8 +166,11 @@ module BWA
160
166
  return unless status && configuration
161
167
 
162
168
  desired = 0 if desired == false
163
- desired = 1 if desired == true
164
- times = (desired - status.pumps[index]) % (configuration.pumps[index] + 1)
169
+ max_pump_speed = configuration.pumps[index]
170
+ desired = max_pump_speed if desired == true
171
+ desired = [desired, max_pump_speed].min
172
+ current_pump_speed = [status.pumps[index], max_pump_speed].min
173
+ times = (desired - current_pump_speed) % (max_pump_speed + 1)
165
174
  times.times do
166
175
  toggle_pump(index)
167
176
  sleep(0.1)
@@ -191,7 +200,8 @@ module BWA
191
200
  return unless status && configuration
192
201
 
193
202
  desired = 0 if desired == false
194
- desired = 1 if desired == true
203
+ desired = configuration.blower if desired == true
204
+ desired = [desired, configuration.blower].min
195
205
  times = (desired - status.blower) % (configuration.blower + 1)
196
206
  times.times do
197
207
  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.3"
4
+ VERSION = "2.0.7"
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.3
4
+ version: 2.0.7
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-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ccutrer-serialport