Skip to content

Commit

Permalink
allow slightly shorter status message
Browse files Browse the repository at this point in the history
  • Loading branch information
ccutrer committed Jan 6, 2025
1 parent 83f3061 commit 873981d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
balboa_worldwide_app (2.1.7)
balboa_worldwide_app (2.1.8)
ccutrer-serialport (~> 1.0)
digest-crc (~> 0.4)
mqtt-homeassistant (~> 0.1, >= 0.1.5)
Expand All @@ -17,7 +17,7 @@ GEM
ffi (~> 1.9, >= 1.9.3)
digest-crc (0.6.5)
rake (>= 12.0.0, < 14.0.0)
ffi (1.17.0)
ffi (1.17.1-x86_64-linux-gnu)
homie-mqtt (1.6.3)
mqtt-ccutrer (~> 1.0, >= 1.0.3)
ruby2_keywords (~> 0.0.5)
Expand Down
4 changes: 2 additions & 2 deletions lib/bwa/message.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ def parse(data)
klass = @messages.find { |k| message_type == k::MESSAGE_TYPE }

if klass
valid_length = if klass::MESSAGE_LENGTH.respond_to?(:include?)
klass::MESSAGE_LENGTH.include?(length - 5)
valid_length = if klass::MESSAGE_LENGTH.respond_to?(:cover?)
klass::MESSAGE_LENGTH.cover?(length - 5)
else
length - 5 == klass::MESSAGE_LENGTH
end
Expand Down
2 changes: 1 addition & 1 deletion lib/bwa/messages/status.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Status < Message

MESSAGE_TYPE = "\xaf\x13".b
# additional features have been added in later versions
MESSAGE_LENGTH = (24..32).freeze
MESSAGE_LENGTH = (23..32).freeze

NOTIFICATIONS = {
0x00 => nil,
Expand Down
2 changes: 1 addition & 1 deletion lib/bwa/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module BWA
VERSION = "2.1.7"
VERSION = "2.1.8"
end

0 comments on commit 873981d

Please sign in to comment.