mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 04:07:08 +00:00
Prepare websocket writer for aiohttp 3.11 (#127043)
This commit is contained in:
parent
10c033e580
commit
c3f0f30910
@ -328,7 +328,13 @@ class WebSocketHandler:
|
||||
if TYPE_CHECKING:
|
||||
assert writer is not None
|
||||
|
||||
send_bytes_text = partial(writer.send, binary=False)
|
||||
# aiohttp 3.11.0 changed the method name from _send_frame to send_frame
|
||||
if hasattr(writer, "send_frame"):
|
||||
send_frame = writer.send_frame # pragma: no cover
|
||||
else:
|
||||
send_frame = writer._send_frame # noqa: SLF001
|
||||
|
||||
send_bytes_text = partial(send_frame, opcode=WSMsgType.TEXT)
|
||||
auth = AuthPhase(
|
||||
logger, hass, self._send_message, self._cancel, request, send_bytes_text
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user