Skip to content

feat(multirs): add MultiRS device support#82

Merged
keshavdv merged 3 commits into
keshavdv:mainfrom
kotyara75:feature/multirs-support
Nov 13, 2025
Merged

feat(multirs): add MultiRS device support#82
keshavdv merged 3 commits into
keshavdv:mainfrom
kotyara75:feature/multirs-support

Conversation

@kotyara75
Copy link
Copy Markdown
Contributor

@kotyara75 kotyara75 commented Nov 9, 2025

This PR adds support for Victron MultiRS devices to victron-ble.

Key changes include:

  • Creation of victron_ble/devices/multirs.py with MultiRSData and MultiRS classes for parsing MultiRS BLE advertisement data.
  • Implementation of the parse_data method, handling specific payload structure (<bbhHhhHH), decryption key (346c410e8c824dd723c0f5b13b9eabc8), and 'not available' values (0x7FFF for signed shorts, 0xFFFF for unsigned shorts).
  • Update to victron_ble/devices/__init__.py to enable detection of MultiRS devices (mode 0xB).
  • Addition of comprehensive unit tests in tests/test_multirs.py to 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:

  • The BaseScanner._detection_callback method was updated to pass the full AdvertisementData object to its callback method.
  • The Scanner.callback method was modified to correctly access the rssi value from the AdvertisementData object, resolving a mypy type error ("BLEDevice" has no attribute "rssi").
  • The callback signatures for DiscoveryScanner and DebugScanner were updated to align with the new BaseScanner callback signature, ensuring consistency and resolving flake8 errors."

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.
@kotyara75 kotyara75 force-pushed the feature/multirs-support branch from aedabd5 to f9f8475 Compare November 12, 2025 11:01
@keshavdv keshavdv merged commit 6595cac into keshavdv:main Nov 13, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants