Cleanup unnecessary OptionsFlowWithConfigEntry (part 1) (#129752)

* Cleanup unnecessary OptionsFlowWithConfigEntry

* Fix emoncms

* Fix imap

* Fix met

* Fix workday
pull/129311/head
epenet 2024-11-03 22:57:18 +01:00 committed by GitHub
parent 463bffaeb6
commit 8b6c99776e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
30 changed files with 135 additions and 120 deletions

View File

@ -16,7 +16,6 @@ from homeassistant.config_entries import (
ConfigFlow, ConfigFlow,
ConfigFlowResult, ConfigFlowResult,
OptionsFlow, OptionsFlow,
OptionsFlowWithConfigEntry,
) )
from homeassistant.core import callback from homeassistant.core import callback
from homeassistant.helpers.aiohttp_client import async_get_clientsession from homeassistant.helpers.aiohttp_client import async_get_clientsession
@ -46,9 +45,11 @@ class HomeassistantAnalyticsConfigFlow(ConfigFlow, domain=DOMAIN):
@staticmethod @staticmethod
@callback @callback
def async_get_options_flow(config_entry: ConfigEntry) -> OptionsFlow: def async_get_options_flow(
config_entry: ConfigEntry,
) -> HomeassistantAnalyticsOptionsFlowHandler:
"""Get the options flow for this handler.""" """Get the options flow for this handler."""
return HomeassistantAnalyticsOptionsFlowHandler(config_entry) return HomeassistantAnalyticsOptionsFlowHandler()
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
@ -132,7 +133,7 @@ class HomeassistantAnalyticsConfigFlow(ConfigFlow, domain=DOMAIN):
) )
class HomeassistantAnalyticsOptionsFlowHandler(OptionsFlowWithConfigEntry): class HomeassistantAnalyticsOptionsFlowHandler(OptionsFlow):
"""Handle Homeassistant Analytics options.""" """Handle Homeassistant Analytics options."""
async def async_step_init( async def async_step_init(

View File

@ -18,7 +18,7 @@ from homeassistant.config_entries import (
ConfigEntry, ConfigEntry,
ConfigFlow, ConfigFlow,
ConfigFlowResult, ConfigFlowResult,
OptionsFlowWithConfigEntry, OptionsFlow,
) )
from homeassistant.const import ( from homeassistant.const import (
CONF_HOST, CONF_HOST,
@ -59,9 +59,11 @@ class AxisFlowHandler(ConfigFlow, domain=AXIS_DOMAIN):
@staticmethod @staticmethod
@callback @callback
def async_get_options_flow(config_entry: ConfigEntry) -> AxisOptionsFlowHandler: def async_get_options_flow(
config_entry: ConfigEntry,
) -> AxisOptionsFlowHandler:
"""Get the options flow for this handler.""" """Get the options flow for this handler."""
return AxisOptionsFlowHandler(config_entry) return AxisOptionsFlowHandler()
def __init__(self) -> None: def __init__(self) -> None:
"""Initialize the Axis config flow.""" """Initialize the Axis config flow."""
@ -264,7 +266,7 @@ class AxisFlowHandler(ConfigFlow, domain=AXIS_DOMAIN):
return await self.async_step_user() return await self.async_step_user()
class AxisOptionsFlowHandler(OptionsFlowWithConfigEntry): class AxisOptionsFlowHandler(OptionsFlow):
"""Handle Axis device options.""" """Handle Axis device options."""
config_entry: AxisConfigEntry config_entry: AxisConfigEntry

View File

@ -17,7 +17,7 @@ from homeassistant.config_entries import (
ConfigEntry, ConfigEntry,
ConfigFlow, ConfigFlow,
ConfigFlowResult, ConfigFlowResult,
OptionsFlowWithConfigEntry, OptionsFlow,
) )
from homeassistant.const import CONF_PASSWORD, CONF_REGION, CONF_SOURCE, CONF_USERNAME from homeassistant.const import CONF_PASSWORD, CONF_REGION, CONF_SOURCE, CONF_USERNAME
from homeassistant.core import HomeAssistant, callback from homeassistant.core import HomeAssistant, callback
@ -145,10 +145,10 @@ class BMWConfigFlow(ConfigFlow, domain=DOMAIN):
config_entry: ConfigEntry, config_entry: ConfigEntry,
) -> BMWOptionsFlow: ) -> BMWOptionsFlow:
"""Return a MyBMW option flow.""" """Return a MyBMW option flow."""
return BMWOptionsFlow(config_entry) return BMWOptionsFlow()
class BMWOptionsFlow(OptionsFlowWithConfigEntry): class BMWOptionsFlow(OptionsFlow):
"""Handle a option flow for MyBMW.""" """Handle a option flow for MyBMW."""
async def async_step_init( async def async_step_init(

View File

@ -14,7 +14,7 @@ from homeassistant.config_entries import (
ConfigEntry, ConfigEntry,
ConfigFlow, ConfigFlow,
ConfigFlowResult, ConfigFlowResult,
OptionsFlowWithConfigEntry, OptionsFlow,
) )
from homeassistant.const import CONF_NAME, CONF_PORT from homeassistant.const import CONF_NAME, CONF_PORT
from homeassistant.core import callback from homeassistant.core import callback
@ -101,7 +101,7 @@ class DnsIPConfigFlow(ConfigFlow, domain=DOMAIN):
config_entry: ConfigEntry, config_entry: ConfigEntry,
) -> DnsIPOptionsFlowHandler: ) -> DnsIPOptionsFlowHandler:
"""Return Option handler.""" """Return Option handler."""
return DnsIPOptionsFlowHandler(config_entry) return DnsIPOptionsFlowHandler()
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,7 +165,7 @@ class DnsIPConfigFlow(ConfigFlow, domain=DOMAIN):
) )
class DnsIPOptionsFlowHandler(OptionsFlowWithConfigEntry): class DnsIPOptionsFlowHandler(OptionsFlow):
"""Handle a option config flow for dnsip integration.""" """Handle a option config flow for dnsip integration."""
async def async_step_init( async def async_step_init(

View File

@ -1,5 +1,7 @@
"""Configflow for the emoncms integration.""" """Configflow for the emoncms integration."""
from __future__ import annotations
from typing import Any from typing import Any
from pyemoncms import EmoncmsClient from pyemoncms import EmoncmsClient
@ -9,7 +11,7 @@ from homeassistant.config_entries import (
ConfigEntry, ConfigEntry,
ConfigFlow, ConfigFlow,
ConfigFlowResult, ConfigFlowResult,
OptionsFlowWithConfigEntry, OptionsFlow,
) )
from homeassistant.const import CONF_API_KEY, CONF_URL from homeassistant.const import CONF_API_KEY, CONF_URL
from homeassistant.core import HomeAssistant, callback from homeassistant.core import HomeAssistant, callback
@ -68,9 +70,9 @@ class EmoncmsConfigFlow(ConfigFlow, domain=DOMAIN):
@callback @callback
def async_get_options_flow( def async_get_options_flow(
config_entry: ConfigEntry, config_entry: ConfigEntry,
) -> OptionsFlowWithConfigEntry: ) -> EmoncmsOptionsFlow:
"""Get the options flow for this handler.""" """Get the options flow for this handler."""
return EmoncmsOptionsFlow(config_entry) return EmoncmsOptionsFlow()
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
@ -167,7 +169,7 @@ class EmoncmsConfigFlow(ConfigFlow, domain=DOMAIN):
return result return result
class EmoncmsOptionsFlow(OptionsFlowWithConfigEntry): class EmoncmsOptionsFlow(OptionsFlow):
"""Emoncms Options flow handler.""" """Emoncms Options flow handler."""
async def async_step_init( async def async_step_init(
@ -175,7 +177,7 @@ class EmoncmsOptionsFlow(OptionsFlowWithConfigEntry):
) -> ConfigFlowResult: ) -> ConfigFlowResult:
"""Manage the options.""" """Manage the options."""
errors: dict[str, str] = {} errors: dict[str, str] = {}
data = self.options if self.options else self._config_entry.data data = self.options if self.options else self.config_entry.data
url = data[CONF_URL] url = data[CONF_URL]
api_key = data[CONF_API_KEY] api_key = data[CONF_API_KEY]
include_only_feeds = data.get(CONF_ONLY_INCLUDE_FEEDID, []) include_only_feeds = data.get(CONF_ONLY_INCLUDE_FEEDID, [])

View File

@ -16,7 +16,7 @@ from homeassistant.config_entries import (
ConfigEntry, ConfigEntry,
ConfigFlow, ConfigFlow,
ConfigFlowResult, ConfigFlowResult,
OptionsFlowWithConfigEntry, OptionsFlow,
) )
from homeassistant.const import CONF_HOST, CONF_NAME, CONF_PASSWORD, CONF_USERNAME from homeassistant.const import CONF_HOST, CONF_NAME, CONF_PASSWORD, CONF_USERNAME
from homeassistant.core import HomeAssistant, callback from homeassistant.core import HomeAssistant, callback
@ -66,9 +66,11 @@ class EnphaseConfigFlow(ConfigFlow, domain=DOMAIN):
@staticmethod @staticmethod
@callback @callback
def async_get_options_flow(config_entry: ConfigEntry) -> EnvoyOptionsFlowHandler: def async_get_options_flow(
config_entry: ConfigEntry,
) -> EnvoyOptionsFlowHandler:
"""Options flow handler for Enphase_Envoy.""" """Options flow handler for Enphase_Envoy."""
return EnvoyOptionsFlowHandler(config_entry) return EnvoyOptionsFlowHandler()
@callback @callback
def _async_generate_schema(self) -> vol.Schema: def _async_generate_schema(self) -> vol.Schema:
@ -288,7 +290,7 @@ class EnphaseConfigFlow(ConfigFlow, domain=DOMAIN):
) )
class EnvoyOptionsFlowHandler(OptionsFlowWithConfigEntry): class EnvoyOptionsFlowHandler(OptionsFlow):
"""Envoy config flow options handler.""" """Envoy config flow options handler."""
async def async_step_init( async def async_step_init(

View File

@ -15,7 +15,6 @@ from homeassistant.config_entries import (
ConfigFlow, ConfigFlow,
ConfigFlowResult, ConfigFlowResult,
OptionsFlow, OptionsFlow,
OptionsFlowWithConfigEntry,
) )
from homeassistant.const import CONF_URL from homeassistant.const import CONF_URL
from homeassistant.core import HomeAssistant, callback from homeassistant.core import HomeAssistant, callback
@ -46,9 +45,11 @@ class FeedReaderConfigFlow(ConfigFlow, domain=DOMAIN):
@staticmethod @staticmethod
@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 FeedReaderOptionsFlowHandler(config_entry) return FeedReaderOptionsFlowHandler()
def show_user_form( def show_user_form(
self, self,
@ -147,7 +148,7 @@ class FeedReaderConfigFlow(ConfigFlow, domain=DOMAIN):
return self.async_abort(reason="reconfigure_successful") return self.async_abort(reason="reconfigure_successful")
class FeedReaderOptionsFlowHandler(OptionsFlowWithConfigEntry): class FeedReaderOptionsFlowHandler(OptionsFlow):
"""Handle an options flow.""" """Handle an options flow."""
async def async_step_init( async def async_step_init(

View File

@ -1,5 +1,7 @@
"""Config flow for file integration.""" """Config flow for file integration."""
from __future__ import annotations
from copy import deepcopy from copy import deepcopy
import os import os
from typing import Any from typing import Any
@ -11,7 +13,6 @@ from homeassistant.config_entries import (
ConfigFlow, ConfigFlow,
ConfigFlowResult, ConfigFlowResult,
OptionsFlow, OptionsFlow,
OptionsFlowWithConfigEntry,
) )
from homeassistant.const import ( from homeassistant.const import (
CONF_FILE_PATH, CONF_FILE_PATH,
@ -74,9 +75,11 @@ class FileConfigFlowHandler(ConfigFlow, domain=DOMAIN):
@staticmethod @staticmethod
@callback @callback
def async_get_options_flow(config_entry: ConfigEntry) -> OptionsFlow: def async_get_options_flow(
config_entry: ConfigEntry,
) -> FileOptionsFlowHandler:
"""Get the options flow for this handler.""" """Get the options flow for this handler."""
return FileOptionsFlowHandler(config_entry) return FileOptionsFlowHandler()
async def validate_file_path(self, file_path: str) -> bool: async def validate_file_path(self, file_path: str) -> bool:
"""Ensure the file path is valid.""" """Ensure the file path is valid."""
@ -151,7 +154,7 @@ class FileConfigFlowHandler(ConfigFlow, domain=DOMAIN):
return self.async_create_entry(title=title, data=data, options=options) return self.async_create_entry(title=title, data=data, options=options)
class FileOptionsFlowHandler(OptionsFlowWithConfigEntry): class FileOptionsFlowHandler(OptionsFlow):
"""Handle File options.""" """Handle File options."""
async def async_step_init( async def async_step_init(

View File

@ -23,7 +23,6 @@ from homeassistant.config_entries import (
ConfigFlow, ConfigFlow,
ConfigFlowResult, ConfigFlowResult,
OptionsFlow, OptionsFlow,
OptionsFlowWithConfigEntry,
) )
from homeassistant.const import ( from homeassistant.const import (
CONF_HOST, CONF_HOST,
@ -60,9 +59,11 @@ class FritzBoxToolsFlowHandler(ConfigFlow, domain=DOMAIN):
@staticmethod @staticmethod
@callback @callback
def async_get_options_flow(config_entry: ConfigEntry) -> OptionsFlow: def async_get_options_flow(
config_entry: ConfigEntry,
) -> FritzBoxToolsOptionsFlowHandler:
"""Get the options flow for this handler.""" """Get the options flow for this handler."""
return FritzBoxToolsOptionsFlowHandler(config_entry) return FritzBoxToolsOptionsFlowHandler()
def __init__(self) -> None: def __init__(self) -> None:
"""Initialize FRITZ!Box Tools flow.""" """Initialize FRITZ!Box Tools flow."""
@ -393,7 +394,7 @@ class FritzBoxToolsFlowHandler(ConfigFlow, domain=DOMAIN):
) )
class FritzBoxToolsOptionsFlowHandler(OptionsFlowWithConfigEntry): class FritzBoxToolsOptionsFlowHandler(OptionsFlow):
"""Handle an options flow.""" """Handle an options flow."""
async def async_step_init( async def async_step_init(

View File

@ -15,7 +15,7 @@ from homeassistant.config_entries import (
ConfigEntry, ConfigEntry,
ConfigFlow, ConfigFlow,
ConfigFlowResult, ConfigFlowResult,
OptionsFlowWithConfigEntry, OptionsFlow,
) )
from homeassistant.core import callback from homeassistant.core import callback
from homeassistant.helpers.selector import ( from homeassistant.helpers.selector import (
@ -135,10 +135,10 @@ class GoogleCloudConfigFlow(ConfigFlow, domain=DOMAIN):
config_entry: ConfigEntry, config_entry: ConfigEntry,
) -> GoogleCloudOptionsFlowHandler: ) -> GoogleCloudOptionsFlowHandler:
"""Create the options flow.""" """Create the options flow."""
return GoogleCloudOptionsFlowHandler(config_entry) return GoogleCloudOptionsFlowHandler()
class GoogleCloudOptionsFlowHandler(OptionsFlowWithConfigEntry): class GoogleCloudOptionsFlowHandler(OptionsFlow):
"""Google Cloud options flow.""" """Google Cloud options flow."""
async def async_step_init( async def async_step_init(

View File

@ -13,7 +13,7 @@ from homeassistant.config_entries import (
ConfigEntry, ConfigEntry,
ConfigFlow, ConfigFlow,
ConfigFlowResult, ConfigFlowResult,
OptionsFlowWithConfigEntry, OptionsFlow,
) )
from homeassistant.const import ( from homeassistant.const import (
CONF_NAME, CONF_NAME,
@ -213,12 +213,12 @@ class IMAPConfigFlow(ConfigFlow, domain=DOMAIN):
@callback @callback
def async_get_options_flow( def async_get_options_flow(
config_entry: ConfigEntry, config_entry: ConfigEntry,
) -> OptionsFlow: ) -> ImapOptionsFlow:
"""Get the options flow for this handler.""" """Get the options flow for this handler."""
return OptionsFlow(config_entry) return ImapOptionsFlow()
class OptionsFlow(OptionsFlowWithConfigEntry): class ImapOptionsFlow(OptionsFlow):
"""Option flow handler.""" """Option flow handler."""
async def async_step_init( async def async_step_init(
@ -226,13 +226,13 @@ class OptionsFlow(OptionsFlowWithConfigEntry):
) -> ConfigFlowResult: ) -> ConfigFlowResult:
"""Manage the options.""" """Manage the options."""
errors: dict[str, str] | None = None errors: dict[str, str] | None = None
entry_data: dict[str, Any] = dict(self._config_entry.data) entry_data: dict[str, Any] = dict(self.config_entry.data)
if user_input is not None: if user_input is not None:
try: try:
self._async_abort_entries_match( self._async_abort_entries_match(
{ {
CONF_SERVER: self._config_entry.data[CONF_SERVER], CONF_SERVER: self.config_entry.data[CONF_SERVER],
CONF_USERNAME: self._config_entry.data[CONF_USERNAME], CONF_USERNAME: self.config_entry.data[CONF_USERNAME],
CONF_FOLDER: user_input[CONF_FOLDER], CONF_FOLDER: user_input[CONF_FOLDER],
CONF_SEARCH: user_input[CONF_SEARCH], CONF_SEARCH: user_input[CONF_SEARCH],
} }

View File

@ -8,11 +8,7 @@ from typing import Any
import voluptuous as vol import voluptuous as vol
from homeassistant.config_entries import ( from homeassistant.config_entries import ConfigFlow, ConfigFlowResult, OptionsFlow
ConfigFlow,
ConfigFlowResult,
OptionsFlowWithConfigEntry,
)
from homeassistant.const import CONF_PASSWORD, CONF_URL, CONF_USERNAME from homeassistant.const import CONF_PASSWORD, CONF_URL, CONF_USERNAME
from homeassistant.core import callback from homeassistant.core import callback
from homeassistant.util.uuid import random_uuid_hex from homeassistant.util.uuid import random_uuid_hex
@ -143,12 +139,12 @@ class JellyfinConfigFlow(ConfigFlow, domain=DOMAIN):
@callback @callback
def async_get_options_flow( def async_get_options_flow(
config_entry: JellyfinConfigEntry, config_entry: JellyfinConfigEntry,
) -> OptionsFlowWithConfigEntry: ) -> OptionsFlowHandler:
"""Create the options flow.""" """Create the options flow."""
return OptionsFlowHandler(config_entry) return OptionsFlowHandler()
class OptionsFlowHandler(OptionsFlowWithConfigEntry): class OptionsFlowHandler(OptionsFlow):
"""Handle an option flow for jellyfin.""" """Handle an option flow for jellyfin."""
async def async_step_init( async def async_step_init(

View File

@ -12,7 +12,7 @@ from homeassistant.config_entries import (
ConfigEntry, ConfigEntry,
ConfigFlow, ConfigFlow,
ConfigFlowResult, ConfigFlowResult,
OptionsFlowWithConfigEntry, OptionsFlow,
) )
from homeassistant.const import ( from homeassistant.const import (
CONF_ELEVATION, CONF_ELEVATION,
@ -90,9 +90,11 @@ class JewishCalendarConfigFlow(ConfigFlow, domain=DOMAIN):
@staticmethod @staticmethod
@callback @callback
def async_get_options_flow(config_entry: ConfigEntry) -> OptionsFlowWithConfigEntry: def async_get_options_flow(
config_entry: ConfigEntry,
) -> JewishCalendarOptionsFlowHandler:
"""Get the options flow for this handler.""" """Get the options flow for this handler."""
return JewishCalendarOptionsFlowHandler(config_entry) return JewishCalendarOptionsFlowHandler()
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
@ -145,7 +147,7 @@ class JewishCalendarConfigFlow(ConfigFlow, domain=DOMAIN):
return self.async_update_reload_and_abort(reconfigure_entry, data=user_input) return self.async_update_reload_and_abort(reconfigure_entry, data=user_input)
class JewishCalendarOptionsFlowHandler(OptionsFlowWithConfigEntry): class JewishCalendarOptionsFlowHandler(OptionsFlow):
"""Handle Jewish Calendar options.""" """Handle Jewish Calendar options."""
async def async_step_init( async def async_step_init(

View File

@ -12,7 +12,7 @@ from homeassistant.config_entries import (
ConfigEntry, ConfigEntry,
ConfigFlow, ConfigFlow,
ConfigFlowResult, ConfigFlowResult,
OptionsFlowWithConfigEntry, OptionsFlow,
) )
from homeassistant.core import callback from homeassistant.core import callback
@ -33,7 +33,7 @@ class KitchenSinkConfigFlow(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_import(self, import_data: dict[str, Any]) -> ConfigFlowResult: async def async_step_import(self, import_data: dict[str, Any]) -> ConfigFlowResult:
"""Set the config entry up from yaml.""" """Set the config entry up from yaml."""
@ -54,7 +54,7 @@ class KitchenSinkConfigFlow(ConfigFlow, domain=DOMAIN):
return self.async_abort(reason="reauth_successful") return self.async_abort(reason="reauth_successful")
class OptionsFlowHandler(OptionsFlowWithConfigEntry): class OptionsFlowHandler(OptionsFlow):
"""Handle options.""" """Handle options."""
async def async_step_init( async def async_step_init(

View File

@ -1,5 +1,7 @@
"""Config flow for La Marzocco integration.""" """Config flow for La Marzocco integration."""
from __future__ import annotations
from collections.abc import Mapping from collections.abc import Mapping
import logging import logging
from typing import Any from typing import Any
@ -22,7 +24,6 @@ from homeassistant.config_entries import (
ConfigFlow, ConfigFlow,
ConfigFlowResult, ConfigFlowResult,
OptionsFlow, OptionsFlow,
OptionsFlowWithConfigEntry,
) )
from homeassistant.const import ( from homeassistant.const import (
CONF_HOST, CONF_HOST,
@ -339,12 +340,12 @@ class LmConfigFlow(ConfigFlow, domain=DOMAIN):
@callback @callback
def async_get_options_flow( def async_get_options_flow(
config_entry: ConfigEntry, config_entry: ConfigEntry,
) -> OptionsFlow: ) -> LmOptionsFlowHandler:
"""Create the options flow.""" """Create the options flow."""
return LmOptionsFlowHandler(config_entry) return LmOptionsFlowHandler()
class LmOptionsFlowHandler(OptionsFlowWithConfigEntry): class LmOptionsFlowHandler(OptionsFlow):
"""Handles options flow for the component.""" """Handles options flow for the component."""
async def async_step_init( async def async_step_init(

View File

@ -11,7 +11,7 @@ from homeassistant.config_entries import (
ConfigEntry, ConfigEntry,
ConfigFlow, ConfigFlow,
ConfigFlowResult, ConfigFlowResult,
OptionsFlowWithConfigEntry, OptionsFlow,
) )
from homeassistant.const import CONF_API_KEY from homeassistant.const import CONF_API_KEY
from homeassistant.core import callback from homeassistant.core import callback
@ -80,7 +80,7 @@ class LastFmConfigFlowHandler(ConfigFlow, domain=DOMAIN):
config_entry: ConfigEntry, config_entry: ConfigEntry,
) -> LastFmOptionsFlowHandler: ) -> LastFmOptionsFlowHandler:
"""Get the options flow for this handler.""" """Get the options flow for this handler."""
return LastFmOptionsFlowHandler(config_entry) return LastFmOptionsFlowHandler()
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
@ -155,7 +155,7 @@ class LastFmConfigFlowHandler(ConfigFlow, domain=DOMAIN):
) )
class LastFmOptionsFlowHandler(OptionsFlowWithConfigEntry): class LastFmOptionsFlowHandler(OptionsFlow):
"""LastFm Options flow handler.""" """LastFm Options flow handler."""
async def async_step_init( async def async_step_init(

View File

@ -11,7 +11,6 @@ from homeassistant.config_entries import (
ConfigFlow, ConfigFlow,
ConfigFlowResult, ConfigFlowResult,
OptionsFlow, OptionsFlow,
OptionsFlowWithConfigEntry,
) )
from homeassistant.const import ( from homeassistant.const import (
CONF_ELEVATION, CONF_ELEVATION,
@ -143,12 +142,12 @@ class MetConfigFlowHandler(ConfigFlow, domain=DOMAIN):
@callback @callback
def async_get_options_flow( def async_get_options_flow(
config_entry: ConfigEntry, config_entry: ConfigEntry,
) -> OptionsFlow: ) -> MetOptionsFlowHandler:
"""Get the options flow for Met.""" """Get the options flow for Met."""
return MetOptionsFlowHandler(config_entry) return MetOptionsFlowHandler()
class MetOptionsFlowHandler(OptionsFlowWithConfigEntry): class MetOptionsFlowHandler(OptionsFlow):
"""Options flow for Met component.""" """Options flow for Met component."""
async def async_step_init( async def async_step_init(
@ -159,13 +158,13 @@ class MetOptionsFlowHandler(OptionsFlowWithConfigEntry):
if user_input is not None: if user_input is not None:
# Update config entry with data from user input # Update config entry with data from user input
self.hass.config_entries.async_update_entry( self.hass.config_entries.async_update_entry(
self._config_entry, data=user_input self.config_entry, data=user_input
) )
return self.async_create_entry( return self.async_create_entry(
title=self._config_entry.title, data=user_input title=self.config_entry.title, data=user_input
) )
return self.async_show_form( return self.async_show_form(
step_id="init", step_id="init",
data_schema=_get_data_schema(self.hass, config_entry=self._config_entry), data_schema=_get_data_schema(self.hass, config_entry=self.config_entry),
) )

View File

@ -10,7 +10,7 @@ from homeassistant.config_entries import (
ConfigEntry, ConfigEntry,
ConfigFlow, ConfigFlow,
ConfigFlowResult, ConfigFlowResult,
OptionsFlowWithConfigEntry, OptionsFlow,
) )
from homeassistant.const import CONF_HOST, CONF_PORT from homeassistant.const import CONF_HOST, CONF_PORT
from homeassistant.core import HomeAssistant, callback from homeassistant.core import HomeAssistant, callback
@ -100,12 +100,14 @@ class OneWireFlowHandler(ConfigFlow, domain=DOMAIN):
@staticmethod @staticmethod
@callback @callback
def async_get_options_flow(config_entry: ConfigEntry) -> OnewireOptionsFlowHandler: def async_get_options_flow(
config_entry: ConfigEntry,
) -> OnewireOptionsFlowHandler:
"""Get the options flow for this handler.""" """Get the options flow for this handler."""
return OnewireOptionsFlowHandler(config_entry) return OnewireOptionsFlowHandler()
class OnewireOptionsFlowHandler(OptionsFlowWithConfigEntry): class OnewireOptionsFlowHandler(OptionsFlow):
"""Handle OneWire Config options.""" """Handle OneWire Config options."""
configurable_devices: dict[str, str] configurable_devices: dict[str, str]

View File

@ -13,7 +13,7 @@ from homeassistant.config_entries import (
ConfigEntry, ConfigEntry,
ConfigFlow, ConfigFlow,
ConfigFlowResult, ConfigFlowResult,
OptionsFlowWithConfigEntry, OptionsFlow,
) )
from homeassistant.const import ( from homeassistant.const import (
CONF_LATITUDE, CONF_LATITUDE,
@ -45,7 +45,7 @@ class OpenSkyConfigFlowHandler(ConfigFlow, domain=DOMAIN):
config_entry: ConfigEntry, config_entry: ConfigEntry,
) -> OpenSkyOptionsFlowHandler: ) -> OpenSkyOptionsFlowHandler:
"""Get the options flow for this handler.""" """Get the options flow for this handler."""
return OpenSkyOptionsFlowHandler(config_entry) return OpenSkyOptionsFlowHandler()
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
@ -83,7 +83,7 @@ class OpenSkyConfigFlowHandler(ConfigFlow, domain=DOMAIN):
) )
class OpenSkyOptionsFlowHandler(OptionsFlowWithConfigEntry): class OpenSkyOptionsFlowHandler(OptionsFlow):
"""OpenSky Options flow handler.""" """OpenSky Options flow handler."""
async def async_step_init( async def async_step_init(

View File

@ -13,7 +13,7 @@ from homeassistant.config_entries import (
ConfigEntry, ConfigEntry,
ConfigFlow, ConfigFlow,
ConfigFlowResult, ConfigFlowResult,
OptionsFlowWithConfigEntry, OptionsFlow,
) )
from homeassistant.const import CONF_API_TOKEN, CONF_NAME from homeassistant.const import CONF_API_TOKEN, CONF_NAME
from homeassistant.core import callback from homeassistant.core import callback
@ -56,7 +56,7 @@ class TariffSelectorConfigFlow(ConfigFlow, domain=DOMAIN):
config_entry: ConfigEntry, config_entry: ConfigEntry,
) -> PVPCOptionsFlowHandler: ) -> PVPCOptionsFlowHandler:
"""Get the options flow for this handler.""" """Get the options flow for this handler."""
return PVPCOptionsFlowHandler(config_entry) return PVPCOptionsFlowHandler()
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
@ -178,7 +178,7 @@ class TariffSelectorConfigFlow(ConfigFlow, domain=DOMAIN):
return self.async_show_form(step_id="reauth_confirm", data_schema=data_schema) return self.async_show_form(step_id="reauth_confirm", data_schema=data_schema)
class PVPCOptionsFlowHandler(OptionsFlowWithConfigEntry): class PVPCOptionsFlowHandler(OptionsFlow):
"""Handle PVPC options.""" """Handle PVPC options."""
_power: float | None = None _power: float | None = None

View File

@ -24,7 +24,6 @@ from homeassistant.config_entries import (
ConfigFlow, ConfigFlow,
ConfigFlowResult, ConfigFlowResult,
OptionsFlow, OptionsFlow,
OptionsFlowWithConfigEntry,
) )
from homeassistant.const import CONF_USERNAME from homeassistant.const import CONF_USERNAME
from homeassistant.core import callback from homeassistant.core import callback
@ -171,12 +170,12 @@ class RoborockFlowHandler(ConfigFlow, domain=DOMAIN):
@callback @callback
def async_get_options_flow( def async_get_options_flow(
config_entry: ConfigEntry, config_entry: ConfigEntry,
) -> OptionsFlow: ) -> RoborockOptionsFlowHandler:
"""Create the options flow.""" """Create the options flow."""
return RoborockOptionsFlowHandler(config_entry) return RoborockOptionsFlowHandler()
class RoborockOptionsFlowHandler(OptionsFlowWithConfigEntry): class RoborockOptionsFlowHandler(OptionsFlow):
"""Handle an option flow for Roborock.""" """Handle an option flow for Roborock."""
async def async_step_init( async def async_step_init(

View File

@ -14,7 +14,7 @@ from homeassistant.config_entries import (
ConfigEntry, ConfigEntry,
ConfigFlow, ConfigFlow,
ConfigFlowResult, ConfigFlowResult,
OptionsFlowWithConfigEntry, OptionsFlow,
) )
from homeassistant.const import CONF_HOST, CONF_NAME from homeassistant.const import CONF_HOST, CONF_NAME
from homeassistant.core import HomeAssistant, callback from homeassistant.core import HomeAssistant, callback
@ -165,12 +165,12 @@ class RokuConfigFlow(ConfigFlow, domain=DOMAIN):
@callback @callback
def async_get_options_flow( def async_get_options_flow(
config_entry: ConfigEntry, config_entry: ConfigEntry,
) -> OptionsFlowWithConfigEntry: ) -> RokuOptionsFlowHandler:
"""Create the options flow.""" """Create the options flow."""
return RokuOptionsFlowHandler(config_entry) return RokuOptionsFlowHandler()
class RokuOptionsFlowHandler(OptionsFlowWithConfigEntry): class RokuOptionsFlowHandler(OptionsFlow):
"""Handle Roku options.""" """Handle Roku options."""
async def async_step_init( async def async_step_init(

View File

@ -16,7 +16,7 @@ from homeassistant.config_entries import (
ConfigEntry, ConfigEntry,
ConfigFlow, ConfigFlow,
ConfigFlowResult, ConfigFlowResult,
OptionsFlowWithConfigEntry, OptionsFlow,
) )
from homeassistant.const import CONF_DELAY, CONF_HOST, CONF_NAME, CONF_PASSWORD from homeassistant.const import CONF_DELAY, CONF_HOST, CONF_NAME, CONF_PASSWORD
from homeassistant.core import HomeAssistant, callback from homeassistant.core import HomeAssistant, callback
@ -92,7 +92,7 @@ class RoombaConfigFlow(ConfigFlow, domain=DOMAIN):
config_entry: ConfigEntry, config_entry: ConfigEntry,
) -> RoombaOptionsFlowHandler: ) -> RoombaOptionsFlowHandler:
"""Get the options flow for this handler.""" """Get the options flow for this handler."""
return RoombaOptionsFlowHandler(config_entry) return RoombaOptionsFlowHandler()
async def async_step_zeroconf( async def async_step_zeroconf(
self, discovery_info: zeroconf.ZeroconfServiceInfo self, discovery_info: zeroconf.ZeroconfServiceInfo
@ -300,7 +300,7 @@ class RoombaConfigFlow(ConfigFlow, domain=DOMAIN):
) )
class RoombaOptionsFlowHandler(OptionsFlowWithConfigEntry): class RoombaOptionsFlowHandler(OptionsFlow):
"""Handle options.""" """Handle options."""
async def async_step_init( async def async_step_init(

View File

@ -23,7 +23,7 @@ from homeassistant.config_entries import (
ConfigEntry, ConfigEntry,
ConfigFlow, ConfigFlow,
ConfigFlowResult, ConfigFlowResult,
OptionsFlowWithConfigEntry, OptionsFlow,
) )
from homeassistant.const import ( from homeassistant.const import (
CONF_DEVICE_CLASS, CONF_DEVICE_CLASS,
@ -144,7 +144,7 @@ class SQLConfigFlow(ConfigFlow, domain=DOMAIN):
config_entry: ConfigEntry, config_entry: ConfigEntry,
) -> SQLOptionsFlowHandler: ) -> SQLOptionsFlowHandler:
"""Get the options flow for this handler.""" """Get the options flow for this handler."""
return SQLOptionsFlowHandler(config_entry) return SQLOptionsFlowHandler()
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
@ -209,7 +209,7 @@ class SQLConfigFlow(ConfigFlow, domain=DOMAIN):
) )
class SQLOptionsFlowHandler(OptionsFlowWithConfigEntry): class SQLOptionsFlowHandler(OptionsFlow):
"""Handle SQL options.""" """Handle SQL options."""
async def async_step_init( async def async_step_init(

View File

@ -21,7 +21,7 @@ from homeassistant.config_entries import (
ConfigEntry, ConfigEntry,
ConfigFlow, ConfigFlow,
ConfigFlowResult, ConfigFlowResult,
OptionsFlowWithConfigEntry, OptionsFlow,
) )
from homeassistant.const import CONF_API_KEY, CONF_NAME, CONF_WEEKDAY, WEEKDAYS from homeassistant.const import CONF_API_KEY, CONF_NAME, CONF_WEEKDAY, WEEKDAYS
from homeassistant.core import HomeAssistant, callback from homeassistant.core import HomeAssistant, callback
@ -132,7 +132,7 @@ class TVTrainConfigFlow(ConfigFlow, domain=DOMAIN):
config_entry: ConfigEntry, config_entry: ConfigEntry,
) -> TVTrainOptionsFlowHandler: ) -> TVTrainOptionsFlowHandler:
"""Get the options flow for this handler.""" """Get the options flow for this handler."""
return TVTrainOptionsFlowHandler(config_entry) return TVTrainOptionsFlowHandler()
async def async_step_reauth( async def async_step_reauth(
self, entry_data: Mapping[str, Any] self, entry_data: Mapping[str, Any]
@ -229,7 +229,7 @@ class TVTrainConfigFlow(ConfigFlow, domain=DOMAIN):
) )
class TVTrainOptionsFlowHandler(OptionsFlowWithConfigEntry): class TVTrainOptionsFlowHandler(OptionsFlow):
"""Handle Trafikverket Train options.""" """Handle Trafikverket Train options."""
async def async_step_init( async def async_step_init(

View File

@ -16,7 +16,6 @@ from homeassistant.config_entries import (
ConfigFlow, ConfigFlow,
ConfigFlowResult, ConfigFlowResult,
OptionsFlow, OptionsFlow,
OptionsFlowWithConfigEntry,
) )
from homeassistant.core import HomeAssistant, callback from homeassistant.core import HomeAssistant, callback
@ -94,9 +93,11 @@ class UpnpFlowHandler(ConfigFlow, domain=DOMAIN):
@staticmethod @staticmethod
@callback @callback
def async_get_options_flow(config_entry: ConfigEntry) -> OptionsFlow: def async_get_options_flow(
config_entry: ConfigEntry,
) -> UpnpOptionsFlowHandler:
"""Get the options flow for this handler.""" """Get the options flow for this handler."""
return UpnpOptionsFlowHandler(config_entry) return UpnpOptionsFlowHandler()
@property @property
def _discoveries(self) -> dict[str, SsdpServiceInfo]: def _discoveries(self) -> dict[str, SsdpServiceInfo]:
@ -299,7 +300,7 @@ class UpnpFlowHandler(ConfigFlow, domain=DOMAIN):
return self.async_create_entry(title=title, data=data, options=options) return self.async_create_entry(title=title, data=data, options=options)
class UpnpOptionsFlowHandler(OptionsFlowWithConfigEntry): class UpnpOptionsFlowHandler(OptionsFlow):
"""Handle an options flow.""" """Handle an options flow."""
async def async_step_init( async def async_step_init(

View File

@ -17,7 +17,6 @@ from homeassistant.config_entries import (
ConfigFlow, ConfigFlow,
ConfigFlowResult, ConfigFlowResult,
OptionsFlow, OptionsFlow,
OptionsFlowWithConfigEntry,
) )
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_USERNAME from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_USERNAME
from homeassistant.core import HomeAssistant, callback from homeassistant.core import HomeAssistant, callback
@ -63,9 +62,11 @@ class VodafoneStationConfigFlow(ConfigFlow, domain=DOMAIN):
@staticmethod @staticmethod
@callback @callback
def async_get_options_flow(config_entry: ConfigEntry) -> OptionsFlow: def async_get_options_flow(
config_entry: ConfigEntry,
) -> VodafoneStationOptionsFlowHandler:
"""Get the options flow for this handler.""" """Get the options flow for this handler."""
return VodafoneStationOptionsFlowHandler(config_entry) return VodafoneStationOptionsFlowHandler()
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
@ -143,7 +144,7 @@ class VodafoneStationConfigFlow(ConfigFlow, domain=DOMAIN):
) )
class VodafoneStationOptionsFlowHandler(OptionsFlowWithConfigEntry): class VodafoneStationOptionsFlowHandler(OptionsFlow):
"""Handle a option flow.""" """Handle a option flow."""
async def async_step_init( async def async_step_init(

View File

@ -12,7 +12,7 @@ from homeassistant.config_entries import (
ConfigEntry, ConfigEntry,
ConfigFlow, ConfigFlow,
ConfigFlowResult, ConfigFlowResult,
OptionsFlowWithConfigEntry, OptionsFlow,
) )
from homeassistant.const import CONF_HOST, CONF_MAC from homeassistant.const import CONF_HOST, CONF_MAC
from homeassistant.core import callback from homeassistant.core import callback
@ -30,9 +30,11 @@ class WLEDFlowHandler(ConfigFlow, domain=DOMAIN):
@staticmethod @staticmethod
@callback @callback
def async_get_options_flow(config_entry: ConfigEntry) -> WLEDOptionsFlowHandler: def async_get_options_flow(
config_entry: ConfigEntry,
) -> WLEDOptionsFlowHandler:
"""Get the options flow for this handler.""" """Get the options flow for this handler."""
return WLEDOptionsFlowHandler(config_entry) return WLEDOptionsFlowHandler()
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
@ -117,7 +119,7 @@ class WLEDFlowHandler(ConfigFlow, domain=DOMAIN):
return await wled.update() return await wled.update()
class WLEDOptionsFlowHandler(OptionsFlowWithConfigEntry): class WLEDOptionsFlowHandler(OptionsFlow):
"""Handle WLED options.""" """Handle WLED options."""
async def async_step_init( async def async_step_init(

View File

@ -12,7 +12,7 @@ from homeassistant.config_entries import (
ConfigEntry, ConfigEntry,
ConfigFlow, ConfigFlow,
ConfigFlowResult, ConfigFlowResult,
OptionsFlowWithConfigEntry, OptionsFlow,
) )
from homeassistant.const import CONF_COUNTRY, CONF_LANGUAGE, CONF_NAME from homeassistant.const import CONF_COUNTRY, CONF_LANGUAGE, CONF_NAME
from homeassistant.core import callback from homeassistant.core import callback
@ -219,7 +219,7 @@ class WorkdayConfigFlow(ConfigFlow, domain=DOMAIN):
config_entry: ConfigEntry, config_entry: ConfigEntry,
) -> WorkdayOptionsFlowHandler: ) -> WorkdayOptionsFlowHandler:
"""Get the options flow for this handler.""" """Get the options flow for this handler."""
return WorkdayOptionsFlowHandler(config_entry) return WorkdayOptionsFlowHandler()
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
@ -310,7 +310,7 @@ class WorkdayConfigFlow(ConfigFlow, domain=DOMAIN):
) )
class WorkdayOptionsFlowHandler(OptionsFlowWithConfigEntry): class WorkdayOptionsFlowHandler(OptionsFlow):
"""Handle Workday options.""" """Handle Workday options."""
async def async_step_init( async def async_step_init(
@ -340,7 +340,7 @@ class WorkdayOptionsFlowHandler(OptionsFlowWithConfigEntry):
else: else:
LOGGER.debug("abort_check in options with %s", combined_input) LOGGER.debug("abort_check in options with %s", combined_input)
abort_match = { abort_match = {
CONF_COUNTRY: self._config_entry.options.get(CONF_COUNTRY), CONF_COUNTRY: self.config_entry.options.get(CONF_COUNTRY),
CONF_EXCLUDES: combined_input[CONF_EXCLUDES], CONF_EXCLUDES: combined_input[CONF_EXCLUDES],
CONF_OFFSET: combined_input[CONF_OFFSET], CONF_OFFSET: combined_input[CONF_OFFSET],
CONF_WORKDAYS: combined_input[CONF_WORKDAYS], CONF_WORKDAYS: combined_input[CONF_WORKDAYS],

View File

@ -15,7 +15,7 @@ from homeassistant.config_entries import (
SOURCE_REAUTH, SOURCE_REAUTH,
ConfigEntry, ConfigEntry,
ConfigFlowResult, ConfigFlowResult,
OptionsFlowWithConfigEntry, OptionsFlow,
) )
from homeassistant.const import CONF_ACCESS_TOKEN, CONF_TOKEN from homeassistant.const import CONF_ACCESS_TOKEN, CONF_TOKEN
from homeassistant.core import callback from homeassistant.core import callback
@ -54,7 +54,7 @@ class OAuth2FlowHandler(
config_entry: ConfigEntry, config_entry: ConfigEntry,
) -> YouTubeOptionsFlowHandler: ) -> YouTubeOptionsFlowHandler:
"""Get the options flow for this handler.""" """Get the options flow for this handler."""
return YouTubeOptionsFlowHandler(config_entry) return YouTubeOptionsFlowHandler()
@property @property
def logger(self) -> logging.Logger: def logger(self) -> logging.Logger:
@ -159,7 +159,7 @@ class OAuth2FlowHandler(
) )
class YouTubeOptionsFlowHandler(OptionsFlowWithConfigEntry): class YouTubeOptionsFlowHandler(OptionsFlow):
"""YouTube Options flow handler.""" """YouTube Options flow handler."""
async def async_step_init( async def async_step_init(