Migrate integrations n-r to generic flowhandler (#111864)

This commit is contained in:
Erik Montnemery 2024-02-29 20:09:01 +01:00 committed by GitHub
parent 52e7912caf
commit e0c1feb22c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
113 changed files with 890 additions and 746 deletions

View file

@ -10,9 +10,8 @@ from homeassistant.components.bluetooth import (
BluetoothServiceInfoBleak,
async_discovered_service_info,
)
from homeassistant.config_entries import ConfigFlow
from homeassistant.config_entries import ConfigFlow, ConfigFlowResult
from homeassistant.const import CONF_ADDRESS
from homeassistant.data_entry_flow import FlowResult
from .const import DOMAIN
@ -30,7 +29,7 @@ class RAPTPillConfigFlow(ConfigFlow, domain=DOMAIN):
async def async_step_bluetooth(
self, discovery_info: BluetoothServiceInfoBleak
) -> FlowResult:
) -> ConfigFlowResult:
"""Handle the bluetooth discovery step."""
await self.async_set_unique_id(discovery_info.address)
self._abort_if_unique_id_configured()
@ -43,7 +42,7 @@ class RAPTPillConfigFlow(ConfigFlow, domain=DOMAIN):
async def async_step_bluetooth_confirm(
self, user_input: dict[str, Any] | None = None
) -> FlowResult:
) -> ConfigFlowResult:
"""Confirm discovery."""
assert self._discovered_device is not None
device = self._discovered_device
@ -62,7 +61,7 @@ class RAPTPillConfigFlow(ConfigFlow, domain=DOMAIN):
async def async_step_user(
self, user_input: dict[str, Any] | None = None
) -> FlowResult:
) -> ConfigFlowResult:
"""Handle the user step to pick discovered device."""
if user_input is not None:
address = user_input[CONF_ADDRESS]