Disable the aiohttp total timeout on the panel SSE stream (task 6c4b0fa4)

Home Assistant's shared session defaults to ClientTimeout(total=300),
which cut a healthy event stream every five minutes; transitions fired
during the reconnect window are not replayed. The stream request now
passes ClientTimeout(total=None, sock_connect=<client timeout>), with
aiohttp imported lazily so the client stays importable without it.
Tests run the stream path against a stand-in aiohttp module fixture.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-06 08:54:49 -04:00
co-authored by Claude Opus 5.5
parent 0ccf787dc6
commit b4e96adf9c
4 changed files with 76 additions and 6 deletions
+4
View File
@@ -44,6 +44,10 @@ from custom_components.nestquest.api_client import (
)
from custom_components.nestquest.sse import NestQuestEventStream
# ``stream_events`` imports aiohttp lazily; the harness has none, so
# every test here runs with the stand-in module installed.
pytestmark = pytest.mark.usefixtures("fake_aiohttp")
BASE_URL = "http://api.test:8000"
TOKEN = "test-panel-token"