mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
Cleanup unnecessary __init__ method in OptionsFlow (#129651)
* Cleanup unnecessary init step in OptionsFlow * Increase coverage
This commit is contained in:
parent
269aefd405
commit
d6e73a89f3
@ -52,7 +52,7 @@ class CanaryConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
@callback
|
@callback
|
||||||
def async_get_options_flow(config_entry: ConfigEntry) -> OptionsFlow:
|
def async_get_options_flow(config_entry: ConfigEntry) -> OptionsFlow:
|
||||||
"""Get the options flow for this handler."""
|
"""Get the options flow for this handler."""
|
||||||
return CanaryOptionsFlowHandler(config_entry)
|
return CanaryOptionsFlowHandler()
|
||||||
|
|
||||||
async def async_step_import(self, import_data: dict[str, Any]) -> ConfigFlowResult:
|
async def async_step_import(self, import_data: dict[str, Any]) -> ConfigFlowResult:
|
||||||
"""Handle a flow initiated by configuration file."""
|
"""Handle a flow initiated by configuration file."""
|
||||||
@ -104,10 +104,6 @@ class CanaryConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
class CanaryOptionsFlowHandler(OptionsFlow):
|
class CanaryOptionsFlowHandler(OptionsFlow):
|
||||||
"""Handle Canary client options."""
|
"""Handle Canary client options."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
|
||||||
"""Initialize options flow."""
|
|
||||||
self.config_entry = config_entry
|
|
||||||
|
|
||||||
async def async_step_init(
|
async def async_step_init(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
|
@ -158,16 +158,12 @@ class CoinbaseConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
config_entry: ConfigEntry,
|
config_entry: ConfigEntry,
|
||||||
) -> OptionsFlowHandler:
|
) -> OptionsFlowHandler:
|
||||||
"""Get the options flow for this handler."""
|
"""Get the options flow for this handler."""
|
||||||
return OptionsFlowHandler(config_entry)
|
return OptionsFlowHandler()
|
||||||
|
|
||||||
|
|
||||||
class OptionsFlowHandler(OptionsFlow):
|
class OptionsFlowHandler(OptionsFlow):
|
||||||
"""Handle a option flow for Coinbase."""
|
"""Handle a option flow for Coinbase."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
|
||||||
"""Initialize options flow."""
|
|
||||||
self.config_entry = config_entry
|
|
||||||
|
|
||||||
async def async_step_init(
|
async def async_step_init(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
|
@ -154,16 +154,12 @@ class Control4ConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
config_entry: ConfigEntry,
|
config_entry: ConfigEntry,
|
||||||
) -> OptionsFlowHandler:
|
) -> OptionsFlowHandler:
|
||||||
"""Get the options flow for this handler."""
|
"""Get the options flow for this handler."""
|
||||||
return OptionsFlowHandler(config_entry)
|
return OptionsFlowHandler()
|
||||||
|
|
||||||
|
|
||||||
class OptionsFlowHandler(OptionsFlow):
|
class OptionsFlowHandler(OptionsFlow):
|
||||||
"""Handle a option flow for Control4."""
|
"""Handle a option flow for Control4."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
|
||||||
"""Initialize options flow."""
|
|
||||||
self.config_entry = config_entry
|
|
||||||
|
|
||||||
async def async_step_init(
|
async def async_step_init(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
|
@ -52,10 +52,6 @@ CONFIG_SCHEMA = vol.Schema({vol.Optional(CONF_HOST): str})
|
|||||||
class OptionsFlowHandler(OptionsFlow):
|
class OptionsFlowHandler(OptionsFlow):
|
||||||
"""Options for the component."""
|
"""Options for the component."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
|
||||||
"""Init object."""
|
|
||||||
self.config_entry = config_entry
|
|
||||||
|
|
||||||
async def async_step_init(
|
async def async_step_init(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
@ -119,7 +115,7 @@ class DenonAvrFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
config_entry: ConfigEntry,
|
config_entry: ConfigEntry,
|
||||||
) -> OptionsFlowHandler:
|
) -> OptionsFlowHandler:
|
||||||
"""Get the options flow."""
|
"""Get the options flow."""
|
||||||
return OptionsFlowHandler(config_entry)
|
return OptionsFlowHandler()
|
||||||
|
|
||||||
async def async_step_user(
|
async def async_step_user(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
|
@ -69,16 +69,12 @@ class DexcomConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
config_entry: ConfigEntry,
|
config_entry: ConfigEntry,
|
||||||
) -> DexcomOptionsFlowHandler:
|
) -> DexcomOptionsFlowHandler:
|
||||||
"""Get the options flow for this handler."""
|
"""Get the options flow for this handler."""
|
||||||
return DexcomOptionsFlowHandler(config_entry)
|
return DexcomOptionsFlowHandler()
|
||||||
|
|
||||||
|
|
||||||
class DexcomOptionsFlowHandler(OptionsFlow):
|
class DexcomOptionsFlowHandler(OptionsFlow):
|
||||||
"""Handle a option flow for Dexcom."""
|
"""Handle a option flow for Dexcom."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
|
||||||
"""Initialize options flow."""
|
|
||||||
self.config_entry = config_entry
|
|
||||||
|
|
||||||
async def async_step_init(
|
async def async_step_init(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
|
@ -74,7 +74,7 @@ class DlnaDmrFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
config_entry: ConfigEntry,
|
config_entry: ConfigEntry,
|
||||||
) -> OptionsFlow:
|
) -> OptionsFlow:
|
||||||
"""Define the config flow to handle options."""
|
"""Define the config flow to handle options."""
|
||||||
return DlnaDmrOptionsFlowHandler(config_entry)
|
return DlnaDmrOptionsFlowHandler()
|
||||||
|
|
||||||
async def async_step_user(self, user_input: FlowInput = None) -> ConfigFlowResult:
|
async def async_step_user(self, user_input: FlowInput = None) -> ConfigFlowResult:
|
||||||
"""Handle a flow initialized by the user.
|
"""Handle a flow initialized by the user.
|
||||||
@ -327,10 +327,6 @@ class DlnaDmrOptionsFlowHandler(OptionsFlow):
|
|||||||
Configures the single instance and updates the existing config entry.
|
Configures the single instance and updates the existing config entry.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
|
||||||
"""Initialize."""
|
|
||||||
self.config_entry = config_entry
|
|
||||||
|
|
||||||
async def async_step_init(
|
async def async_step_init(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
|
@ -213,16 +213,12 @@ class DoorBirdConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
config_entry: ConfigEntry,
|
config_entry: ConfigEntry,
|
||||||
) -> OptionsFlowHandler:
|
) -> OptionsFlowHandler:
|
||||||
"""Get the options flow for this handler."""
|
"""Get the options flow for this handler."""
|
||||||
return OptionsFlowHandler(config_entry)
|
return OptionsFlowHandler()
|
||||||
|
|
||||||
|
|
||||||
class OptionsFlowHandler(OptionsFlow):
|
class OptionsFlowHandler(OptionsFlow):
|
||||||
"""Handle a option flow for doorbird."""
|
"""Handle a option flow for doorbird."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
|
||||||
"""Initialize options flow."""
|
|
||||||
self.config_entry = config_entry
|
|
||||||
|
|
||||||
async def async_step_init(
|
async def async_step_init(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
|
@ -482,16 +482,12 @@ class EsphomeFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
config_entry: ConfigEntry,
|
config_entry: ConfigEntry,
|
||||||
) -> OptionsFlowHandler:
|
) -> OptionsFlowHandler:
|
||||||
"""Get the options flow for this handler."""
|
"""Get the options flow for this handler."""
|
||||||
return OptionsFlowHandler(config_entry)
|
return OptionsFlowHandler()
|
||||||
|
|
||||||
|
|
||||||
class OptionsFlowHandler(OptionsFlow):
|
class OptionsFlowHandler(OptionsFlow):
|
||||||
"""Handle a option flow for esphome."""
|
"""Handle a option flow for esphome."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
|
||||||
"""Initialize options flow."""
|
|
||||||
self.config_entry = config_entry
|
|
||||||
|
|
||||||
async def async_step_init(
|
async def async_step_init(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
|
@ -150,7 +150,7 @@ class EzvizConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
@callback
|
@callback
|
||||||
def async_get_options_flow(config_entry: ConfigEntry) -> EzvizOptionsFlowHandler:
|
def async_get_options_flow(config_entry: ConfigEntry) -> EzvizOptionsFlowHandler:
|
||||||
"""Get the options flow for this handler."""
|
"""Get the options flow for this handler."""
|
||||||
return EzvizOptionsFlowHandler(config_entry)
|
return EzvizOptionsFlowHandler()
|
||||||
|
|
||||||
async def async_step_user(
|
async def async_step_user(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
@ -391,10 +391,6 @@ class EzvizConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
class EzvizOptionsFlowHandler(OptionsFlow):
|
class EzvizOptionsFlowHandler(OptionsFlow):
|
||||||
"""Handle EZVIZ client options."""
|
"""Handle EZVIZ client options."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
|
||||||
"""Initialize options flow."""
|
|
||||||
self.config_entry = config_entry
|
|
||||||
|
|
||||||
async def async_step_init(
|
async def async_step_init(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
|
@ -41,7 +41,7 @@ class ForecastSolarFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
config_entry: ConfigEntry,
|
config_entry: ConfigEntry,
|
||||||
) -> ForecastSolarOptionFlowHandler:
|
) -> ForecastSolarOptionFlowHandler:
|
||||||
"""Get the options flow for this handler."""
|
"""Get the options flow for this handler."""
|
||||||
return ForecastSolarOptionFlowHandler(config_entry)
|
return ForecastSolarOptionFlowHandler()
|
||||||
|
|
||||||
async def async_step_user(
|
async def async_step_user(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
@ -91,10 +91,6 @@ class ForecastSolarFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
class ForecastSolarOptionFlowHandler(OptionsFlow):
|
class ForecastSolarOptionFlowHandler(OptionsFlow):
|
||||||
"""Handle options."""
|
"""Handle options."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
|
||||||
"""Initialize options flow."""
|
|
||||||
self.config_entry = config_entry
|
|
||||||
|
|
||||||
async def async_step_init(
|
async def async_step_init(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
|
@ -52,10 +52,6 @@ TEST_CONNECTION_ERROR_DICT = {
|
|||||||
class ForkedDaapdOptionsFlowHandler(OptionsFlow):
|
class ForkedDaapdOptionsFlowHandler(OptionsFlow):
|
||||||
"""Handle a forked-daapd options flow."""
|
"""Handle a forked-daapd options flow."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
|
||||||
"""Initialize."""
|
|
||||||
self.config_entry = config_entry
|
|
||||||
|
|
||||||
async def async_step_init(
|
async def async_step_init(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
@ -122,7 +118,7 @@ class ForkedDaapdFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
config_entry: ConfigEntry,
|
config_entry: ConfigEntry,
|
||||||
) -> ForkedDaapdOptionsFlowHandler:
|
) -> ForkedDaapdOptionsFlowHandler:
|
||||||
"""Return options flow handler."""
|
"""Return options flow handler."""
|
||||||
return ForkedDaapdOptionsFlowHandler(config_entry)
|
return ForkedDaapdOptionsFlowHandler()
|
||||||
|
|
||||||
async def validate_input(self, user_input):
|
async def validate_input(self, user_input):
|
||||||
"""Validate the user input."""
|
"""Validate the user input."""
|
||||||
|
@ -141,7 +141,7 @@ class FritzBoxCallMonitorConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
config_entry: ConfigEntry,
|
config_entry: ConfigEntry,
|
||||||
) -> FritzBoxCallMonitorOptionsFlowHandler:
|
) -> FritzBoxCallMonitorOptionsFlowHandler:
|
||||||
"""Get the options flow for this handler."""
|
"""Get the options flow for this handler."""
|
||||||
return FritzBoxCallMonitorOptionsFlowHandler(config_entry)
|
return FritzBoxCallMonitorOptionsFlowHandler()
|
||||||
|
|
||||||
async def async_step_user(
|
async def async_step_user(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
@ -278,10 +278,6 @@ class FritzBoxCallMonitorConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
class FritzBoxCallMonitorOptionsFlowHandler(OptionsFlow):
|
class FritzBoxCallMonitorOptionsFlowHandler(OptionsFlow):
|
||||||
"""Handle a fritzbox_callmonitor options flow."""
|
"""Handle a fritzbox_callmonitor options flow."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
|
||||||
"""Initialize."""
|
|
||||||
self.config_entry = config_entry
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def _are_prefixes_valid(cls, prefixes: str | None) -> bool:
|
def _are_prefixes_valid(cls, prefixes: str | None) -> bool:
|
||||||
"""Check if prefixes are valid."""
|
"""Check if prefixes are valid."""
|
||||||
|
@ -211,16 +211,12 @@ class GitHubConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
config_entry: ConfigEntry,
|
config_entry: ConfigEntry,
|
||||||
) -> OptionsFlowHandler:
|
) -> OptionsFlowHandler:
|
||||||
"""Get the options flow for this handler."""
|
"""Get the options flow for this handler."""
|
||||||
return OptionsFlowHandler(config_entry)
|
return OptionsFlowHandler()
|
||||||
|
|
||||||
|
|
||||||
class OptionsFlowHandler(OptionsFlow):
|
class OptionsFlowHandler(OptionsFlow):
|
||||||
"""Handle a option flow for GitHub."""
|
"""Handle a option flow for GitHub."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
|
||||||
"""Initialize options flow."""
|
|
||||||
self.config_entry = config_entry
|
|
||||||
|
|
||||||
async def async_step_init(
|
async def async_step_init(
|
||||||
self,
|
self,
|
||||||
user_input: dict[str, Any] | None = None,
|
user_input: dict[str, Any] | None = None,
|
||||||
|
@ -238,16 +238,12 @@ class OAuth2FlowHandler(
|
|||||||
config_entry: ConfigEntry,
|
config_entry: ConfigEntry,
|
||||||
) -> OptionsFlow:
|
) -> OptionsFlow:
|
||||||
"""Create an options flow."""
|
"""Create an options flow."""
|
||||||
return OptionsFlowHandler(config_entry)
|
return OptionsFlowHandler()
|
||||||
|
|
||||||
|
|
||||||
class OptionsFlowHandler(OptionsFlow):
|
class OptionsFlowHandler(OptionsFlow):
|
||||||
"""Google Calendar options flow."""
|
"""Google Calendar options flow."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
|
||||||
"""Initialize options flow."""
|
|
||||||
self.config_entry = config_entry
|
|
||||||
|
|
||||||
async def async_step_init(
|
async def async_step_init(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
|
@ -84,16 +84,12 @@ class OAuth2FlowHandler(
|
|||||||
config_entry: ConfigEntry,
|
config_entry: ConfigEntry,
|
||||||
) -> OptionsFlow:
|
) -> OptionsFlow:
|
||||||
"""Create the options flow."""
|
"""Create the options flow."""
|
||||||
return OptionsFlowHandler(config_entry)
|
return OptionsFlowHandler()
|
||||||
|
|
||||||
|
|
||||||
class OptionsFlowHandler(OptionsFlow):
|
class OptionsFlowHandler(OptionsFlow):
|
||||||
"""Google Assistant SDK options flow."""
|
"""Google Assistant SDK options flow."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
|
||||||
"""Initialize options flow."""
|
|
||||||
self.config_entry = config_entry
|
|
||||||
|
|
||||||
async def async_step_init(
|
async def async_step_init(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
|
@ -148,10 +148,6 @@ def default_options(hass: HomeAssistant) -> dict[str, str]:
|
|||||||
class GoogleOptionsFlow(OptionsFlow):
|
class GoogleOptionsFlow(OptionsFlow):
|
||||||
"""Handle an options flow for Google Travel Time."""
|
"""Handle an options flow for Google Travel Time."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
|
||||||
"""Initialize google options flow."""
|
|
||||||
self.config_entry = config_entry
|
|
||||||
|
|
||||||
async def async_step_init(self, user_input=None) -> ConfigFlowResult:
|
async def async_step_init(self, user_input=None) -> ConfigFlowResult:
|
||||||
"""Handle the initial step."""
|
"""Handle the initial step."""
|
||||||
if user_input is not None:
|
if user_input is not None:
|
||||||
@ -213,7 +209,7 @@ class GoogleTravelTimeConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
config_entry: ConfigEntry,
|
config_entry: ConfigEntry,
|
||||||
) -> GoogleOptionsFlow:
|
) -> GoogleOptionsFlow:
|
||||||
"""Get the options flow for this handler."""
|
"""Get the options flow for this handler."""
|
||||||
return GoogleOptionsFlow(config_entry)
|
return GoogleOptionsFlow()
|
||||||
|
|
||||||
async def async_step_user(self, user_input=None) -> ConfigFlowResult:
|
async def async_step_user(self, user_input=None) -> ConfigFlowResult:
|
||||||
"""Handle the initial step."""
|
"""Handle the initial step."""
|
||||||
|
@ -28,7 +28,6 @@ from homeassistant.core import callback
|
|||||||
from homeassistant.exceptions import HomeAssistantError
|
from homeassistant.exceptions import HomeAssistantError
|
||||||
|
|
||||||
from .const import DOMAIN, PREVIOUS_ACTIVE_ACTIVITY, UNIQUE_ID
|
from .const import DOMAIN, PREVIOUS_ACTIVE_ACTIVITY, UNIQUE_ID
|
||||||
from .data import HarmonyConfigEntry
|
|
||||||
from .util import (
|
from .util import (
|
||||||
find_best_name_for_remote,
|
find_best_name_for_remote,
|
||||||
find_unique_id_for_remote,
|
find_unique_id_for_remote,
|
||||||
@ -156,7 +155,7 @@ class HarmonyConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
config_entry: ConfigEntry,
|
config_entry: ConfigEntry,
|
||||||
) -> OptionsFlowHandler:
|
) -> OptionsFlowHandler:
|
||||||
"""Get the options flow for this handler."""
|
"""Get the options flow for this handler."""
|
||||||
return OptionsFlowHandler(config_entry)
|
return OptionsFlowHandler()
|
||||||
|
|
||||||
async def _async_create_entry_from_valid_input(
|
async def _async_create_entry_from_valid_input(
|
||||||
self, validated: dict[str, Any], user_input: dict[str, Any]
|
self, validated: dict[str, Any], user_input: dict[str, Any]
|
||||||
@ -186,10 +185,6 @@ def _options_from_user_input(user_input: dict[str, Any]) -> dict[str, Any]:
|
|||||||
class OptionsFlowHandler(OptionsFlow):
|
class OptionsFlowHandler(OptionsFlow):
|
||||||
"""Handle a option flow for Harmony."""
|
"""Handle a option flow for Harmony."""
|
||||||
|
|
||||||
def __init__(self, config_entry: HarmonyConfigEntry) -> None:
|
|
||||||
"""Initialize options flow."""
|
|
||||||
self.config_entry = config_entry
|
|
||||||
|
|
||||||
async def async_step_init(
|
async def async_step_init(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
|
@ -129,16 +129,12 @@ class HoneywellConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
config_entry: ConfigEntry,
|
config_entry: ConfigEntry,
|
||||||
) -> HoneywellOptionsFlowHandler:
|
) -> HoneywellOptionsFlowHandler:
|
||||||
"""Options callback for Honeywell."""
|
"""Options callback for Honeywell."""
|
||||||
return HoneywellOptionsFlowHandler(config_entry)
|
return HoneywellOptionsFlowHandler()
|
||||||
|
|
||||||
|
|
||||||
class HoneywellOptionsFlowHandler(OptionsFlow):
|
class HoneywellOptionsFlowHandler(OptionsFlow):
|
||||||
"""Config flow options for Honeywell."""
|
"""Config flow options for Honeywell."""
|
||||||
|
|
||||||
def __init__(self, entry: ConfigEntry) -> None:
|
|
||||||
"""Initialize Honeywell options flow."""
|
|
||||||
self.config_entry = entry
|
|
||||||
|
|
||||||
async def async_step_init(self, user_input=None) -> ConfigFlowResult:
|
async def async_step_init(self, user_input=None) -> ConfigFlowResult:
|
||||||
"""Manage the options."""
|
"""Manage the options."""
|
||||||
if user_input is not None:
|
if user_input is not None:
|
||||||
|
@ -69,7 +69,7 @@ class ConfigFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
config_entry: ConfigEntry,
|
config_entry: ConfigEntry,
|
||||||
) -> OptionsFlowHandler:
|
) -> OptionsFlowHandler:
|
||||||
"""Get options flow."""
|
"""Get options flow."""
|
||||||
return OptionsFlowHandler(config_entry)
|
return OptionsFlowHandler()
|
||||||
|
|
||||||
async def _async_show_user_form(
|
async def _async_show_user_form(
|
||||||
self,
|
self,
|
||||||
@ -345,10 +345,6 @@ class ConfigFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
class OptionsFlowHandler(OptionsFlow):
|
class OptionsFlowHandler(OptionsFlow):
|
||||||
"""Huawei LTE options flow."""
|
"""Huawei LTE options flow."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
|
||||||
"""Initialize options flow."""
|
|
||||||
self.config_entry = config_entry
|
|
||||||
|
|
||||||
async def async_step_init(
|
async def async_step_init(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
|
@ -57,8 +57,8 @@ class HueFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
) -> HueV1OptionsFlowHandler | HueV2OptionsFlowHandler:
|
) -> HueV1OptionsFlowHandler | HueV2OptionsFlowHandler:
|
||||||
"""Get the options flow for this handler."""
|
"""Get the options flow for this handler."""
|
||||||
if config_entry.data.get(CONF_API_VERSION, 1) == 1:
|
if config_entry.data.get(CONF_API_VERSION, 1) == 1:
|
||||||
return HueV1OptionsFlowHandler(config_entry)
|
return HueV1OptionsFlowHandler()
|
||||||
return HueV2OptionsFlowHandler(config_entry)
|
return HueV2OptionsFlowHandler()
|
||||||
|
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
"""Initialize the Hue flow."""
|
"""Initialize the Hue flow."""
|
||||||
@ -280,10 +280,6 @@ class HueFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
class HueV1OptionsFlowHandler(OptionsFlow):
|
class HueV1OptionsFlowHandler(OptionsFlow):
|
||||||
"""Handle Hue options for V1 implementation."""
|
"""Handle Hue options for V1 implementation."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
|
||||||
"""Initialize Hue options flow."""
|
|
||||||
self.config_entry = config_entry
|
|
||||||
|
|
||||||
async def async_step_init(
|
async def async_step_init(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
@ -315,10 +311,6 @@ class HueV1OptionsFlowHandler(OptionsFlow):
|
|||||||
class HueV2OptionsFlowHandler(OptionsFlow):
|
class HueV2OptionsFlowHandler(OptionsFlow):
|
||||||
"""Handle Hue options for V2 implementation."""
|
"""Handle Hue options for V2 implementation."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
|
||||||
"""Initialize Hue options flow."""
|
|
||||||
self.config_entry = config_entry
|
|
||||||
|
|
||||||
async def async_step_init(
|
async def async_step_init(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
|
@ -44,16 +44,12 @@ class IBeaconConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
config_entry: ConfigEntry,
|
config_entry: ConfigEntry,
|
||||||
) -> OptionsFlow:
|
) -> OptionsFlow:
|
||||||
"""Get the options flow for this handler."""
|
"""Get the options flow for this handler."""
|
||||||
return IBeaconOptionsFlow(config_entry)
|
return IBeaconOptionsFlow()
|
||||||
|
|
||||||
|
|
||||||
class IBeaconOptionsFlow(OptionsFlow):
|
class IBeaconOptionsFlow(OptionsFlow):
|
||||||
"""Handle options."""
|
"""Handle options."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
|
||||||
"""Initialize options flow."""
|
|
||||||
self.config_entry = config_entry
|
|
||||||
|
|
||||||
async def async_step_init(self, user_input: dict | None = None) -> ConfigFlowResult:
|
async def async_step_init(self, user_input: dict | None = None) -> ConfigFlowResult:
|
||||||
"""Manage the options."""
|
"""Manage the options."""
|
||||||
errors = {}
|
errors = {}
|
||||||
|
@ -52,7 +52,7 @@ class IslamicPrayerFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
config_entry: ConfigEntry,
|
config_entry: ConfigEntry,
|
||||||
) -> IslamicPrayerOptionsFlowHandler:
|
) -> IslamicPrayerOptionsFlowHandler:
|
||||||
"""Get the options flow for this handler."""
|
"""Get the options flow for this handler."""
|
||||||
return IslamicPrayerOptionsFlowHandler(config_entry)
|
return IslamicPrayerOptionsFlowHandler()
|
||||||
|
|
||||||
async def async_step_user(
|
async def async_step_user(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
@ -93,10 +93,6 @@ class IslamicPrayerFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
class IslamicPrayerOptionsFlowHandler(OptionsFlow):
|
class IslamicPrayerOptionsFlowHandler(OptionsFlow):
|
||||||
"""Handle Islamic Prayer client options."""
|
"""Handle Islamic Prayer client options."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
|
||||||
"""Initialize options flow."""
|
|
||||||
self.config_entry = config_entry
|
|
||||||
|
|
||||||
async def async_step_init(
|
async def async_step_init(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
|
@ -140,7 +140,7 @@ class Isy994ConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
config_entry: ConfigEntry,
|
config_entry: ConfigEntry,
|
||||||
) -> OptionsFlow:
|
) -> OptionsFlow:
|
||||||
"""Get the options flow for this handler."""
|
"""Get the options flow for this handler."""
|
||||||
return OptionsFlowHandler(config_entry)
|
return OptionsFlowHandler()
|
||||||
|
|
||||||
async def async_step_user(
|
async def async_step_user(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
@ -314,10 +314,6 @@ class Isy994ConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
class OptionsFlowHandler(OptionsFlow):
|
class OptionsFlowHandler(OptionsFlow):
|
||||||
"""Handle a option flow for ISY/IoX."""
|
"""Handle a option flow for ISY/IoX."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
|
||||||
"""Initialize options flow."""
|
|
||||||
self.config_entry = config_entry
|
|
||||||
|
|
||||||
async def async_step_init(
|
async def async_step_init(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
|
@ -66,7 +66,7 @@ class KmtronicConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
config_entry: ConfigEntry,
|
config_entry: ConfigEntry,
|
||||||
) -> KMTronicOptionsFlow:
|
) -> KMTronicOptionsFlow:
|
||||||
"""Get the options flow for this handler."""
|
"""Get the options flow for this handler."""
|
||||||
return KMTronicOptionsFlow(config_entry)
|
return KMTronicOptionsFlow()
|
||||||
|
|
||||||
async def async_step_user(
|
async def async_step_user(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
@ -102,10 +102,6 @@ class InvalidAuth(HomeAssistantError):
|
|||||||
class KMTronicOptionsFlow(OptionsFlow):
|
class KMTronicOptionsFlow(OptionsFlow):
|
||||||
"""Handle options."""
|
"""Handle options."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
|
||||||
"""Initialize options flow."""
|
|
||||||
self.config_entry = config_entry
|
|
||||||
|
|
||||||
async def async_step_init(
|
async def async_step_init(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
|
@ -33,7 +33,7 @@ class KrakenConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
config_entry: ConfigEntry,
|
config_entry: ConfigEntry,
|
||||||
) -> KrakenOptionsFlowHandler:
|
) -> KrakenOptionsFlowHandler:
|
||||||
"""Get the options flow for this handler."""
|
"""Get the options flow for this handler."""
|
||||||
return KrakenOptionsFlowHandler(config_entry)
|
return KrakenOptionsFlowHandler()
|
||||||
|
|
||||||
async def async_step_user(
|
async def async_step_user(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
@ -53,10 +53,6 @@ class KrakenConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
class KrakenOptionsFlowHandler(OptionsFlow):
|
class KrakenOptionsFlowHandler(OptionsFlow):
|
||||||
"""Handle Kraken client options."""
|
"""Handle Kraken client options."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
|
||||||
"""Initialize Kraken options flow."""
|
|
||||||
self.config_entry = config_entry
|
|
||||||
|
|
||||||
async def async_step_init(
|
async def async_step_init(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
|
@ -24,10 +24,6 @@ from .const import CONF_DEFAULT_TRANSITION, DOMAIN
|
|||||||
class LiteJetOptionsFlow(OptionsFlow):
|
class LiteJetOptionsFlow(OptionsFlow):
|
||||||
"""Handle LiteJet options."""
|
"""Handle LiteJet options."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
|
||||||
"""Initialize LiteJet options flow."""
|
|
||||||
self.config_entry = config_entry
|
|
||||||
|
|
||||||
async def async_step_init(
|
async def async_step_init(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
@ -84,4 +80,4 @@ class LiteJetConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
config_entry: ConfigEntry,
|
config_entry: ConfigEntry,
|
||||||
) -> LiteJetOptionsFlow:
|
) -> LiteJetOptionsFlow:
|
||||||
"""Get the options flow for this handler."""
|
"""Get the options flow for this handler."""
|
||||||
return LiteJetOptionsFlow(config_entry)
|
return LiteJetOptionsFlow()
|
||||||
|
@ -46,7 +46,7 @@ class MikrotikFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
config_entry: ConfigEntry,
|
config_entry: ConfigEntry,
|
||||||
) -> MikrotikOptionsFlowHandler:
|
) -> MikrotikOptionsFlowHandler:
|
||||||
"""Get the options flow for this handler."""
|
"""Get the options flow for this handler."""
|
||||||
return MikrotikOptionsFlowHandler(config_entry)
|
return MikrotikOptionsFlowHandler()
|
||||||
|
|
||||||
async def async_step_user(
|
async def async_step_user(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
@ -122,10 +122,6 @@ class MikrotikFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
class MikrotikOptionsFlowHandler(OptionsFlow):
|
class MikrotikOptionsFlowHandler(OptionsFlow):
|
||||||
"""Handle Mikrotik options."""
|
"""Handle Mikrotik options."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
|
||||||
"""Initialize Mikrotik options flow."""
|
|
||||||
self.config_entry = config_entry
|
|
||||||
|
|
||||||
async def async_step_init(
|
async def async_step_init(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
|
@ -141,7 +141,7 @@ class MJPEGFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
config_entry: ConfigEntry,
|
config_entry: ConfigEntry,
|
||||||
) -> MJPEGOptionsFlowHandler:
|
) -> MJPEGOptionsFlowHandler:
|
||||||
"""Get the options flow for this handler."""
|
"""Get the options flow for this handler."""
|
||||||
return MJPEGOptionsFlowHandler(config_entry)
|
return MJPEGOptionsFlowHandler()
|
||||||
|
|
||||||
async def async_step_user(
|
async def async_step_user(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
@ -183,10 +183,6 @@ class MJPEGFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
class MJPEGOptionsFlowHandler(OptionsFlow):
|
class MJPEGOptionsFlowHandler(OptionsFlow):
|
||||||
"""Handle MJPEG IP Camera options."""
|
"""Handle MJPEG IP Camera options."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
|
||||||
"""Initialize MJPEG IP Camera options flow."""
|
|
||||||
self.config_entry = config_entry
|
|
||||||
|
|
||||||
async def async_step_init(
|
async def async_step_init(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
|
@ -108,7 +108,7 @@ class MonoPriceConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
config_entry: ConfigEntry,
|
config_entry: ConfigEntry,
|
||||||
) -> MonopriceOptionsFlowHandler:
|
) -> MonopriceOptionsFlowHandler:
|
||||||
"""Define the config flow to handle options."""
|
"""Define the config flow to handle options."""
|
||||||
return MonopriceOptionsFlowHandler(config_entry)
|
return MonopriceOptionsFlowHandler()
|
||||||
|
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
@ -126,10 +126,6 @@ def _key_for_source(index, source, previous_sources):
|
|||||||
class MonopriceOptionsFlowHandler(OptionsFlow):
|
class MonopriceOptionsFlowHandler(OptionsFlow):
|
||||||
"""Handle a Monoprice options flow."""
|
"""Handle a Monoprice options flow."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
|
||||||
"""Initialize."""
|
|
||||||
self.config_entry = config_entry
|
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
def _previous_sources(self):
|
def _previous_sources(self):
|
||||||
if CONF_SOURCES in self.config_entry.options:
|
if CONF_SOURCES in self.config_entry.options:
|
||||||
|
@ -58,7 +58,7 @@ class MopekaConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
config_entry: config_entries.ConfigEntry,
|
config_entry: config_entries.ConfigEntry,
|
||||||
) -> MopekaOptionsFlow:
|
) -> MopekaOptionsFlow:
|
||||||
"""Return the options flow for this handler."""
|
"""Return the options flow for this handler."""
|
||||||
return MopekaOptionsFlow(config_entry)
|
return MopekaOptionsFlow()
|
||||||
|
|
||||||
async def async_step_bluetooth(
|
async def async_step_bluetooth(
|
||||||
self, discovery_info: BluetoothServiceInfoBleak
|
self, discovery_info: BluetoothServiceInfoBleak
|
||||||
@ -139,10 +139,6 @@ class MopekaConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
class MopekaOptionsFlow(config_entries.OptionsFlow):
|
class MopekaOptionsFlow(config_entries.OptionsFlow):
|
||||||
"""Handle options for the Mopeka component."""
|
"""Handle options for the Mopeka component."""
|
||||||
|
|
||||||
def __init__(self, config_entry: config_entries.ConfigEntry) -> None:
|
|
||||||
"""Initialize options flow."""
|
|
||||||
self.config_entry = config_entry
|
|
||||||
|
|
||||||
async def async_step_init(
|
async def async_step_init(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
|
@ -38,10 +38,6 @@ CONFIG_SCHEMA = vol.Schema(
|
|||||||
class OptionsFlowHandler(OptionsFlow):
|
class OptionsFlowHandler(OptionsFlow):
|
||||||
"""Options for the component."""
|
"""Options for the component."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
|
||||||
"""Init object."""
|
|
||||||
self.config_entry = config_entry
|
|
||||||
|
|
||||||
async def async_step_init(
|
async def async_step_init(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
@ -83,7 +79,7 @@ class MotionBlindsFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
config_entry: ConfigEntry,
|
config_entry: ConfigEntry,
|
||||||
) -> OptionsFlowHandler:
|
) -> OptionsFlowHandler:
|
||||||
"""Get the options flow."""
|
"""Get the options flow."""
|
||||||
return OptionsFlowHandler(config_entry)
|
return OptionsFlowHandler()
|
||||||
|
|
||||||
async def async_step_dhcp(
|
async def async_step_dhcp(
|
||||||
self, discovery_info: dhcp.DhcpServiceInfo
|
self, discovery_info: dhcp.DhcpServiceInfo
|
||||||
|
@ -187,16 +187,12 @@ class FlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
config_entry: ConfigEntry,
|
config_entry: ConfigEntry,
|
||||||
) -> OptionsFlow:
|
) -> OptionsFlow:
|
||||||
"""Create the options flow."""
|
"""Create the options flow."""
|
||||||
return OptionsFlowHandler(config_entry)
|
return OptionsFlowHandler()
|
||||||
|
|
||||||
|
|
||||||
class OptionsFlowHandler(OptionsFlow):
|
class OptionsFlowHandler(OptionsFlow):
|
||||||
"""Handle an options flow for Motionblinds BLE."""
|
"""Handle an options flow for Motionblinds BLE."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
|
||||||
"""Initialize options flow."""
|
|
||||||
self.config_entry = config_entry
|
|
||||||
|
|
||||||
async def async_step_init(
|
async def async_step_init(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
|
@ -63,10 +63,6 @@ def _ordered_shared_schema(schema_input):
|
|||||||
class OptionsFlowHandler(OptionsFlow):
|
class OptionsFlowHandler(OptionsFlow):
|
||||||
"""Options for the component."""
|
"""Options for the component."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
|
||||||
"""Init object."""
|
|
||||||
self.config_entry = config_entry
|
|
||||||
|
|
||||||
async def async_step_init(
|
async def async_step_init(
|
||||||
self, user_input: dict[str, int] | None = None
|
self, user_input: dict[str, int] | None = None
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
@ -109,7 +105,7 @@ class NetgearFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
config_entry: ConfigEntry,
|
config_entry: ConfigEntry,
|
||||||
) -> OptionsFlowHandler:
|
) -> OptionsFlowHandler:
|
||||||
"""Get the options flow."""
|
"""Get the options flow."""
|
||||||
return OptionsFlowHandler(config_entry)
|
return OptionsFlowHandler()
|
||||||
|
|
||||||
async def _show_setup_form(
|
async def _show_setup_form(
|
||||||
self,
|
self,
|
||||||
|
@ -175,7 +175,7 @@ class NoboHubConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
config_entry: ConfigEntry,
|
config_entry: ConfigEntry,
|
||||||
) -> OptionsFlow:
|
) -> OptionsFlow:
|
||||||
"""Get the options flow for this handler."""
|
"""Get the options flow for this handler."""
|
||||||
return OptionsFlowHandler(config_entry)
|
return OptionsFlowHandler()
|
||||||
|
|
||||||
|
|
||||||
class NoboHubConnectError(HomeAssistantError):
|
class NoboHubConnectError(HomeAssistantError):
|
||||||
@ -190,10 +190,6 @@ class NoboHubConnectError(HomeAssistantError):
|
|||||||
class OptionsFlowHandler(OptionsFlow):
|
class OptionsFlowHandler(OptionsFlow):
|
||||||
"""Handles options flow for the component."""
|
"""Handles options flow for the component."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
|
||||||
"""Initialize the options flow."""
|
|
||||||
self.config_entry = config_entry
|
|
||||||
|
|
||||||
async def async_step_init(self, user_input=None) -> ConfigFlowResult:
|
async def async_step_init(self, user_input=None) -> ConfigFlowResult:
|
||||||
"""Manage the options."""
|
"""Manage the options."""
|
||||||
|
|
||||||
|
@ -235,16 +235,12 @@ class NutConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
@callback
|
@callback
|
||||||
def async_get_options_flow(config_entry: ConfigEntry) -> OptionsFlow:
|
def async_get_options_flow(config_entry: ConfigEntry) -> OptionsFlow:
|
||||||
"""Get the options flow for this handler."""
|
"""Get the options flow for this handler."""
|
||||||
return OptionsFlowHandler(config_entry)
|
return OptionsFlowHandler()
|
||||||
|
|
||||||
|
|
||||||
class OptionsFlowHandler(OptionsFlow):
|
class OptionsFlowHandler(OptionsFlow):
|
||||||
"""Handle a option flow for nut."""
|
"""Handle a option flow for nut."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
|
||||||
"""Initialize options flow."""
|
|
||||||
self.config_entry = config_entry
|
|
||||||
|
|
||||||
async def async_step_init(
|
async def async_step_init(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
|
@ -34,7 +34,7 @@ class OmniLogicConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
config_entry: ConfigEntry,
|
config_entry: ConfigEntry,
|
||||||
) -> OptionsFlowHandler:
|
) -> OptionsFlowHandler:
|
||||||
"""Get the options flow for this handler."""
|
"""Get the options flow for this handler."""
|
||||||
return OptionsFlowHandler(config_entry)
|
return OptionsFlowHandler()
|
||||||
|
|
||||||
async def async_step_user(
|
async def async_step_user(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
@ -78,10 +78,6 @@ class OmniLogicConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
class OptionsFlowHandler(OptionsFlow):
|
class OptionsFlowHandler(OptionsFlow):
|
||||||
"""Handle Omnilogic client options."""
|
"""Handle Omnilogic client options."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
|
||||||
"""Initialize options flow."""
|
|
||||||
self.config_entry = config_entry
|
|
||||||
|
|
||||||
async def async_step_init(
|
async def async_step_init(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
|
@ -49,7 +49,7 @@ class OpenThermGwConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
config_entry: ConfigEntry,
|
config_entry: ConfigEntry,
|
||||||
) -> OpenThermGwOptionsFlow:
|
) -> OpenThermGwOptionsFlow:
|
||||||
"""Get the options flow for this handler."""
|
"""Get the options flow for this handler."""
|
||||||
return OpenThermGwOptionsFlow(config_entry)
|
return OpenThermGwOptionsFlow()
|
||||||
|
|
||||||
async def async_step_init(
|
async def async_step_init(
|
||||||
self, info: dict[str, Any] | None = None
|
self, info: dict[str, Any] | None = None
|
||||||
@ -132,10 +132,6 @@ class OpenThermGwConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
class OpenThermGwOptionsFlow(OptionsFlow):
|
class OpenThermGwOptionsFlow(OptionsFlow):
|
||||||
"""Handle opentherm_gw options."""
|
"""Handle opentherm_gw options."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
|
||||||
"""Initialize the options flow."""
|
|
||||||
self.config_entry = config_entry
|
|
||||||
|
|
||||||
async def async_step_init(
|
async def async_step_init(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
|
@ -44,7 +44,7 @@ class OpenWeatherMapConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
config_entry: ConfigEntry,
|
config_entry: ConfigEntry,
|
||||||
) -> OpenWeatherMapOptionsFlow:
|
) -> OpenWeatherMapOptionsFlow:
|
||||||
"""Get the options flow for this handler."""
|
"""Get the options flow for this handler."""
|
||||||
return OpenWeatherMapOptionsFlow(config_entry)
|
return OpenWeatherMapOptionsFlow()
|
||||||
|
|
||||||
async def async_step_user(self, user_input=None) -> ConfigFlowResult:
|
async def async_step_user(self, user_input=None) -> ConfigFlowResult:
|
||||||
"""Handle a flow initialized by the user."""
|
"""Handle a flow initialized by the user."""
|
||||||
@ -97,10 +97,6 @@ class OpenWeatherMapConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
class OpenWeatherMapOptionsFlow(OptionsFlow):
|
class OpenWeatherMapOptionsFlow(OptionsFlow):
|
||||||
"""Handle options."""
|
"""Handle options."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
|
||||||
"""Initialize options flow."""
|
|
||||||
self.config_entry = config_entry
|
|
||||||
|
|
||||||
async def async_step_init(self, user_input: dict | None = None) -> ConfigFlowResult:
|
async def async_step_init(self, user_input: dict | None = None) -> ConfigFlowResult:
|
||||||
"""Manage the options."""
|
"""Manage the options."""
|
||||||
if user_input is not None:
|
if user_input is not None:
|
||||||
|
@ -66,16 +66,12 @@ class PingConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
config_entry: ConfigEntry,
|
config_entry: ConfigEntry,
|
||||||
) -> OptionsFlow:
|
) -> OptionsFlow:
|
||||||
"""Create the options flow."""
|
"""Create the options flow."""
|
||||||
return OptionsFlowHandler(config_entry)
|
return OptionsFlowHandler()
|
||||||
|
|
||||||
|
|
||||||
class OptionsFlowHandler(OptionsFlow):
|
class OptionsFlowHandler(OptionsFlow):
|
||||||
"""Handle an options flow for Ping."""
|
"""Handle an options flow for Ping."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
|
||||||
"""Initialize options flow."""
|
|
||||||
self.config_entry = config_entry
|
|
||||||
|
|
||||||
async def async_step_init(
|
async def async_step_init(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
|
@ -89,7 +89,7 @@ class ProximityConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
@callback
|
@callback
|
||||||
def async_get_options_flow(config_entry: ConfigEntry) -> OptionsFlow:
|
def async_get_options_flow(config_entry: ConfigEntry) -> OptionsFlow:
|
||||||
"""Get the options flow for this handler."""
|
"""Get the options flow for this handler."""
|
||||||
return ProximityOptionsFlow(config_entry)
|
return ProximityOptionsFlow()
|
||||||
|
|
||||||
async def async_step_user(
|
async def async_step_user(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
@ -121,10 +121,6 @@ class ProximityConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
class ProximityOptionsFlow(OptionsFlow):
|
class ProximityOptionsFlow(OptionsFlow):
|
||||||
"""Handle a option flow."""
|
"""Handle a option flow."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
|
||||||
"""Initialize options flow."""
|
|
||||||
self.config_entry = config_entry
|
|
||||||
|
|
||||||
def _user_form_schema(self, user_input: dict[str, Any]) -> vol.Schema:
|
def _user_form_schema(self, user_input: dict[str, Any]) -> vol.Schema:
|
||||||
return vol.Schema(_base_schema(user_input))
|
return vol.Schema(_base_schema(user_input))
|
||||||
|
|
||||||
|
@ -108,16 +108,12 @@ class RachioConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
config_entry: ConfigEntry,
|
config_entry: ConfigEntry,
|
||||||
) -> OptionsFlowHandler:
|
) -> OptionsFlowHandler:
|
||||||
"""Get the options flow for this handler."""
|
"""Get the options flow for this handler."""
|
||||||
return OptionsFlowHandler(config_entry)
|
return OptionsFlowHandler()
|
||||||
|
|
||||||
|
|
||||||
class OptionsFlowHandler(OptionsFlow):
|
class OptionsFlowHandler(OptionsFlow):
|
||||||
"""Handle a option flow for Rachio."""
|
"""Handle a option flow for Rachio."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
|
||||||
"""Initialize options flow."""
|
|
||||||
self.config_entry = config_entry
|
|
||||||
|
|
||||||
async def async_step_init(
|
async def async_step_init(
|
||||||
self, user_input: dict[str, int] | None = None
|
self, user_input: dict[str, int] | None = None
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
|
@ -65,7 +65,7 @@ class RainbirdConfigFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
config_entry: ConfigEntry,
|
config_entry: ConfigEntry,
|
||||||
) -> RainBirdOptionsFlowHandler:
|
) -> RainBirdOptionsFlowHandler:
|
||||||
"""Define the config flow to handle options."""
|
"""Define the config flow to handle options."""
|
||||||
return RainBirdOptionsFlowHandler(config_entry)
|
return RainBirdOptionsFlowHandler()
|
||||||
|
|
||||||
async def async_step_user(
|
async def async_step_user(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
@ -165,10 +165,6 @@ class RainbirdConfigFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
class RainBirdOptionsFlowHandler(OptionsFlow):
|
class RainBirdOptionsFlowHandler(OptionsFlow):
|
||||||
"""Handle a RainBird options flow."""
|
"""Handle a RainBird options flow."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
|
||||||
"""Initialize RainBirdOptionsFlowHandler."""
|
|
||||||
self.config_entry = config_entry
|
|
||||||
|
|
||||||
async def async_step_init(
|
async def async_step_init(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
|
@ -63,7 +63,7 @@ class RainMachineFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
config_entry: ConfigEntry,
|
config_entry: ConfigEntry,
|
||||||
) -> RainMachineOptionsFlowHandler:
|
) -> RainMachineOptionsFlowHandler:
|
||||||
"""Define the config flow to handle options."""
|
"""Define the config flow to handle options."""
|
||||||
return RainMachineOptionsFlowHandler(config_entry)
|
return RainMachineOptionsFlowHandler()
|
||||||
|
|
||||||
async def async_step_homekit(
|
async def async_step_homekit(
|
||||||
self, discovery_info: zeroconf.ZeroconfServiceInfo
|
self, discovery_info: zeroconf.ZeroconfServiceInfo
|
||||||
@ -168,10 +168,6 @@ class RainMachineFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
class RainMachineOptionsFlowHandler(OptionsFlow):
|
class RainMachineOptionsFlowHandler(OptionsFlow):
|
||||||
"""Handle a RainMachine options flow."""
|
"""Handle a RainMachine options flow."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
|
||||||
"""Initialize."""
|
|
||||||
self.config_entry = config_entry
|
|
||||||
|
|
||||||
async def async_step_init(
|
async def async_step_init(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
|
@ -54,10 +54,6 @@ DEFAULT_OPTIONS = {CONF_PROTOCOL: DEFAULT_PROTOCOL}
|
|||||||
class ReolinkOptionsFlowHandler(OptionsFlow):
|
class ReolinkOptionsFlowHandler(OptionsFlow):
|
||||||
"""Handle Reolink options."""
|
"""Handle Reolink options."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ReolinkConfigEntry) -> None:
|
|
||||||
"""Initialize ReolinkOptionsFlowHandler."""
|
|
||||||
self.config_entry = config_entry
|
|
||||||
|
|
||||||
async def async_step_init(
|
async def async_step_init(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
@ -112,7 +108,7 @@ class ReolinkFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
config_entry: ReolinkConfigEntry,
|
config_entry: ReolinkConfigEntry,
|
||||||
) -> ReolinkOptionsFlowHandler:
|
) -> ReolinkOptionsFlowHandler:
|
||||||
"""Options callback for Reolink."""
|
"""Options callback for Reolink."""
|
||||||
return ReolinkOptionsFlowHandler(config_entry)
|
return ReolinkOptionsFlowHandler()
|
||||||
|
|
||||||
async def async_step_reauth(
|
async def async_step_reauth(
|
||||||
self, entry_data: Mapping[str, Any]
|
self, entry_data: Mapping[str, Any]
|
||||||
|
@ -119,16 +119,12 @@ class RTSPToWebRTCConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
config_entry: ConfigEntry,
|
config_entry: ConfigEntry,
|
||||||
) -> OptionsFlow:
|
) -> OptionsFlow:
|
||||||
"""Create an options flow."""
|
"""Create an options flow."""
|
||||||
return OptionsFlowHandler(config_entry)
|
return OptionsFlowHandler()
|
||||||
|
|
||||||
|
|
||||||
class OptionsFlowHandler(OptionsFlow):
|
class OptionsFlowHandler(OptionsFlow):
|
||||||
"""RTSPtoWeb Options flow."""
|
"""RTSPtoWeb Options flow."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
|
||||||
"""Initialize options flow."""
|
|
||||||
self.config_entry = config_entry
|
|
||||||
|
|
||||||
async def async_step_init(
|
async def async_step_init(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
|
@ -81,7 +81,7 @@ class ScreenlogicConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
config_entry: ConfigEntry,
|
config_entry: ConfigEntry,
|
||||||
) -> ScreenLogicOptionsFlowHandler:
|
) -> ScreenLogicOptionsFlowHandler:
|
||||||
"""Get the options flow for ScreenLogic."""
|
"""Get the options flow for ScreenLogic."""
|
||||||
return ScreenLogicOptionsFlowHandler(config_entry)
|
return ScreenLogicOptionsFlowHandler()
|
||||||
|
|
||||||
async def async_step_user(
|
async def async_step_user(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
@ -192,10 +192,6 @@ class ScreenlogicConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
class ScreenLogicOptionsFlowHandler(OptionsFlow):
|
class ScreenLogicOptionsFlowHandler(OptionsFlow):
|
||||||
"""Handles the options for the ScreenLogic integration."""
|
"""Handles the options for the ScreenLogic integration."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
|
||||||
"""Init the screen logic options flow."""
|
|
||||||
self.config_entry = config_entry
|
|
||||||
|
|
||||||
async def async_step_init(self, user_input=None) -> ConfigFlowResult:
|
async def async_step_init(self, user_input=None) -> ConfigFlowResult:
|
||||||
"""Manage the options."""
|
"""Manage the options."""
|
||||||
if user_input is not None:
|
if user_input is not None:
|
||||||
|
@ -49,7 +49,7 @@ class SentryConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
config_entry: ConfigEntry,
|
config_entry: ConfigEntry,
|
||||||
) -> SentryOptionsFlow:
|
) -> SentryOptionsFlow:
|
||||||
"""Get the options flow for this handler."""
|
"""Get the options flow for this handler."""
|
||||||
return SentryOptionsFlow(config_entry)
|
return SentryOptionsFlow()
|
||||||
|
|
||||||
async def async_step_user(
|
async def async_step_user(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
@ -78,10 +78,6 @@ class SentryConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
class SentryOptionsFlow(OptionsFlow):
|
class SentryOptionsFlow(OptionsFlow):
|
||||||
"""Handle Sentry options."""
|
"""Handle Sentry options."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
|
||||||
"""Initialize Sentry options flow."""
|
|
||||||
self.config_entry = config_entry
|
|
||||||
|
|
||||||
async def async_step_init(
|
async def async_step_init(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
|
@ -444,7 +444,7 @@ class ShellyConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
@callback
|
@callback
|
||||||
def async_get_options_flow(config_entry: ConfigEntry) -> OptionsFlowHandler:
|
def async_get_options_flow(config_entry: ConfigEntry) -> OptionsFlowHandler:
|
||||||
"""Get the options flow for this handler."""
|
"""Get the options flow for this handler."""
|
||||||
return OptionsFlowHandler(config_entry)
|
return OptionsFlowHandler()
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@callback
|
@callback
|
||||||
@ -460,10 +460,6 @@ class ShellyConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
class OptionsFlowHandler(OptionsFlow):
|
class OptionsFlowHandler(OptionsFlow):
|
||||||
"""Handle the option flow for shelly."""
|
"""Handle the option flow for shelly."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
|
||||||
"""Initialize options flow."""
|
|
||||||
self.config_entry = config_entry
|
|
||||||
|
|
||||||
async def async_step_init(
|
async def async_step_init(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
|
@ -67,7 +67,7 @@ class SimpliSafeFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
config_entry: ConfigEntry,
|
config_entry: ConfigEntry,
|
||||||
) -> SimpliSafeOptionsFlowHandler:
|
) -> SimpliSafeOptionsFlowHandler:
|
||||||
"""Define the config flow to handle options."""
|
"""Define the config flow to handle options."""
|
||||||
return SimpliSafeOptionsFlowHandler(config_entry)
|
return SimpliSafeOptionsFlowHandler()
|
||||||
|
|
||||||
async def async_step_reauth(
|
async def async_step_reauth(
|
||||||
self, entry_data: Mapping[str, Any]
|
self, entry_data: Mapping[str, Any]
|
||||||
@ -153,10 +153,6 @@ class SimpliSafeFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
class SimpliSafeOptionsFlowHandler(OptionsFlow):
|
class SimpliSafeOptionsFlowHandler(OptionsFlow):
|
||||||
"""Handle a SimpliSafe options flow."""
|
"""Handle a SimpliSafe options flow."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
|
||||||
"""Initialize."""
|
|
||||||
self.config_entry = config_entry
|
|
||||||
|
|
||||||
async def async_step_init(
|
async def async_step_init(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
|
@ -63,7 +63,7 @@ class SonarrConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
@callback
|
@callback
|
||||||
def async_get_options_flow(config_entry: ConfigEntry) -> SonarrOptionsFlowHandler:
|
def async_get_options_flow(config_entry: ConfigEntry) -> SonarrOptionsFlowHandler:
|
||||||
"""Get the options flow for this handler."""
|
"""Get the options flow for this handler."""
|
||||||
return SonarrOptionsFlowHandler(config_entry)
|
return SonarrOptionsFlowHandler()
|
||||||
|
|
||||||
async def async_step_reauth(
|
async def async_step_reauth(
|
||||||
self, entry_data: Mapping[str, Any]
|
self, entry_data: Mapping[str, Any]
|
||||||
@ -148,10 +148,6 @@ class SonarrConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
class SonarrOptionsFlowHandler(OptionsFlow):
|
class SonarrOptionsFlowHandler(OptionsFlow):
|
||||||
"""Handle Sonarr client options."""
|
"""Handle Sonarr client options."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
|
||||||
"""Initialize options flow."""
|
|
||||||
self.config_entry = config_entry
|
|
||||||
|
|
||||||
async def async_step_init(
|
async def async_step_init(
|
||||||
self, user_input: dict[str, int] | None = None
|
self, user_input: dict[str, int] | None = None
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
|
@ -106,7 +106,7 @@ class SubaruConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
config_entry: ConfigEntry,
|
config_entry: ConfigEntry,
|
||||||
) -> OptionsFlowHandler:
|
) -> OptionsFlowHandler:
|
||||||
"""Get the options flow for this handler."""
|
"""Get the options flow for this handler."""
|
||||||
return OptionsFlowHandler(config_entry)
|
return OptionsFlowHandler()
|
||||||
|
|
||||||
async def validate_login_creds(self, data):
|
async def validate_login_creds(self, data):
|
||||||
"""Validate the user input allows us to connect.
|
"""Validate the user input allows us to connect.
|
||||||
@ -218,10 +218,6 @@ class SubaruConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
class OptionsFlowHandler(OptionsFlow):
|
class OptionsFlowHandler(OptionsFlow):
|
||||||
"""Handle a option flow for Subaru."""
|
"""Handle a option flow for Subaru."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
|
||||||
"""Initialize options flow."""
|
|
||||||
self.config_entry = config_entry
|
|
||||||
|
|
||||||
async def async_step_init(
|
async def async_step_init(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
|
@ -80,7 +80,7 @@ class SwitchbotConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
config_entry: ConfigEntry,
|
config_entry: ConfigEntry,
|
||||||
) -> SwitchbotOptionsFlowHandler:
|
) -> SwitchbotOptionsFlowHandler:
|
||||||
"""Get the options flow for this handler."""
|
"""Get the options flow for this handler."""
|
||||||
return SwitchbotOptionsFlowHandler(config_entry)
|
return SwitchbotOptionsFlowHandler()
|
||||||
|
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
"""Initialize the config flow."""
|
"""Initialize the config flow."""
|
||||||
@ -346,10 +346,6 @@ class SwitchbotConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
class SwitchbotOptionsFlowHandler(OptionsFlow):
|
class SwitchbotOptionsFlowHandler(OptionsFlow):
|
||||||
"""Handle Switchbot options."""
|
"""Handle Switchbot options."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
|
||||||
"""Initialize options flow."""
|
|
||||||
self.config_entry = config_entry
|
|
||||||
|
|
||||||
async def async_step_init(
|
async def async_step_init(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
|
@ -118,7 +118,7 @@ class SynologyDSMFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
config_entry: ConfigEntry,
|
config_entry: ConfigEntry,
|
||||||
) -> SynologyDSMOptionsFlowHandler:
|
) -> SynologyDSMOptionsFlowHandler:
|
||||||
"""Get the options flow for this handler."""
|
"""Get the options flow for this handler."""
|
||||||
return SynologyDSMOptionsFlowHandler(config_entry)
|
return SynologyDSMOptionsFlowHandler()
|
||||||
|
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
"""Initialize the synology_dsm config flow."""
|
"""Initialize the synology_dsm config flow."""
|
||||||
@ -376,10 +376,6 @@ class SynologyDSMFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
class SynologyDSMOptionsFlowHandler(OptionsFlow):
|
class SynologyDSMOptionsFlowHandler(OptionsFlow):
|
||||||
"""Handle a option flow."""
|
"""Handle a option flow."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
|
||||||
"""Initialize options flow."""
|
|
||||||
self.config_entry = config_entry
|
|
||||||
|
|
||||||
async def async_step_init(
|
async def async_step_init(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
|
@ -160,16 +160,12 @@ class TadoConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
config_entry: ConfigEntry,
|
config_entry: ConfigEntry,
|
||||||
) -> OptionsFlowHandler:
|
) -> OptionsFlowHandler:
|
||||||
"""Get the options flow for this handler."""
|
"""Get the options flow for this handler."""
|
||||||
return OptionsFlowHandler(config_entry)
|
return OptionsFlowHandler()
|
||||||
|
|
||||||
|
|
||||||
class OptionsFlowHandler(OptionsFlow):
|
class OptionsFlowHandler(OptionsFlow):
|
||||||
"""Handle an option flow for Tado."""
|
"""Handle an option flow for Tado."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
|
||||||
"""Initialize options flow."""
|
|
||||||
self.config_entry = config_entry
|
|
||||||
|
|
||||||
async def async_step_init(
|
async def async_step_init(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
|
@ -193,16 +193,12 @@ class TotalConnectConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
config_entry: ConfigEntry,
|
config_entry: ConfigEntry,
|
||||||
) -> TotalConnectOptionsFlowHandler:
|
) -> TotalConnectOptionsFlowHandler:
|
||||||
"""Get options flow."""
|
"""Get options flow."""
|
||||||
return TotalConnectOptionsFlowHandler(config_entry)
|
return TotalConnectOptionsFlowHandler()
|
||||||
|
|
||||||
|
|
||||||
class TotalConnectOptionsFlowHandler(OptionsFlow):
|
class TotalConnectOptionsFlowHandler(OptionsFlow):
|
||||||
"""TotalConnect options flow handler."""
|
"""TotalConnect options flow handler."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
|
||||||
"""Initialize options flow."""
|
|
||||||
self.config_entry = config_entry
|
|
||||||
|
|
||||||
async def async_step_init(
|
async def async_step_init(
|
||||||
self, user_input: dict[str, bool] | None = None
|
self, user_input: dict[str, bool] | None = None
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
|
@ -63,7 +63,7 @@ class TransmissionFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
config_entry: ConfigEntry,
|
config_entry: ConfigEntry,
|
||||||
) -> TransmissionOptionsFlowHandler:
|
) -> TransmissionOptionsFlowHandler:
|
||||||
"""Get the options flow for this handler."""
|
"""Get the options flow for this handler."""
|
||||||
return TransmissionOptionsFlowHandler(config_entry)
|
return TransmissionOptionsFlowHandler()
|
||||||
|
|
||||||
async def async_step_user(
|
async def async_step_user(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
@ -138,10 +138,6 @@ class TransmissionFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
class TransmissionOptionsFlowHandler(OptionsFlow):
|
class TransmissionOptionsFlowHandler(OptionsFlow):
|
||||||
"""Handle Transmission client options."""
|
"""Handle Transmission client options."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
|
||||||
"""Initialize Transmission options flow."""
|
|
||||||
self.config_entry = config_entry
|
|
||||||
|
|
||||||
async def async_step_init(
|
async def async_step_init(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
|
@ -225,7 +225,7 @@ class ProtectFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
config_entry: ConfigEntry,
|
config_entry: ConfigEntry,
|
||||||
) -> OptionsFlow:
|
) -> OptionsFlow:
|
||||||
"""Get the options flow for this handler."""
|
"""Get the options flow for this handler."""
|
||||||
return OptionsFlowHandler(config_entry)
|
return OptionsFlowHandler()
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
def _async_create_entry(self, title: str, data: dict[str, Any]) -> ConfigFlowResult:
|
def _async_create_entry(self, title: str, data: dict[str, Any]) -> ConfigFlowResult:
|
||||||
@ -376,10 +376,6 @@ class ProtectFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
class OptionsFlowHandler(OptionsFlow):
|
class OptionsFlowHandler(OptionsFlow):
|
||||||
"""Handle options."""
|
"""Handle options."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
|
||||||
"""Initialize options flow."""
|
|
||||||
self.config_entry = config_entry
|
|
||||||
|
|
||||||
async def async_step_init(
|
async def async_step_init(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
|
@ -95,16 +95,12 @@ class UpCloudConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
config_entry: ConfigEntry,
|
config_entry: ConfigEntry,
|
||||||
) -> UpCloudOptionsFlow:
|
) -> UpCloudOptionsFlow:
|
||||||
"""Get options flow."""
|
"""Get options flow."""
|
||||||
return UpCloudOptionsFlow(config_entry)
|
return UpCloudOptionsFlow()
|
||||||
|
|
||||||
|
|
||||||
class UpCloudOptionsFlow(OptionsFlow):
|
class UpCloudOptionsFlow(OptionsFlow):
|
||||||
"""UpCloud options flow."""
|
"""UpCloud options flow."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
|
||||||
"""Initialize options flow."""
|
|
||||||
self.config_entry = config_entry
|
|
||||||
|
|
||||||
async def async_step_init(
|
async def async_step_init(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
|
@ -76,10 +76,6 @@ def options_data(user_input: dict[str, str]) -> dict[str, list[int]]:
|
|||||||
class OptionsFlowHandler(OptionsFlow):
|
class OptionsFlowHandler(OptionsFlow):
|
||||||
"""Options for the component."""
|
"""Options for the component."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
|
||||||
"""Init object."""
|
|
||||||
self.config_entry = config_entry
|
|
||||||
|
|
||||||
async def async_step_init(
|
async def async_step_init(
|
||||||
self,
|
self,
|
||||||
user_input: dict[str, str] | None = None,
|
user_input: dict[str, str] | None = None,
|
||||||
@ -104,7 +100,7 @@ class VeraFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
@callback
|
@callback
|
||||||
def async_get_options_flow(config_entry: ConfigEntry) -> OptionsFlowHandler:
|
def async_get_options_flow(config_entry: ConfigEntry) -> OptionsFlowHandler:
|
||||||
"""Get the options flow."""
|
"""Get the options flow."""
|
||||||
return OptionsFlowHandler(config_entry)
|
return OptionsFlowHandler()
|
||||||
|
|
||||||
async def async_step_user(
|
async def async_step_user(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
|
@ -108,10 +108,6 @@ def _host_is_same(host1: str, host2: str) -> bool:
|
|||||||
class VizioOptionsConfigFlow(OptionsFlow):
|
class VizioOptionsConfigFlow(OptionsFlow):
|
||||||
"""Handle Vizio options."""
|
"""Handle Vizio options."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
|
||||||
"""Initialize vizio options flow."""
|
|
||||||
self.config_entry = config_entry
|
|
||||||
|
|
||||||
async def async_step_init(
|
async def async_step_init(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
@ -184,7 +180,7 @@ class VizioConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
@callback
|
@callback
|
||||||
def async_get_options_flow(config_entry: ConfigEntry) -> VizioOptionsConfigFlow:
|
def async_get_options_flow(config_entry: ConfigEntry) -> VizioOptionsConfigFlow:
|
||||||
"""Get the options flow for this handler."""
|
"""Get the options flow for this handler."""
|
||||||
return VizioOptionsConfigFlow(config_entry)
|
return VizioOptionsConfigFlow()
|
||||||
|
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
"""Initialize config flow."""
|
"""Initialize config flow."""
|
||||||
|
@ -47,16 +47,12 @@ class VoIPConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
config_entry: ConfigEntry,
|
config_entry: ConfigEntry,
|
||||||
) -> OptionsFlow:
|
) -> OptionsFlow:
|
||||||
"""Create the options flow."""
|
"""Create the options flow."""
|
||||||
return VoipOptionsFlowHandler(config_entry)
|
return VoipOptionsFlowHandler()
|
||||||
|
|
||||||
|
|
||||||
class VoipOptionsFlowHandler(OptionsFlow):
|
class VoipOptionsFlowHandler(OptionsFlow):
|
||||||
"""Handle VoIP options."""
|
"""Handle VoIP options."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
|
||||||
"""Initialize options flow."""
|
|
||||||
self.config_entry = config_entry
|
|
||||||
|
|
||||||
async def async_step_init(
|
async def async_step_init(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
|
@ -113,10 +113,6 @@ def default_options(hass: HomeAssistant) -> dict[str, str | bool | list[str]]:
|
|||||||
class WazeOptionsFlow(OptionsFlow):
|
class WazeOptionsFlow(OptionsFlow):
|
||||||
"""Handle an options flow for Waze Travel Time."""
|
"""Handle an options flow for Waze Travel Time."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
|
||||||
"""Initialize waze options flow."""
|
|
||||||
self.config_entry = config_entry
|
|
||||||
|
|
||||||
async def async_step_init(self, user_input=None) -> ConfigFlowResult:
|
async def async_step_init(self, user_input=None) -> ConfigFlowResult:
|
||||||
"""Handle the initial step."""
|
"""Handle the initial step."""
|
||||||
if user_input is not None:
|
if user_input is not None:
|
||||||
@ -148,7 +144,7 @@ class WazeConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
config_entry: ConfigEntry,
|
config_entry: ConfigEntry,
|
||||||
) -> WazeOptionsFlow:
|
) -> WazeOptionsFlow:
|
||||||
"""Get the options flow for this handler."""
|
"""Get the options flow for this handler."""
|
||||||
return WazeOptionsFlow(config_entry)
|
return WazeOptionsFlow()
|
||||||
|
|
||||||
async def async_step_user(
|
async def async_step_user(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
|
@ -32,16 +32,12 @@ class WemoFlow(DiscoveryFlowHandler, domain=DOMAIN):
|
|||||||
@callback
|
@callback
|
||||||
def async_get_options_flow(config_entry: ConfigEntry) -> OptionsFlow:
|
def async_get_options_flow(config_entry: ConfigEntry) -> OptionsFlow:
|
||||||
"""Get the options flow for this handler."""
|
"""Get the options flow for this handler."""
|
||||||
return WemoOptionsFlow(config_entry)
|
return WemoOptionsFlow()
|
||||||
|
|
||||||
|
|
||||||
class WemoOptionsFlow(OptionsFlow):
|
class WemoOptionsFlow(OptionsFlow):
|
||||||
"""Options flow for the WeMo component."""
|
"""Options flow for the WeMo component."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
|
||||||
"""Initialize options flow."""
|
|
||||||
self.config_entry = config_entry
|
|
||||||
|
|
||||||
async def async_step_init(
|
async def async_step_init(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
|
@ -34,7 +34,7 @@ class WiffiFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
config_entry: ConfigEntry,
|
config_entry: ConfigEntry,
|
||||||
) -> OptionsFlowHandler:
|
) -> OptionsFlowHandler:
|
||||||
"""Create Wiffi server setup option flow."""
|
"""Create Wiffi server setup option flow."""
|
||||||
return OptionsFlowHandler(config_entry)
|
return OptionsFlowHandler()
|
||||||
|
|
||||||
async def async_step_user(
|
async def async_step_user(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
@ -79,10 +79,6 @@ class WiffiFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
class OptionsFlowHandler(OptionsFlow):
|
class OptionsFlowHandler(OptionsFlow):
|
||||||
"""Wiffi server setup option flow."""
|
"""Wiffi server setup option flow."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
|
||||||
"""Initialize options flow."""
|
|
||||||
self.config_entry = config_entry
|
|
||||||
|
|
||||||
async def async_step_init(
|
async def async_step_init(
|
||||||
self, user_input: dict[str, int] | None = None
|
self, user_input: dict[str, int] | None = None
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
|
@ -130,7 +130,7 @@ class WS66iConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
config_entry: ConfigEntry,
|
config_entry: ConfigEntry,
|
||||||
) -> Ws66iOptionsFlowHandler:
|
) -> Ws66iOptionsFlowHandler:
|
||||||
"""Define the config flow to handle options."""
|
"""Define the config flow to handle options."""
|
||||||
return Ws66iOptionsFlowHandler(config_entry)
|
return Ws66iOptionsFlowHandler()
|
||||||
|
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
@ -145,10 +145,6 @@ def _key_for_source(
|
|||||||
class Ws66iOptionsFlowHandler(OptionsFlow):
|
class Ws66iOptionsFlowHandler(OptionsFlow):
|
||||||
"""Handle a WS66i options flow."""
|
"""Handle a WS66i options flow."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
|
||||||
"""Initialize."""
|
|
||||||
self.config_entry = config_entry
|
|
||||||
|
|
||||||
async def async_step_init(
|
async def async_step_init(
|
||||||
self, user_input: dict[str, str] | None = None
|
self, user_input: dict[str, str] | None = None
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
|
@ -63,10 +63,6 @@ DEVICE_CLOUD_CONFIG = vol.Schema(
|
|||||||
class OptionsFlowHandler(OptionsFlow):
|
class OptionsFlowHandler(OptionsFlow):
|
||||||
"""Options for the component."""
|
"""Options for the component."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
|
||||||
"""Init object."""
|
|
||||||
self.config_entry = config_entry
|
|
||||||
|
|
||||||
async def async_step_init(
|
async def async_step_init(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
@ -122,7 +118,7 @@ class XiaomiMiioFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
@callback
|
@callback
|
||||||
def async_get_options_flow(config_entry: ConfigEntry) -> OptionsFlowHandler:
|
def async_get_options_flow(config_entry: ConfigEntry) -> OptionsFlowHandler:
|
||||||
"""Get the options flow."""
|
"""Get the options flow."""
|
||||||
return OptionsFlowHandler(config_entry)
|
return OptionsFlowHandler()
|
||||||
|
|
||||||
async def async_step_reauth(
|
async def async_step_reauth(
|
||||||
self, entry_data: Mapping[str, Any]
|
self, entry_data: Mapping[str, Any]
|
||||||
|
@ -698,3 +698,16 @@ async def test_reauth(hass: HomeAssistant) -> None:
|
|||||||
assert mock_setup_entry.called
|
assert mock_setup_entry.called
|
||||||
assert result4["type"] is FlowResultType.ABORT
|
assert result4["type"] is FlowResultType.ABORT
|
||||||
assert result4["reason"] == "reauth_successful"
|
assert result4["reason"] == "reauth_successful"
|
||||||
|
|
||||||
|
|
||||||
|
async def test_options_flow(hass: HomeAssistant) -> None:
|
||||||
|
"""Test option flow."""
|
||||||
|
entry = MockConfigEntry(domain=DOMAIN)
|
||||||
|
entry.add_to_hass(hass)
|
||||||
|
|
||||||
|
result = await hass.config_entries.options.async_init(entry.entry_id)
|
||||||
|
assert result["type"] is FlowResultType.FORM
|
||||||
|
assert result["step_id"] == "init"
|
||||||
|
|
||||||
|
# This should be improved at a later stage to increase test coverage
|
||||||
|
hass.config_entries.options.async_abort(result["flow_id"])
|
||||||
|
@ -183,3 +183,16 @@ async def test_form_homekit_ignored(hass: HomeAssistant) -> None:
|
|||||||
)
|
)
|
||||||
assert result["type"] is FlowResultType.ABORT
|
assert result["type"] is FlowResultType.ABORT
|
||||||
assert result["reason"] == "already_configured"
|
assert result["reason"] == "already_configured"
|
||||||
|
|
||||||
|
|
||||||
|
async def test_options_flow(hass: HomeAssistant) -> None:
|
||||||
|
"""Test option flow."""
|
||||||
|
entry = MockConfigEntry(domain=DOMAIN, data={CONF_API_KEY: "api_key"})
|
||||||
|
entry.add_to_hass(hass)
|
||||||
|
|
||||||
|
result = await hass.config_entries.options.async_init(entry.entry_id)
|
||||||
|
assert result["type"] is FlowResultType.FORM
|
||||||
|
assert result["step_id"] == "init"
|
||||||
|
|
||||||
|
# This should be improved at a later stage to increase test coverage
|
||||||
|
hass.config_entries.options.async_abort(result["flow_id"])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user