You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Don't raise HomeAssistantError in scanner. Replace it with ScannerConnectionError.
Summary by CodeRabbit
Bug Fixes
Improved setup error reporting when a device scanner cannot connect. Connection failures are now shown for the host address, while device-specific scan errors continue to appear with the device selection. This makes it clearer which connection detail needs attention when validating a manually configured device.
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.
📝 Walkthrough
The scanner now raises ScannerConnectionError when connection attempts are exhausted. Manual device validation catches this exception as a host error. Device-list error handling remains unchanged.
Changes: Scanner connection error handling
Layer / File(s)
Summary
Define, raise, and handle connection errors custom_components/solaredge_modbus_multi/scanner.py, custom_components/solaredge_modbus_multi/config_flow.py
The scanner defines and raises ScannerConnectionError after connection retries are exhausted. Manual device validation catches it alongside HomeAssistantError in the host-error handler. The scan_device_id documentation names the new exception. Device-list error handling is unchanged.
Exhausted connection attempts continue to appear as scan failures or host-validation errors, while device-list errors keep their existing handling. No merge-blocking behavior change is established.
Security architecture risk:⚪ Minimal · up to 3afd0
The dedicated exception preserves connection-failure reporting in both manual validation and scan-based setup. The inspected change leaves network destinations, validation rules, retries, and cleanup behavior unchanged. No introduced or worsened material security risk was identified.
Retained concerns
No architecture-level concerns identified.
Security review details
Security Blast Radius
inferred — The demonstrated impact is limited to scanner connection-failure propagation and setup error presentation. The inspected comparison does not add network destinations, privileged operations, or consumers that increase independently attackable scope.
Trust Boundaries and Controls
inferred — The replacement exception does not create a new route around checked setup: connection exhaustion remains an error, and the inspected manual and scan-based paths do not construct a pending entry from that failure. This preserves the existing failure gate rather than adding a new security control.
Resilience and Maintainability Implications
inferred — Failure containment remains compatible with the new exception in both inspected setup paths. Cleanup ownership and retry transitions are unchanged, including their existing limitations under interruption or unsupported concurrent use.
Pre-merge checks: 5
Passed checks: 5 passed
Check name
Status
Explanation
Title check
The title clearly and concisely identifies the main change: replacing the scanner's use of HomeAssistantError.
Description check
The description clearly states the purpose and implementation of the change. It is brief, but the repository template contains guidance rather than required sections, so no critical information is mis…
Docstring Coverage
Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files.
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
Commit to this branch
Create a new PR
🧪 Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
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
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.
Don't raise HomeAssistantError in scanner. Replace it with ScannerConnectionError.
Summary by CodeRabbit