mirror of
https://github.com/home-assistant/core.git
synced 2025-12-23 20:39:01 +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
13
homeassistant/components/cloud/utils.py
Normal file
13
homeassistant/components/cloud/utils.py
Normal file
@@ -0,0 +1,13 @@
|
||||
"""Helper functions for cloud components."""
|
||||
from typing import Any, Dict
|
||||
|
||||
from aiohttp import web
|
||||
|
||||
|
||||
def aiohttp_serialize_response(response: web.Response) -> Dict[str, Any]:
|
||||
"""Serialize an aiohttp response to a dictionary."""
|
||||
return {
|
||||
'status': response.status,
|
||||
'body': response.text,
|
||||
'headers': dict(response.headers),
|
||||
}
|
||||
Reference in New Issue
Block a user