Add FlowResultType enum to data entry flow (#72955)

This commit is contained in:
epenet 2022-06-08 07:02:44 +02:00 committed by GitHub
parent 329595bf73
commit f91aa33c5f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 79 additions and 53 deletions

View file

@ -129,11 +129,11 @@ def websocket_depose_mfa(
def _prepare_result_json(result):
"""Convert result to JSON."""
if result["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY:
if result["type"] == data_entry_flow.FlowResultType.CREATE_ENTRY:
data = result.copy()
return data
if result["type"] != data_entry_flow.RESULT_TYPE_FORM:
if result["type"] != data_entry_flow.FlowResultType.FORM:
return result
data = result.copy()