Gateway, reset inverter after leaving Read Only mode#4123
Merged
Conversation
Contributor
There was a problem hiding this comment.
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_donewhenset_read_onlyis 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_VERSIONtov8.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 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). | ||
| """ |
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.