diff --git a/homeassistant/components/geofency/__init__.py b/homeassistant/components/geofency/__init__.py index 37d32a8860d..e5698b997a4 100644 --- a/homeassistant/components/geofency/__init__.py +++ b/homeassistant/components/geofency/__init__.py @@ -73,7 +73,7 @@ async def handle_webhook(hass, webhook_id, request): data = WEBHOOK_SCHEMA(dict(await request.post())) except vol.MultipleInvalid as error: return web.Response( - body=error.error_message, + text=error.error_message, status=HTTP_UNPROCESSABLE_ENTITY ) diff --git a/homeassistant/components/locative/__init__.py b/homeassistant/components/locative/__init__.py index c44b12c87d2..66f917e5729 100644 --- a/homeassistant/components/locative/__init__.py +++ b/homeassistant/components/locative/__init__.py @@ -58,7 +58,7 @@ async def handle_webhook(hass, webhook_id, request): data = WEBHOOK_SCHEMA(dict(await request.post())) except vol.MultipleInvalid as error: return web.Response( - body=error.error_message, + text=error.error_message, status=HTTP_UNPROCESSABLE_ENTITY ) @@ -76,7 +76,7 @@ async def handle_webhook(hass, webhook_id, request): location_name ) return web.Response( - body='Setting location to {}'.format(location_name), + text='Setting location to {}'.format(location_name), status=HTTP_OK ) diff --git a/homeassistant/components/mobile_app/helpers.py b/homeassistant/components/mobile_app/helpers.py index ee593588ef8..6aec4307464 100644 --- a/homeassistant/components/mobile_app/helpers.py +++ b/homeassistant/components/mobile_app/helpers.py @@ -81,7 +81,7 @@ def registration_context(registration: Dict) -> Context: def empty_okay_response(headers: Dict = None, status: int = 200) -> Response: """Return a Response with empty JSON object and a 200.""" - return Response(body='{}', status=status, content_type='application/json', + return Response(text='{}', status=status, content_type='application/json', headers=headers)