fix: graceful error handling for older firmware (tested on fw 4.0)#2
Open
rvweert wants to merge 1 commit into
Open
fix: graceful error handling for older firmware (tested on fw 4.0)#2rvweert wants to merge 1 commit into
rvweert wants to merge 1 commit into
Conversation
Panels running firmware 4.0 reject several commands with PANEL_ERROR, causing monitor initialization to crash. This adds fallbacks: - _get_names(): falls back from Extended to standard format on error - get_*_states(): falls back to individual queries when batch fails - get_valid_zone_numbers(): handles unsupported getZonesAssignedToAreas - _initialize(): each entity type initialized independently No behavioral change for panels that already work (4.1+). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
Panels running firmware 4.0 (older than the currently tested 4.1+) reject several commands with
PANEL_ERROR (0x00), causing the monitor initialization to crash entirely. This PR adds graceful fallbacks so the integration works with these panels.Firmware 4.0 limitations discovered:
getXxxNamesExtended(msg_id 0x19) — not supportedgetZonesAssignedToAreas— not supportedPANEL_ERRORfor unconfigured entitiesWhat this PR changes:
_get_names(): Falls back fromgetXxxNamesExtendedto standardgetXxxNamesonPANEL_ERRORget_*_states()(area, output, trigger, door, filter): Falls back to individual queries when a batch request fails, matching the existingget_zone_states()behavior. Non-existent entities are skipped.get_valid_zone_numbers(): Falls back to individual queries whengetZonesAssignedToAreasis not supported_initialize(): Each entity type (zones, areas, outputs, etc.) is initialized independently — one failure no longer blocks the restNo behavioral change for panels that already work (4.1+). All fallbacks only trigger on
PANEL_ERROR.Test plan
🤖 Generated with Claude Code