Use new custom_serializer (#31871)

This commit is contained in:
jjlawren 2020-02-15 17:36:57 -06:00 committed by GitHub
parent 7dff5e79d1
commit 91018034b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View File

@ -8,6 +8,7 @@ from homeassistant.auth.permissions.const import CAT_CONFIG_ENTRIES
from homeassistant.components import websocket_api from homeassistant.components import websocket_api
from homeassistant.components.http import HomeAssistantView from homeassistant.components.http import HomeAssistantView
from homeassistant.exceptions import Unauthorized from homeassistant.exceptions import Unauthorized
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.data_entry_flow import ( from homeassistant.helpers.data_entry_flow import (
FlowManagerIndexView, FlowManagerIndexView,
FlowManagerResourceView, FlowManagerResourceView,
@ -45,7 +46,9 @@ def _prepare_json(result):
if schema is None: if schema is None:
data["data_schema"] = [] data["data_schema"] = []
else: else:
data["data_schema"] = voluptuous_serialize.convert(schema) data["data_schema"] = voluptuous_serialize.convert(
schema, custom_serializer=cv.custom_serializer
)
return data return data

View File

@ -5,6 +5,7 @@ import voluptuous as vol
from homeassistant import config_entries, data_entry_flow from homeassistant import config_entries, data_entry_flow
from homeassistant.components.http import HomeAssistantView from homeassistant.components.http import HomeAssistantView
from homeassistant.components.http.data_validator import RequestDataValidator from homeassistant.components.http.data_validator import RequestDataValidator
import homeassistant.helpers.config_validation as cv
# mypy: allow-untyped-calls, allow-untyped-defs # mypy: allow-untyped-calls, allow-untyped-defs
@ -36,7 +37,9 @@ class _BaseFlowManagerView(HomeAssistantView):
if schema is None: if schema is None:
data["data_schema"] = [] data["data_schema"] = []
else: else:
data["data_schema"] = voluptuous_serialize.convert(schema) data["data_schema"] = voluptuous_serialize.convert(
schema, custom_serializer=cv.custom_serializer
)
return data return data