feat(multirs): add MultiRS device support#82
Merged
Conversation
The mypy linter was failing due to an incorrect attribute access on the BLEDevice object. This commit resolves the issue by: - Passing the full AdvertisementData object to the scanner callbacks. - Updating the Scanner class to use advertisement.rssi instead of device.rssi. - Aligning the callback signatures for all scanner subclasses.
aedabd5 to
f9f8475
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds support for Victron MultiRS devices to victron-ble.
Key changes include:
victron_ble/devices/multirs.pywithMultiRSDataandMultiRSclasses for parsing MultiRS BLE advertisement data.parse_datamethod, handling specific payload structure (<bbhHhhHH), decryption key (346c410e8c824dd723c0f5b13b9eabc8), and 'not available' values (0x7FFFfor signed shorts,0xFFFFfor unsigned shorts).victron_ble/devices/__init__.pyto enable detection of MultiRS devices (mode0xB).tests/test_multirs.pyto validate the parsing logic with known-good encrypted and decrypted data.CI/Linting Fixes
To address CI/linting failures, the following changes were made to
victron_ble/scanner.py:BaseScanner._detection_callbackmethod was updated to pass the fullAdvertisementDataobject to itscallbackmethod.Scanner.callbackmethod was modified to correctly access therssivalue from theAdvertisementDataobject, resolving amypytype error ("BLEDevice" has no attribute "rssi").DiscoveryScannerandDebugScannerwere updated to align with the newBaseScannercallback signature, ensuring consistency and resolvingflake8errors."