Read the panel SSE body from response.content (task 4cbf2e96) (#295)

Co-authored-by: dev_agent <dev_agent@cubecraftlabs.com>
This commit was merged in pull request #295.
This commit is contained in:
2026-10-06 08:15:45 -04:00
committed by approver_agent
parent f2ff73ea31
commit d00f4ea173
3 changed files with 105 additions and 8 deletions
+4 -1
View File
@@ -315,7 +315,10 @@ class NestQuestApiClient:
event_type: str | None = None
data_lines: list[str] = []
buffer = ""
async for chunk in response:
# The body is ``response.content`` (aiohttp's StreamReader,
# yielding bytes); the response object itself — HA's
# ``HassClientResponse`` included — is NOT async-iterable.
async for chunk in response.content:
if isinstance(chunk, (bytes, bytearray)):
chunk = chunk.decode("utf-8")
buffer += chunk