balboa_worldwide_app 2.3.2 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/exe/bwa_mqtt_bridge +2 -3
- data/lib/bwa/client.rb +11 -1
- data/lib/bwa/messages/set_time.rb +1 -1
- data/lib/bwa/messages/status.rb +3 -3
- data/lib/bwa/messages/toggle_item.rb +1 -1
- data/lib/bwa/proxy.rb +1 -1
- data/lib/bwa/version.rb +1 -1
- metadata +6 -62
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0c79f11e018c125a462bc0b165d153510ef1f05829f8e4737f0a9c6231b52d61
|
|
4
|
+
data.tar.gz: 2bca5ff0487eba5b461d22b846ccc1c846a4f8c26cddf2e3d00058c45bc57b41
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: eb21b8a9946b70363aa3695a3f409274df699f6293515c83446acfe1ba918f1530ed0ff44147a3be2544740384584f54c3ad2980e53d8ac18ea08382b4015017
|
|
7
|
+
data.tar.gz: 4fb56d86e85ba565968dc620867c54aa98316d69d86bebdeafa3708ff19b29908c2add08e75efc913d3f0e3189689c42002bf0cfda34d3009e2f4a709967b56b
|
data/exe/bwa_mqtt_bridge
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
# frozen_string_literal: true
|
|
3
3
|
|
|
4
4
|
require "sd_notify"
|
|
5
|
-
require "set"
|
|
6
5
|
require "json"
|
|
7
6
|
require "mqtt/homie/home_assistant"
|
|
8
7
|
|
|
@@ -25,7 +24,7 @@ class MQTTBridge
|
|
|
25
24
|
def initialize(mqtt_uri, bwa, device_id: "bwa", root_topic: "homie")
|
|
26
25
|
Thread.abort_on_exception = true
|
|
27
26
|
|
|
28
|
-
@homie = MQTT::Homie::Device.new(device_id, "BWA Link", mqtt: mqtt_uri, root_topic:
|
|
27
|
+
@homie = MQTT::Homie::Device.new(device_id, "BWA Link", mqtt: mqtt_uri, root_topic:)
|
|
29
28
|
@bwa = bwa
|
|
30
29
|
|
|
31
30
|
# spin until we have a full configuration
|
|
@@ -283,7 +282,7 @@ class MQTTBridge
|
|
|
283
282
|
hass: { binary_sensor: { device_class: :running, icon: "mdi:sync" } })
|
|
284
283
|
end
|
|
285
284
|
|
|
286
|
-
single_pump = @bwa.configuration.pumps.
|
|
285
|
+
single_pump = @bwa.configuration.pumps.one? { |speeds| !speeds.zero? }
|
|
287
286
|
@bwa.configuration.pumps.each_with_index do |speeds, i|
|
|
288
287
|
next if speeds.zero?
|
|
289
288
|
|
data/lib/bwa/client.rb
CHANGED
|
@@ -46,6 +46,16 @@ module BWA
|
|
|
46
46
|
port: uri.port || 23,
|
|
47
47
|
baud: 115_200)
|
|
48
48
|
@queue = []
|
|
49
|
+
when "esphome"
|
|
50
|
+
begin
|
|
51
|
+
gem "esphome", "~> 1.1"
|
|
52
|
+
require "esphome/serial_proxy"
|
|
53
|
+
rescue LoadError
|
|
54
|
+
warn "Please `gem install esphome ~> 1.1` before using an ESPHome serial proxy"
|
|
55
|
+
exit 1
|
|
56
|
+
end
|
|
57
|
+
@io = ESPHome::SerialProxy.open(uri, baud: 115_200, data_bits: 8, parity: :none, stop_bits: 1)
|
|
58
|
+
@queue = []
|
|
49
59
|
else
|
|
50
60
|
require "ccutrer-serialport"
|
|
51
61
|
@io = CCutrer::SerialPort.new(uri.path, baud: 115_200, data_bits: 8, parity: :none, stop_bits: 1)
|
|
@@ -64,7 +74,7 @@ module BWA
|
|
|
64
74
|
loop do
|
|
65
75
|
message, bytes_read = Message.parse(@buffer)
|
|
66
76
|
# discard how much we read
|
|
67
|
-
@buffer = @buffer[bytes_read
|
|
77
|
+
@buffer = @buffer[bytes_read..] if bytes_read
|
|
68
78
|
method = @io.respond_to?(:readpartial) ? :readpartial : :read
|
|
69
79
|
unless message
|
|
70
80
|
# one EOF is just serial ports saying they have no data;
|
|
@@ -26,7 +26,7 @@ module BWA
|
|
|
26
26
|
end
|
|
27
27
|
|
|
28
28
|
def inspect
|
|
29
|
-
"#<BWA::Messages::SetTime #{Status.format_time(hour, minute, twenty_four_hour_time:
|
|
29
|
+
"#<BWA::Messages::SetTime #{Status.format_time(hour, minute, twenty_four_hour_time:)}>"
|
|
30
30
|
end
|
|
31
31
|
end
|
|
32
32
|
end
|
data/lib/bwa/messages/status.rb
CHANGED
|
@@ -29,7 +29,7 @@ module BWA
|
|
|
29
29
|
|
|
30
30
|
MESSAGE_TYPE = "\xaf\x13".b
|
|
31
31
|
# additional features have been added in later versions
|
|
32
|
-
MESSAGE_LENGTH = (23..32)
|
|
32
|
+
MESSAGE_LENGTH = (23..32)
|
|
33
33
|
|
|
34
34
|
NOTIFICATIONS = {
|
|
35
35
|
0x00 => nil,
|
|
@@ -153,7 +153,7 @@ module BWA
|
|
|
153
153
|
data[2] = (current_temperature ? (current_temperature * 2).to_i : 0xff).chr
|
|
154
154
|
data[20] = (target_temperature * 2).to_i.chr
|
|
155
155
|
else
|
|
156
|
-
data[2] = (current_temperature
|
|
156
|
+
data[2] = (current_temperature&.to_i || 0xff).chr
|
|
157
157
|
data[20] = target_temperature.to_i.chr
|
|
158
158
|
end
|
|
159
159
|
|
|
@@ -191,7 +191,7 @@ module BWA
|
|
|
191
191
|
items << "hold" if hold
|
|
192
192
|
items << "priming" if priming
|
|
193
193
|
items << "notification=#{notification}" if notification
|
|
194
|
-
items << self.class.format_time(hour, minute, twenty_four_hour_time:
|
|
194
|
+
items << self.class.format_time(hour, minute, twenty_four_hour_time:)
|
|
195
195
|
items << "#{current_temperature || "--"}/#{target_temperature}°#{temperature_scale.to_s[0].upcase}"
|
|
196
196
|
items << "filter_cycles=#{filter_cycles.inspect}"
|
|
197
197
|
items << heating_mode
|
|
@@ -37,7 +37,7 @@ module BWA
|
|
|
37
37
|
return true if BWA.verbosity >= 2
|
|
38
38
|
# dunno why we receive this, but somebody is spamming the bus
|
|
39
39
|
# trying to toggle an item we don't know
|
|
40
|
-
return false if item == 0 # rubocop:disable Style/NumericPredicate could be a symbol
|
|
40
|
+
return false if item == 0 # rubocop:disable Style/NumericPredicate -- could be a symbol
|
|
41
41
|
|
|
42
42
|
true
|
|
43
43
|
end
|
data/lib/bwa/proxy.rb
CHANGED
|
@@ -41,7 +41,7 @@ module BWA
|
|
|
41
41
|
end
|
|
42
42
|
data_length = leftover_data[1].ord
|
|
43
43
|
data = leftover_data[0...(data_length + 2)]
|
|
44
|
-
leftover_data = leftover_data[(data_length + 2)
|
|
44
|
+
leftover_data = leftover_data[(data_length + 2)..] || ""
|
|
45
45
|
begin
|
|
46
46
|
message = Message.parse(data)
|
|
47
47
|
BWA.logger.info "#{tag}: #{message.inspect}"
|
data/lib/bwa/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: balboa_worldwide_app
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.4.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Cody Cutrer
|
|
8
8
|
bindir: exe
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date:
|
|
10
|
+
date: 2026-07-26 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: ccutrer-serialport
|
|
@@ -99,63 +99,7 @@ dependencies:
|
|
|
99
99
|
- - "~>"
|
|
100
100
|
- !ruby/object:Gem::Version
|
|
101
101
|
version: 0.1.1
|
|
102
|
-
|
|
103
|
-
name: byebug
|
|
104
|
-
requirement: !ruby/object:Gem::Requirement
|
|
105
|
-
requirements:
|
|
106
|
-
- - "~>"
|
|
107
|
-
- !ruby/object:Gem::Version
|
|
108
|
-
version: '11.0'
|
|
109
|
-
type: :development
|
|
110
|
-
prerelease: false
|
|
111
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
112
|
-
requirements:
|
|
113
|
-
- - "~>"
|
|
114
|
-
- !ruby/object:Gem::Version
|
|
115
|
-
version: '11.0'
|
|
116
|
-
- !ruby/object:Gem::Dependency
|
|
117
|
-
name: rake
|
|
118
|
-
requirement: !ruby/object:Gem::Requirement
|
|
119
|
-
requirements:
|
|
120
|
-
- - "~>"
|
|
121
|
-
- !ruby/object:Gem::Version
|
|
122
|
-
version: '13.0'
|
|
123
|
-
type: :development
|
|
124
|
-
prerelease: false
|
|
125
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
126
|
-
requirements:
|
|
127
|
-
- - "~>"
|
|
128
|
-
- !ruby/object:Gem::Version
|
|
129
|
-
version: '13.0'
|
|
130
|
-
- !ruby/object:Gem::Dependency
|
|
131
|
-
name: rubocop-inst
|
|
132
|
-
requirement: !ruby/object:Gem::Requirement
|
|
133
|
-
requirements:
|
|
134
|
-
- - "~>"
|
|
135
|
-
- !ruby/object:Gem::Version
|
|
136
|
-
version: '1'
|
|
137
|
-
type: :development
|
|
138
|
-
prerelease: false
|
|
139
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
140
|
-
requirements:
|
|
141
|
-
- - "~>"
|
|
142
|
-
- !ruby/object:Gem::Version
|
|
143
|
-
version: '1'
|
|
144
|
-
- !ruby/object:Gem::Dependency
|
|
145
|
-
name: rubocop-rake
|
|
146
|
-
requirement: !ruby/object:Gem::Requirement
|
|
147
|
-
requirements:
|
|
148
|
-
- - "~>"
|
|
149
|
-
- !ruby/object:Gem::Version
|
|
150
|
-
version: '0.6'
|
|
151
|
-
type: :development
|
|
152
|
-
prerelease: false
|
|
153
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
154
|
-
requirements:
|
|
155
|
-
- - "~>"
|
|
156
|
-
- !ruby/object:Gem::Version
|
|
157
|
-
version: '0.6'
|
|
158
|
-
email: cody@cutrer.com'
|
|
102
|
+
email: cody@cutrer.us
|
|
159
103
|
executables:
|
|
160
104
|
- bwa_client
|
|
161
105
|
- bwa_mqtt_bridge
|
|
@@ -191,7 +135,7 @@ files:
|
|
|
191
135
|
- lib/bwa/proxy.rb
|
|
192
136
|
- lib/bwa/server.rb
|
|
193
137
|
- lib/bwa/version.rb
|
|
194
|
-
homepage: https://github.com/ccutrer/
|
|
138
|
+
homepage: https://github.com/ccutrer/balboa_worldwide_app
|
|
195
139
|
licenses:
|
|
196
140
|
- MIT
|
|
197
141
|
metadata:
|
|
@@ -203,14 +147,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
203
147
|
requirements:
|
|
204
148
|
- - ">="
|
|
205
149
|
- !ruby/object:Gem::Version
|
|
206
|
-
version: '2
|
|
150
|
+
version: '3.2'
|
|
207
151
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
208
152
|
requirements:
|
|
209
153
|
- - ">="
|
|
210
154
|
- !ruby/object:Gem::Version
|
|
211
155
|
version: '0'
|
|
212
156
|
requirements: []
|
|
213
|
-
rubygems_version: 3.6.
|
|
157
|
+
rubygems_version: 3.6.2
|
|
214
158
|
specification_version: 4
|
|
215
159
|
summary: Library for communication with Balboa Water Group's WiFi module or RS-485
|
|
216
160
|
test_files: []
|