Migrate integrations s-t to generic flowhandler (#111865)
This commit is contained in:
parent
e0c1feb22c
commit
b0ed8c4961
106 changed files with 792 additions and 661 deletions
|
@ -6,9 +6,8 @@ from technove import Station as TechnoVEStation, TechnoVE, TechnoVEConnectionErr
|
|||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components import onboarding, zeroconf
|
||||
from homeassistant.config_entries import ConfigFlow
|
||||
from homeassistant.config_entries import ConfigFlow, ConfigFlowResult
|
||||
from homeassistant.const import CONF_HOST, CONF_MAC
|
||||
from homeassistant.data_entry_flow import FlowResult
|
||||
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
||||
|
||||
from .const import DOMAIN
|
||||
|
@ -23,7 +22,7 @@ class TechnoVEConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||
|
||||
async def async_step_user(
|
||||
self, user_input: dict[str, Any] | None = None
|
||||
) -> FlowResult:
|
||||
) -> ConfigFlowResult:
|
||||
"""Handle a flow initiated by the user."""
|
||||
errors = {}
|
||||
if user_input is not None:
|
||||
|
@ -51,7 +50,7 @@ class TechnoVEConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||
|
||||
async def async_step_zeroconf(
|
||||
self, discovery_info: zeroconf.ZeroconfServiceInfo
|
||||
) -> FlowResult:
|
||||
) -> ConfigFlowResult:
|
||||
"""Handle zeroconf discovery."""
|
||||
# Abort quick if the device with provided mac is already configured
|
||||
if mac := discovery_info.properties.get(CONF_MAC):
|
||||
|
@ -78,7 +77,7 @@ class TechnoVEConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||
|
||||
async def async_step_zeroconf_confirm(
|
||||
self, user_input: dict[str, Any] | None = None
|
||||
) -> FlowResult:
|
||||
) -> ConfigFlowResult:
|
||||
"""Handle a flow initiated by zeroconf."""
|
||||
if user_input is not None or not onboarding.async_is_onboarded(self.hass):
|
||||
return self.async_create_entry(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue