Fetch wallbox status via HTTP for real-time updates#113
Draft
derolli1976 wants to merge 2 commits intodevfrom
Draft
Fetch wallbox status via HTTP for real-time updates#113derolli1976 wants to merge 2 commits intodevfrom
derolli1976 wants to merge 2 commits intodevfrom
Conversation
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.
Description
Wallbox status sensors (
wallbox_mode,wallbox_status) now reflect external changes (e.g. charging started/stopped via the native Enpal app) within the normal polling interval.Previously in native (Blazor/WebSocket) mode,
get_wallbox_data()only returned cached values from_modeand_status. These were only updated when the integration itself clicked a button (triggering a RenderBatch) or when the WebSocket connection was re-established (up to every 5 minutes). Changes made outside the integration (e.g. via the Enpal app) were invisible because they occurred in a separate Blazor circuit.Now,
get_wallbox_data()performs a lightweight HTTP GET to/wallboxon every poll. Blazor Server pre-renders the current component state into the HTML response, so we parse "Mode X" and "Status Y" using the existing_extract_status_text()logic. The WebSocket connection remains open and undisturbed for button clicks.Motivation and Context
Users reported that the wallbox status sensors did not update when charging was started/stopped or the mode was changed via the native Enpal app instead of through the Home Assistant integration. The root cause was that Blazor Server only pushes RenderBatch updates to its own circuit — external changes were never propagated to our WebSocket connection.
How Has This Been Tested?
custom_components/enpal_webparser/tests/pass without regressions.tests_root/are pre-existing integration tests that require a live Enpal Box connection and are unrelated to this change._fetch_status_via_http()method reuses the battle-tested_extract_status_text()parser that already handles RenderBatch data.Screenshots (if appropriate):
N/A
Types of changes
Checklist: