balboa_worldwide_app 2.1.3 → 2.1.5

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: b1b565e8ea9c2ff56e086777b75f0678440c67a045cec5a5677458dc5686545b
4
- data.tar.gz: 8003b1fe9a607b5b03cbdf22b69591e78fbfb86c29c826744b19a3a09dea5d25
3
+ metadata.gz: 9291a65b48f5bfa7f66ccb5d84723a788227feb4ad5749ecaa712b4a42b2a21d
4
+ data.tar.gz: 4f384f1b892663b5925adca3f2b9945dcfbaf776ed8f5fe944daebba5bd67a4c
5
5
  SHA512:
6
- metadata.gz: fb74d4743d735f663e945f8070bda4b71ac49311b2462c273d933d91ca2a186ad2f0a0ff735c26ba548ac438427eb08a531ed67fddd0c9cc48ae530e81fda199
7
- data.tar.gz: 5c84e5f528eaf1c248dc007bee5c44baafe6a659f270040a3aed9b3f6514ece48c9f252c28723187c2a09e96dd092121e3796e926da5a5fe154d26050ccc10b1
6
+ metadata.gz: 1bc17d4129c715c783b3f9f6374807458d8d970c0cf5e9cf5609190411ac3d0362d17eeeaaf20a78d3eee519d4754299777c35950c20381db90f8890418235cf
7
+ data.tar.gz: 25f1d5f39fb8eb34456107d607e25126ccf77763bc007ee8da8ed180115cef92035aa4f62654cbbff6a18e7880f87548f2125542899ec1f09158bfe22e01fe43
data/exe/bwa_mqtt_bridge CHANGED
@@ -115,7 +115,7 @@ class MQTTBridge
115
115
  next if speeds.zero?
116
116
 
117
117
  property = @homie["spa"]["pump#{i + 1}"]
118
- property.value = speeds == 1 ? @bwa.pumps[i] != 0 : @bwa.pumps[i]
118
+ property.value = (speeds == 1) ? @bwa.pumps[i] != 0 : @bwa.pumps[i]
119
119
  end
120
120
  @bwa.configuration.lights.each_with_index do |exists, i|
121
121
  next unless exists
@@ -172,7 +172,10 @@ class MQTTBridge
172
172
  @bwa.hold = value
173
173
  end
174
174
  spa.property("priming", "Priming", :boolean, @bwa.priming, hass: { binary_sensor: { icon: "mdi:fast-forward" } })
175
- spa.property("notification", "Notification", :enum, @bwa.notification || "none",
175
+ spa.property("notification",
176
+ "Notification",
177
+ :enum,
178
+ @bwa.notification || "none",
176
179
  format: BWA::Messages::Status::NOTIFICATIONS.values.compact + ["none"])
177
180
  spa.property("heating-mode",
178
181
  "Heating Mode",
data/lib/bwa/client.rb CHANGED
@@ -42,7 +42,9 @@ module BWA
42
42
  @io = TCPSocket.new(uri.host, uri.port || 4257)
43
43
  when "telnet", "rfc2217"
44
44
  require "net/telnet/rfc2217"
45
- @io = Net::Telnet::RFC2217.new("Host" => uri.host, "Port" => uri.port || 23, "baud" => 115_200)
45
+ @io = Net::Telnet::RFC2217.new(uri.host,
46
+ port: uri.port || 23,
47
+ baud: 115_200)
46
48
  @queue = []
47
49
  else
48
50
  require "ccutrer-serialport"
@@ -168,12 +170,12 @@ module BWA
168
170
 
169
171
  desired = 0 if desired == false
170
172
  max_pump_speed = configuration.pumps[index]
173
+ desired = max_pump_speed if desired == true
174
+ desired = [desired, max_pump_speed].min
171
175
 
172
176
  # turn all pumps off with a single command
173
177
  return toggle_item(:soak) if desired.zero? && configuration.pumps.length == 1 && max_pump_speed != 1
174
178
 
175
- desired = max_pump_speed if desired == true
176
- desired = [desired, max_pump_speed].min
177
179
  current_pump_speed = [status.pumps[index], max_pump_speed].min
178
180
  times = (desired - current_pump_speed) % (max_pump_speed + 1)
179
181
  times.times do |i|
data/lib/bwa/message.rb CHANGED
@@ -64,7 +64,7 @@ module BWA
64
64
  BWA.logger.debug "discarding invalid data prior to message #{BWA.raw2str(data[0...offset])}" unless offset.zero?
65
65
 
66
66
  src = data[offset + 2].ord
67
- klass = @messages.find { |k| k::MESSAGE_TYPE == message_type }
67
+ klass = @messages.find { |k| message_type == k::MESSAGE_TYPE }
68
68
 
69
69
  if klass
70
70
  valid_length = if klass::MESSAGE_LENGTH.respond_to?(:include?)
@@ -102,7 +102,7 @@ module BWA
102
102
  else
103
103
  print_hour = hour % 12
104
104
  print_hour = 12 if print_hour.zero?
105
- format("%d:%02d%s", print_hour, minute, hour >= 12 ? "PM" : "AM")
105
+ format("%d:%02d%s", print_hour, minute, (hour >= 12) ? "PM" : "AM")
106
106
  end
107
107
  end
108
108
 
@@ -3,8 +3,13 @@
3
3
  module BWA
4
4
  module Messages
5
5
  class FilterCycles < Message
6
- attr_accessor :cycle1_start_hour, :cycle1_start_minute, :cycle1_duration,
7
- :cycle2_enabled, :cycle2_start_hour, :cycle2_start_minute, :cycle2_duration
6
+ attr_accessor :cycle1_start_hour,
7
+ :cycle1_start_minute,
8
+ :cycle1_duration,
9
+ :cycle2_enabled,
10
+ :cycle2_start_hour,
11
+ :cycle2_start_minute,
12
+ :cycle2_duration
8
13
  alias_method :cycle2_enabled?, :cycle2_enabled
9
14
 
10
15
  MESSAGE_TYPE = "\xbf\x23".b
@@ -19,7 +19,7 @@ module BWA
19
19
 
20
20
  def serialize
21
21
  data = +"\x01\x00"
22
- data[1] = (scale == :fahrenheit ? 0x00 : 0x01).chr
22
+ data[1] = ((scale == :fahrenheit) ? 0x00 : 0x01).chr
23
23
  super(data)
24
24
  end
25
25
 
@@ -11,7 +11,8 @@ module BWA
11
11
  :filter_cycles,
12
12
  :heating,
13
13
  :temperature_range,
14
- :hour, :minute,
14
+ :hour,
15
+ :minute,
15
16
  :circulation_pump,
16
17
  :blower,
17
18
  :pumps,
data/lib/bwa/server.rb CHANGED
@@ -43,7 +43,7 @@ module BWA
43
43
  when Messages::ConfigurationRequest
44
44
  send_configuration(socket)
45
45
  when Messages::ControlConfigurationRequest
46
- message.type == 1 ? send_control_configuration(socket) : send_control_configuration2(socket)
46
+ (message.type == 1) ? send_control_configuration(socket) : send_control_configuration2(socket)
47
47
  when Messages::SetTargetTemperature
48
48
  temperature = message.temperature
49
49
  temperature /= 2.0 if @status.temperature_scale == :celsius
@@ -53,9 +53,9 @@ module BWA
53
53
  when Messages::ToggleItem
54
54
  case message.item
55
55
  when :heating_mode
56
- @status.heating_mode = (@status.heating_mode == :rest ? :ready : :rest)
56
+ @status.heating_mode = ((@status.heating_mode == :rest) ? :ready : :rest)
57
57
  when :temperature_range
58
- @status.temperature_range = (@status.temperature_range == :low ? :high : :low)
58
+ @status.temperature_range = ((@status.temperature_range == :low) ? :high : :low)
59
59
  when :pump1
60
60
  @status.pump1 = (@status.pump1 + 1) % 3
61
61
  when :pump2
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.1.3"
4
+ VERSION = "2.1.5"
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.1.3
4
+ version: 2.1.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: 2022-12-19 00:00:00.000000000 Z
11
+ date: 2023-08-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ccutrer-serialport
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 1.0.0
19
+ version: '1.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 1.0.0
26
+ version: '1.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: digest-crc
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -47,7 +47,7 @@ dependencies:
47
47
  version: '0.1'
48
48
  - - ">="
49
49
  - !ruby/object:Gem::Version
50
- version: 0.1.3
50
+ version: 0.1.5
51
51
  type: :runtime
52
52
  prerelease: false
53
53
  version_requirements: !ruby/object:Gem::Requirement
@@ -57,21 +57,21 @@ dependencies:
57
57
  version: '0.1'
58
58
  - - ">="
59
59
  - !ruby/object:Gem::Version
60
- version: 0.1.3
60
+ version: 0.1.5
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: net-telnet-rfc2217
63
63
  requirement: !ruby/object:Gem::Requirement
64
64
  requirements:
65
65
  - - "~>"
66
66
  - !ruby/object:Gem::Version
67
- version: 0.0.3
67
+ version: '1.0'
68
68
  type: :runtime
69
69
  prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
72
  - - "~>"
73
73
  - !ruby/object:Gem::Version
74
- version: 0.0.3
74
+ version: '1.0'
75
75
  - !ruby/object:Gem::Dependency
76
76
  name: sd_notify
77
77
  requirement: !ruby/object:Gem::Requirement
@@ -115,33 +115,19 @@ dependencies:
115
115
  - !ruby/object:Gem::Version
116
116
  version: '13.0'
117
117
  - !ruby/object:Gem::Dependency
118
- name: rubocop
118
+ name: rubocop-inst
119
119
  requirement: !ruby/object:Gem::Requirement
120
120
  requirements:
121
121
  - - "~>"
122
122
  - !ruby/object:Gem::Version
123
- version: '1.23'
123
+ version: '1'
124
124
  type: :development
125
125
  prerelease: false
126
126
  version_requirements: !ruby/object:Gem::Requirement
127
127
  requirements:
128
128
  - - "~>"
129
129
  - !ruby/object:Gem::Version
130
- version: '1.23'
131
- - !ruby/object:Gem::Dependency
132
- name: rubocop-performance
133
- requirement: !ruby/object:Gem::Requirement
134
- requirements:
135
- - - "~>"
136
- - !ruby/object:Gem::Version
137
- version: '1.12'
138
- type: :development
139
- prerelease: false
140
- version_requirements: !ruby/object:Gem::Requirement
141
- requirements:
142
- - - "~>"
143
- - !ruby/object:Gem::Version
144
- version: '1.12'
130
+ version: '1'
145
131
  - !ruby/object:Gem::Dependency
146
132
  name: rubocop-rake
147
133
  requirement: !ruby/object:Gem::Requirement
@@ -213,7 +199,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
213
199
  - !ruby/object:Gem::Version
214
200
  version: '0'
215
201
  requirements: []
216
- rubygems_version: 3.3.5
202
+ rubygems_version: 3.3.7
217
203
  signing_key:
218
204
  specification_version: 4
219
205
  summary: Library for communication with Balboa Water Group's WiFi module or RS-485