Use flow result type constants more (#51122)

This commit is contained in:
Ville Skyttä 2021-05-29 15:09:13 +03:00 committed by GitHub
parent b6716ecebd
commit c2f5dcefa5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 25 additions and 21 deletions

View file

@ -27,7 +27,7 @@ from homeassistant.components.mysensors import (
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import callback
from homeassistant.data_entry_flow import FlowResult
from homeassistant.data_entry_flow import RESULT_TYPE_FORM, FlowResult
import homeassistant.helpers.config_validation as cv
from . import CONF_RETAIN, CONF_VERSION, DEFAULT_VERSION
@ -132,7 +132,7 @@ class MySensorsConfigFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
user_input[CONF_GATEWAY_TYPE] = CONF_GATEWAY_TYPE_SERIAL
result: dict[str, Any] = await self.async_step_user(user_input=user_input)
if result["type"] == "form":
if result["type"] == RESULT_TYPE_FORM:
return self.async_abort(reason=next(iter(result["errors"].values())))
return result