Migrate integrations s-t to generic flowhandler (#111865)

This commit is contained in:
Erik Montnemery 2024-02-29 22:16:14 +01:00 committed by GitHub
parent e0c1feb22c
commit b0ed8c4961
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
106 changed files with 792 additions and 661 deletions

View file

@ -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(