mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
Fix cloud webhook body (#20739)
* Bugfix cloud webhooks text response * address comments * Fix lint
This commit is contained in:
committed by
Paulus Schoutsen
parent
c812176e94
commit
29b64d56be
@@ -3,7 +3,6 @@ import json
|
||||
from urllib.parse import parse_qsl
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
from aiohttp import web
|
||||
from multidict import CIMultiDict, MultiDict
|
||||
|
||||
|
||||
@@ -42,12 +41,3 @@ class MockRequest:
|
||||
async def text(self) -> str:
|
||||
"""Return the body as text."""
|
||||
return self._text
|
||||
|
||||
|
||||
def serialize_response(response: web.Response) -> Dict[str, Any]:
|
||||
"""Serialize an aiohttp response to a dictionary."""
|
||||
return {
|
||||
'status': response.status,
|
||||
'body': response.body,
|
||||
'headers': dict(response.headers),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user