Warn and leave Powerwall gateway host blank when discovery fails - #987
Draft
Bre77 wants to merge 1 commit into
Draft
Warn and leave Powerwall gateway host blank when discovery fails#987Bre77 wants to merge 1 commit into
Bre77 wants to merge 1 commit into
Conversation
When gateway-address discovery returns no address or raises, the energy-site credentials form defaulted the host to the setup-AP address, silently sending users to the wrong host for a normally-connected gateway, and logged only at debug. Leave the field blank and warn on both paths instead. Add tests pinning the gateway-discovery contract at the find_gateway_address boundary: a discovered address pre-fills the host, the active-route LAN address (not the gateway-internal one) is surfaced, and both the None and exception paths leave the field blank and warn.
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.
Breaking change
Proposed change
The energy-site subentry flow discovers the local Powerwall gateway address via
find_gateway_address()before showing the credentials form. When discoveryreturned no address or raised, the form defaulted the host to
DEFAULT_GATEWAY_HOST(192.168.91.1, the setup-AP address) and logged only atdebug — silently pointing the user at the wrong host for a normally-connected
gateway. The form now leaves the host field blank and logs a warning on both the
no-address and error paths, so the user enters the gateway host instead of
inheriting a misleading default.
The tests pin Home Assistant's side of the gateway-discovery contract at the
find_gateway_address()boundary, not the library's address decoding:networking_status, the resolved active-routeLAN address is surfaced rather than the gateway-internal one (the interface
selection itself is the library's responsibility);
Noneand exception (ClientError/TeslaFleetError) paths leavethe field blank and emit a warning.
The fixture is Teslemetry-format
networking_status(dotted-quad stringaddresses; Tesla Fleet's own API serves uint32 ints), with all identifying
values replaced by synthetic ones.
Type of change
Additional information
Checklist
ruff format homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all.To help with the load of incoming pull requests: