Skip to content

fix elgris#3215

Merged
LKuemmel merged 1 commit intoopenWB:masterfrom
LKuemmel:fix-sdm
Mar 17, 2026
Merged

fix elgris#3215
LKuemmel merged 1 commit intoopenWB:masterfrom
LKuemmel:fix-sdm

Conversation

@LKuemmel
Copy link
Contributor

No description provided.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes Elgris device integration by aligning Modbus connection handling with the device-level updater and ensuring the Elgris SDM subclass has required runtime state, plus adds basic unit coverage for the Elgris components.

Changes:

  • Remove per-component with tcp_client: blocks so Modbus context is managed once in the device updater.
  • Initialize fast_mode on the Elgris SDM-derived class to support get_counter_state() execution.
  • Add an elgris_test.py covering bat/counter/inverter updates via mocked Modbus reads.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/modules/devices/elgris/elgris/inverter.py Removes nested Modbus context management in inverter update.
packages/modules/devices/elgris/elgris/counter.py Removes nested Modbus context management in counter update.
packages/modules/devices/elgris/elgris/bat.py Removes nested Modbus context management in battery update.
packages/modules/devices/elgris/elgris/elgris.py Sets fast_mode to avoid runtime attribute errors in SDM logic.
packages/modules/devices/elgris/elgris/elgris_test.py Adds tests using monkeypatched Modbus methods to validate state writes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +27 to +28
device = create_device(Elgris())
device.add_component(ElgrisBatSetup())
Comment on lines +48 to +49
device = create_device(Elgris())
device.add_component(ElgrisCounterSetup(id=1))
@LKuemmel LKuemmel merged commit 8f93729 into openWB:master Mar 17, 2026
6 checks passed
@LKuemmel LKuemmel deleted the fix-sdm branch March 17, 2026 10:56
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