Remove homeassistant.remote (#16099)
* Remove homeassistant.remote * Use direct import for API * Fix docstring
This commit is contained in:
parent
ae5c4c7e13
commit
7bb5344942
18 changed files with 62 additions and 555 deletions
|
@ -11,10 +11,10 @@ import logging
|
|||
from aiohttp import web
|
||||
from aiohttp.web_exceptions import HTTPUnauthorized, HTTPInternalServerError
|
||||
|
||||
import homeassistant.remote as rem
|
||||
from homeassistant.components.http.ban import process_success_login
|
||||
from homeassistant.core import Context, is_callback
|
||||
from homeassistant.const import CONTENT_TYPE_JSON
|
||||
from homeassistant.helpers.json import JSONEncoder
|
||||
|
||||
from .const import KEY_AUTHENTICATED, KEY_REAL_IP
|
||||
|
||||
|
@ -44,7 +44,7 @@ class HomeAssistantView:
|
|||
"""Return a JSON response."""
|
||||
try:
|
||||
msg = json.dumps(
|
||||
result, sort_keys=True, cls=rem.JSONEncoder).encode('UTF-8')
|
||||
result, sort_keys=True, cls=JSONEncoder).encode('UTF-8')
|
||||
except TypeError as err:
|
||||
_LOGGER.error('Unable to serialize to JSON: %s\n%s', err, result)
|
||||
raise HTTPInternalServerError
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue