Skip to content

Commit

Permalink
Speed up websocket and ingress with aiohttp-zlib-ng (#103247)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdraco committed Nov 2, 2023
1 parent 35e1ece commit 45f5c21
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 1 deletion.
3 changes: 3 additions & 0 deletions homeassistant/components/http/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
UrlDispatcher,
UrlMappingMatchInfo,
)
from aiohttp_zlib_ng import enable_zlib_ng
from cryptography import x509
from cryptography.hazmat.primitives import hashes, serialization
from cryptography.hazmat.primitives.asymmetric import rsa
Expand Down Expand Up @@ -173,6 +174,8 @@ def __init__(

async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Set up the HTTP API and debug interface."""
enable_zlib_ng()

conf: ConfData | None = config.get(DOMAIN)

if conf is None:
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/http/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"integration_type": "system",
"iot_class": "local_push",
"quality_scale": "internal",
"requirements": ["aiohttp_cors==0.7.0"]
"requirements": ["aiohttp_cors==0.7.0", "aiohttp-zlib-ng==0.1.1"]
}
1 change: 1 addition & 0 deletions homeassistant/package_constraints.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
aiodiscover==1.5.1
aiohttp-zlib-ng==0.1.1
aiohttp==3.8.5;python_version<'3.12'
aiohttp==3.9.0b0;python_version>='3.12'
aiohttp_cors==0.7.0
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ requires-python = ">=3.11.0"
dependencies = [
"aiohttp==3.9.0b0;python_version>='3.12'",
"aiohttp==3.8.5;python_version<'3.12'",
"aiohttp_cors==0.7.0",
"aiohttp-zlib-ng==0.1.1",
"astral==2.2",
"attrs==23.1.0",
"atomicwrites-homeassistant==1.4.1",
Expand Down
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# Home Assistant Core
aiohttp==3.9.0b0;python_version>='3.12'
aiohttp==3.8.5;python_version<'3.12'
aiohttp_cors==0.7.0
aiohttp-zlib-ng==0.1.1
astral==2.2
attrs==23.1.0
atomicwrites-homeassistant==1.4.1
Expand Down
3 changes: 3 additions & 0 deletions requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,9 @@ aioharmony==0.2.10
# homeassistant.components.homekit_controller
aiohomekit==3.0.9

# homeassistant.components.http
aiohttp-zlib-ng==0.1.1

# homeassistant.components.emulated_hue
# homeassistant.components.http
aiohttp_cors==0.7.0
Expand Down
3 changes: 3 additions & 0 deletions requirements_test_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,9 @@ aioharmony==0.2.10
# homeassistant.components.homekit_controller
aiohomekit==3.0.9

# homeassistant.components.http
aiohttp-zlib-ng==0.1.1

# homeassistant.components.emulated_hue
# homeassistant.components.http
aiohttp_cors==0.7.0
Expand Down

0 comments on commit 45f5c21

Please sign in to comment.