Repository navigation
Conversation
Recovery edits now route through the hub so a bad-register-block recovery lands on both protocol controllers instead of being lost when the hub switches; enable_connection/disable_connection likewise apply to both. Duplicate config entries migrating to the same inverter serial are now caught and skipped instead of silently colliding. Overlapping health-tick probes of a dead standby link are now guarded against. Unexpected poll exceptions are logged at warning instead of debug. The number entity's write path no longer fires a fire-and-forget task and optimistically updates regardless of success; it awaits the write like the time entity already did. The binary/switch entity now pushes state immediately on a register update instead of relying on polling. Fixes #13
Contributor
|
Failed to generate code suggestions for PR |
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.
Summary
Fixes all seven checklist items from issue #13 (dual-protocol robustness gaps found in the full repo review):
DataRetrieval._recover_sensor_group_after_modbus_failure) calledreplace_sensor_groupdirectly on the concrete Modbus controller, bypassing the hub entirely.DataRetrievalnow takes an optionalhubreference and routes recovery through it; the hub'sreplace_sensor_groupnow applies to bothmodbusandcloud.enable_connection/disable_connectiononly touched the active protocol — now applied to both controllers via the hub.async_migrate_to_serial_idsnow checks for an existing entry already using the target serial before migrating, instead of silently creating a collision._health_tickprobes the standby link uncoordinated — added a skip-if-busy guard so overlapping timer fires (e.g. a slow probe of a dead link) can't race the health-tracking state.exceptswallowed at debug level —get_modbus_updatesnow logs unexpected poll errors atwarningwith a traceback.set_native_valuefired the write into an untracked task and updated state regardless of outcome; converted toasync_set_native_valuewhich awaits the write directly (matching the time entity's existing correct behavior).SolisBinaryEntity.handle_modbus_updatenever pushes state — addedschedule_update_ha_state()calls.Test plan
tests/test_inverter_hub.py,tests/test_register_group_recovery.py,tests/test_migration.py,tests/test_switch_conflicts_requires.py: new coverage for each fixtests/test_number.py,tests/test_s16_encoding.py: updated for the sync→async renameruff check/ruff format --checkcleanCloses #13