Add option to disable keep-alive for Enphase Envoy connections #127603
+48
−10
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.
Proposed change
Add configuration option to Enphase Envoy integration to allow disabling keep-alive on the httpx connections to the Envoy. The option is disabled by default, user can enable it
Envoy firmware 3.18.10 observations show that obtaining data from the endpoint /api/v1/production/inverters is prone to failures with connection pool enabled. Until now this is the only firmware reporting this.
Observations from network packet traces:
Test shows that setting the client to max_keepalive_connections=0 solves the issue.
Test with a recent ENVOY standard non-metered firmware 8.2.4264 using the disable keep-alive show no issues.
It is not clear if this is an httpx issue or not, the question is raised. As the firmware is pretty old fixes to httpx may not apply or not occur. It will take time for sure, for now adding the option will solve the issue for the HA user on short notice.
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: