Skip to content

Cleanup inverter SN handling in Solis - #3864

Merged
springfall2008 merged 2 commits into
mainfrom
fix/solis_inverter_sn
May 4, 2026
Merged

springfall2008 merged 2 commits into
mainfrom
fix/solis_inverter_sn

Conversation

@springfall2008

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings May 4, 2026 19:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR cleans up Solis inverter serial-number handling so the component keeps the configured SN filter separate from the runtime-discovered inverter list. In the Solis integration, that makes startup/retry discovery more robust when run() mutates self.inverter_sn.

Changes:

  • Split configured Solis inverter SNs from discovered/managed inverter SNs by introducing configured_inverter_sn.
  • Centralized discovery filtering in filter_inverter_sn(), including case-insensitive matching and missing-SN warnings.
  • Added Solis tests covering SN filtering and first/subsequent run() behavior.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
apps/predbat/solis.py Refactors Solis SN initialization/discovery to preserve configured filters across retries.
apps/predbat/tests/test_solis.py Adds regression tests for SN filtering and run() lifecycle behavior.
apps/predbat/predbat.py Bumps the app version for this Solis change.

Comment thread apps/predbat/solis.py
self.max_charge_current = {} # {inverter_sn: int}
self.max_discharge_current = {} # {inverter_sn: int}
self.charge_discharge_time_windows = {} # {inverter_sn: time_window_dict}
self.inverter_sn = []
@springfall2008
springfall2008 merged commit 51e0640 into main May 4, 2026
1 check passed
@springfall2008
springfall2008 deleted the fix/solis_inverter_sn branch May 4, 2026 20:10
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