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 +4 -4
- data/exe/bwa_mqtt_bridge +9 -2
- data/lib/bwa/client.rb +10 -2
- data/lib/bwa/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f98b3b4e56ddb3c9616fec737a7ae9df0af3cf6d0878b71fa290d72f8e12d8a6
|
4
|
+
data.tar.gz: c96c5fc591aeb27859b25107771bf05e2e03bb1a4492433bc8a47769930ea455
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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:
|
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:
|
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 =
|
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 =
|
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
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.
|
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:
|
11
|
+
date: 2022-01-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ccutrer-serialport
|