Skip to content

Savings total not updating#3298

Merged
springfall2008 merged 8 commits intomainfrom
fixes
Jan 30, 2026
Merged

Savings total not updating#3298
springfall2008 merged 8 commits intomainfrom
fixes

Conversation

@springfall2008
Copy link
Owner

No description provided.

Copilot AI review requested due to automatic review settings January 30, 2026 08:21
@springfall2008 springfall2008 merged commit a2b82bf into main Jan 30, 2026
1 check passed
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 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_predbat tracking 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.

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.

1 participant