Merged
Conversation
Adding inverter filter to Fox to Solax
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes an issue where savings_total_* entities could fail to increment by ensuring required tracking attributes are initialized, alongside a refactor to compute charge-limit percentages on-demand and new optional device/plant filtering for Fox and SolaX integrations.
Changes:
- Initialize
savings_total_predbattracking attributes (last_updated,start_date) so totals can increment reliably. - Remove persisted
charge_limit_percent*arrays and compute percent values from kWh when publishing/logging. - Add optional filtering for Fox devices (
inverter_sn) and SolaX plants (plant_sn) plus small robustness improvements.
Reviewed changes
Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| apps/predbat/predbat.py | Adjusts savings totals initialization logic; bumps version. |
| apps/predbat/plan.py | Removes reliance on stored percent arrays; computes percent from kWh when needed. |
| apps/predbat/output.py | Changes publish_charge_limit API to compute percentages internally. |
| apps/predbat/execute.py | Updates call sites for publish_charge_limit and percent logging/targets. |
| apps/predbat/inverter.py | Hardens switch-state lookup by normalizing state to str. |
| apps/predbat/fox.py | Adds inverter_sn filter support for device listing. |
| apps/predbat/solax.py | Adds plant_sn filter support for plant selection. |
| apps/predbat/components.py | Wires new fox_inverter_sn / solax_plant_sn config args into component init. |
| apps/predbat/compare.py | Removes saving/restoring a now-removed percent-array attribute. |
| apps/predbat/tests/test_single_debug.py | Removes setup of now-removed percent-array fields. |
| apps/predbat/tests/test_optimise_levels.py | Removes setup of now-removed percent-array fields. |
| apps/predbat/tests/test_optimise_all_windows.py | Removes setup of now-removed percent-array fields. |
| apps/predbat/tests/test_execute.py | Removes setup of now-removed percent-array fields. |
| apps/predbat/tests/test_infra.py | Stops resetting a now-removed percent-array field. |
| apps/predbat/tests/test_fox_api.py | Updates mocks to include new inverter_sn_filter attribute. |
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.
No description provided.