Use flow result type constants more (#51122)
This commit is contained in:
parent
b6716ecebd
commit
c2f5dcefa5
7 changed files with 25 additions and 21 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue