Skip to content

Gateway, reset inverter after leaving Read Only mode#4123

Merged
springfall2008 merged 1 commit into
mainfrom
fix/gateway_reset_after_ro
Jun 24, 2026
Merged

Gateway, reset inverter after leaving Read Only mode#4123
springfall2008 merged 1 commit into
mainfrom
fix/gateway_reset_after_ro

Conversation

@springfall2008

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings June 24, 2026 17:50

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 adjusts the gateway inverter-reset behavior so that when PredBat is placed into read-only mode, prior “reset already sent” tracking is cleared—allowing inverter resets to be re-sent once read-only is later disabled. It also adds targeted unit tests to cover the new behavior and bumps the PredBat version.

Changes:

  • Clear GatewayMQTT._inverter_reset_done when set_read_only is enabled to allow re-sending resets after read-only is disabled.
  • Add tests covering clearing behavior and re-sending after toggling read-only off/on.
  • Bump THIS_VERSION to v8.42.1.

Reviewed changes

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

File Description
apps/predbat/gateway.py Updates inverter reset gating to clear the “already reset” set when read-only is active.
apps/predbat/tests/test_gateway.py Adds unit tests for clearing _inverter_reset_done in read-only and re-sending resets after read-only is disabled.
apps/predbat/predbat.py Version bump to v8.42.1.

Comment thread apps/predbat/gateway.py
Comment on lines 1146 to 1152
async def _check_inverter_resets(self):
"""Send inverter_reset for each configured inverter not yet reset in control mode.

Called on every run() cycle. Skips when is_alive() is False, auto-config has
not yet run, or set_read_only is active. Each serial is reset at most once per
process lifetime (tracked in _inverter_reset_done).
"""
@springfall2008 springfall2008 changed the title Gateway, reset inverter after leading RO Gateway, reset inverter after leaving Read Only mode Jun 24, 2026
@springfall2008 springfall2008 merged commit ed7d588 into main Jun 24, 2026
2 checks passed
@springfall2008 springfall2008 deleted the fix/gateway_reset_after_ro branch June 24, 2026 18:46
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