Cleanup unnecessary OptionsFlowWithConfigEntry (part 1) (#129752)
* Cleanup unnecessary OptionsFlowWithConfigEntry * Fix emoncms * Fix imap * Fix met * Fix workdaypull/129311/head
parent
463bffaeb6
commit
8b6c99776e
|
@ -16,7 +16,6 @@ from homeassistant.config_entries import (
|
|||
ConfigFlow,
|
||||
ConfigFlowResult,
|
||||
OptionsFlow,
|
||||
OptionsFlowWithConfigEntry,
|
||||
)
|
||||
from homeassistant.core import callback
|
||||
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
||||
|
@ -46,9 +45,11 @@ class HomeassistantAnalyticsConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||
|
||||
@staticmethod
|
||||
@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."""
|
||||
return HomeassistantAnalyticsOptionsFlowHandler(config_entry)
|
||||
return HomeassistantAnalyticsOptionsFlowHandler()
|
||||
|
||||
async def async_step_user(
|
||||
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."""
|
||||
|
||||
async def async_step_init(
|
||||
|
|
|
@ -18,7 +18,7 @@ from homeassistant.config_entries import (
|
|||
ConfigEntry,
|
||||
ConfigFlow,
|
||||
ConfigFlowResult,
|
||||
OptionsFlowWithConfigEntry,
|
||||
OptionsFlow,
|
||||
)
|
||||
from homeassistant.const import (
|
||||
CONF_HOST,
|
||||
|
@ -59,9 +59,11 @@ class AxisFlowHandler(ConfigFlow, domain=AXIS_DOMAIN):
|
|||
|
||||
@staticmethod
|
||||
@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."""
|
||||
return AxisOptionsFlowHandler(config_entry)
|
||||
return AxisOptionsFlowHandler()
|
||||
|
||||
def __init__(self) -> None:
|
||||
"""Initialize the Axis config flow."""
|
||||
|
@ -264,7 +266,7 @@ class AxisFlowHandler(ConfigFlow, domain=AXIS_DOMAIN):
|
|||
return await self.async_step_user()
|
||||
|
||||
|
||||
class AxisOptionsFlowHandler(OptionsFlowWithConfigEntry):
|
||||
class AxisOptionsFlowHandler(OptionsFlow):
|
||||
"""Handle Axis device options."""
|
||||
|
||||
config_entry: AxisConfigEntry
|
||||
|
|
|
@ -17,7 +17,7 @@ from homeassistant.config_entries import (
|
|||
ConfigEntry,
|
||||
ConfigFlow,
|
||||
ConfigFlowResult,
|
||||
OptionsFlowWithConfigEntry,
|
||||
OptionsFlow,
|
||||
)
|
||||
from homeassistant.const import CONF_PASSWORD, CONF_REGION, CONF_SOURCE, CONF_USERNAME
|
||||
from homeassistant.core import HomeAssistant, callback
|
||||
|
@ -145,10 +145,10 @@ class BMWConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||
config_entry: ConfigEntry,
|
||||
) -> BMWOptionsFlow:
|
||||
"""Return a MyBMW option flow."""
|
||||
return BMWOptionsFlow(config_entry)
|
||||
return BMWOptionsFlow()
|
||||
|
||||
|
||||
class BMWOptionsFlow(OptionsFlowWithConfigEntry):
|
||||
class BMWOptionsFlow(OptionsFlow):
|
||||
"""Handle a option flow for MyBMW."""
|
||||
|
||||
async def async_step_init(
|
||||
|
|
|
@ -14,7 +14,7 @@ from homeassistant.config_entries import (
|
|||
ConfigEntry,
|
||||
ConfigFlow,
|
||||
ConfigFlowResult,
|
||||
OptionsFlowWithConfigEntry,
|
||||
OptionsFlow,
|
||||
)
|
||||
from homeassistant.const import CONF_NAME, CONF_PORT
|
||||
from homeassistant.core import callback
|
||||
|
@ -101,7 +101,7 @@ class DnsIPConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||
config_entry: ConfigEntry,
|
||||
) -> DnsIPOptionsFlowHandler:
|
||||
"""Return Option handler."""
|
||||
return DnsIPOptionsFlowHandler(config_entry)
|
||||
return DnsIPOptionsFlowHandler()
|
||||
|
||||
async def async_step_user(
|
||||
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."""
|
||||
|
||||
async def async_step_init(
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
"""Configflow for the emoncms integration."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
|
||||
from pyemoncms import EmoncmsClient
|
||||
|
@ -9,7 +11,7 @@ from homeassistant.config_entries import (
|
|||
ConfigEntry,
|
||||
ConfigFlow,
|
||||
ConfigFlowResult,
|
||||
OptionsFlowWithConfigEntry,
|
||||
OptionsFlow,
|
||||
)
|
||||
from homeassistant.const import CONF_API_KEY, CONF_URL
|
||||
from homeassistant.core import HomeAssistant, callback
|
||||
|
@ -68,9 +70,9 @@ class EmoncmsConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||
@callback
|
||||
def async_get_options_flow(
|
||||
config_entry: ConfigEntry,
|
||||
) -> OptionsFlowWithConfigEntry:
|
||||
) -> EmoncmsOptionsFlow:
|
||||
"""Get the options flow for this handler."""
|
||||
return EmoncmsOptionsFlow(config_entry)
|
||||
return EmoncmsOptionsFlow()
|
||||
|
||||
async def async_step_user(
|
||||
self, user_input: dict[str, Any] | None = None
|
||||
|
@ -167,7 +169,7 @@ class EmoncmsConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||
return result
|
||||
|
||||
|
||||
class EmoncmsOptionsFlow(OptionsFlowWithConfigEntry):
|
||||
class EmoncmsOptionsFlow(OptionsFlow):
|
||||
"""Emoncms Options flow handler."""
|
||||
|
||||
async def async_step_init(
|
||||
|
@ -175,7 +177,7 @@ class EmoncmsOptionsFlow(OptionsFlowWithConfigEntry):
|
|||
) -> ConfigFlowResult:
|
||||
"""Manage the options."""
|
||||
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]
|
||||
api_key = data[CONF_API_KEY]
|
||||
include_only_feeds = data.get(CONF_ONLY_INCLUDE_FEEDID, [])
|
||||
|
|
|
@ -16,7 +16,7 @@ from homeassistant.config_entries import (
|
|||
ConfigEntry,
|
||||
ConfigFlow,
|
||||
ConfigFlowResult,
|
||||
OptionsFlowWithConfigEntry,
|
||||
OptionsFlow,
|
||||
)
|
||||
from homeassistant.const import CONF_HOST, CONF_NAME, CONF_PASSWORD, CONF_USERNAME
|
||||
from homeassistant.core import HomeAssistant, callback
|
||||
|
@ -66,9 +66,11 @@ class EnphaseConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||
|
||||
@staticmethod
|
||||
@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."""
|
||||
return EnvoyOptionsFlowHandler(config_entry)
|
||||
return EnvoyOptionsFlowHandler()
|
||||
|
||||
@callback
|
||||
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."""
|
||||
|
||||
async def async_step_init(
|
||||
|
|
|
@ -15,7 +15,6 @@ from homeassistant.config_entries import (
|
|||
ConfigFlow,
|
||||
ConfigFlowResult,
|
||||
OptionsFlow,
|
||||
OptionsFlowWithConfigEntry,
|
||||
)
|
||||
from homeassistant.const import CONF_URL
|
||||
from homeassistant.core import HomeAssistant, callback
|
||||
|
@ -46,9 +45,11 @@ class FeedReaderConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||
|
||||
@staticmethod
|
||||
@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."""
|
||||
return FeedReaderOptionsFlowHandler(config_entry)
|
||||
return FeedReaderOptionsFlowHandler()
|
||||
|
||||
def show_user_form(
|
||||
self,
|
||||
|
@ -147,7 +148,7 @@ class FeedReaderConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||
return self.async_abort(reason="reconfigure_successful")
|
||||
|
||||
|
||||
class FeedReaderOptionsFlowHandler(OptionsFlowWithConfigEntry):
|
||||
class FeedReaderOptionsFlowHandler(OptionsFlow):
|
||||
"""Handle an options flow."""
|
||||
|
||||
async def async_step_init(
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
"""Config flow for file integration."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from copy import deepcopy
|
||||
import os
|
||||
from typing import Any
|
||||
|
@ -11,7 +13,6 @@ from homeassistant.config_entries import (
|
|||
ConfigFlow,
|
||||
ConfigFlowResult,
|
||||
OptionsFlow,
|
||||
OptionsFlowWithConfigEntry,
|
||||
)
|
||||
from homeassistant.const import (
|
||||
CONF_FILE_PATH,
|
||||
|
@ -74,9 +75,11 @@ class FileConfigFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||
|
||||
@staticmethod
|
||||
@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."""
|
||||
return FileOptionsFlowHandler(config_entry)
|
||||
return FileOptionsFlowHandler()
|
||||
|
||||
async def validate_file_path(self, file_path: str) -> bool:
|
||||
"""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)
|
||||
|
||||
|
||||
class FileOptionsFlowHandler(OptionsFlowWithConfigEntry):
|
||||
class FileOptionsFlowHandler(OptionsFlow):
|
||||
"""Handle File options."""
|
||||
|
||||
async def async_step_init(
|
||||
|
|
|
@ -23,7 +23,6 @@ from homeassistant.config_entries import (
|
|||
ConfigFlow,
|
||||
ConfigFlowResult,
|
||||
OptionsFlow,
|
||||
OptionsFlowWithConfigEntry,
|
||||
)
|
||||
from homeassistant.const import (
|
||||
CONF_HOST,
|
||||
|
@ -60,9 +59,11 @@ class FritzBoxToolsFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||
|
||||
@staticmethod
|
||||
@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."""
|
||||
return FritzBoxToolsOptionsFlowHandler(config_entry)
|
||||
return FritzBoxToolsOptionsFlowHandler()
|
||||
|
||||
def __init__(self) -> None:
|
||||
"""Initialize FRITZ!Box Tools flow."""
|
||||
|
@ -393,7 +394,7 @@ class FritzBoxToolsFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||
)
|
||||
|
||||
|
||||
class FritzBoxToolsOptionsFlowHandler(OptionsFlowWithConfigEntry):
|
||||
class FritzBoxToolsOptionsFlowHandler(OptionsFlow):
|
||||
"""Handle an options flow."""
|
||||
|
||||
async def async_step_init(
|
||||
|
|
|
@ -15,7 +15,7 @@ from homeassistant.config_entries import (
|
|||
ConfigEntry,
|
||||
ConfigFlow,
|
||||
ConfigFlowResult,
|
||||
OptionsFlowWithConfigEntry,
|
||||
OptionsFlow,
|
||||
)
|
||||
from homeassistant.core import callback
|
||||
from homeassistant.helpers.selector import (
|
||||
|
@ -135,10 +135,10 @@ class GoogleCloudConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||
config_entry: ConfigEntry,
|
||||
) -> GoogleCloudOptionsFlowHandler:
|
||||
"""Create the options flow."""
|
||||
return GoogleCloudOptionsFlowHandler(config_entry)
|
||||
return GoogleCloudOptionsFlowHandler()
|
||||
|
||||
|
||||
class GoogleCloudOptionsFlowHandler(OptionsFlowWithConfigEntry):
|
||||
class GoogleCloudOptionsFlowHandler(OptionsFlow):
|
||||
"""Google Cloud options flow."""
|
||||
|
||||
async def async_step_init(
|
||||
|
|
|
@ -13,7 +13,7 @@ from homeassistant.config_entries import (
|
|||
ConfigEntry,
|
||||
ConfigFlow,
|
||||
ConfigFlowResult,
|
||||
OptionsFlowWithConfigEntry,
|
||||
OptionsFlow,
|
||||
)
|
||||
from homeassistant.const import (
|
||||
CONF_NAME,
|
||||
|
@ -213,12 +213,12 @@ class IMAPConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||
@callback
|
||||
def async_get_options_flow(
|
||||
config_entry: ConfigEntry,
|
||||
) -> OptionsFlow:
|
||||
) -> ImapOptionsFlow:
|
||||
"""Get the options flow for this handler."""
|
||||
return OptionsFlow(config_entry)
|
||||
return ImapOptionsFlow()
|
||||
|
||||
|
||||
class OptionsFlow(OptionsFlowWithConfigEntry):
|
||||
class ImapOptionsFlow(OptionsFlow):
|
||||
"""Option flow handler."""
|
||||
|
||||
async def async_step_init(
|
||||
|
@ -226,13 +226,13 @@ class OptionsFlow(OptionsFlowWithConfigEntry):
|
|||
) -> ConfigFlowResult:
|
||||
"""Manage the options."""
|
||||
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:
|
||||
try:
|
||||
self._async_abort_entries_match(
|
||||
{
|
||||
CONF_SERVER: self._config_entry.data[CONF_SERVER],
|
||||
CONF_USERNAME: self._config_entry.data[CONF_USERNAME],
|
||||
CONF_SERVER: self.config_entry.data[CONF_SERVER],
|
||||
CONF_USERNAME: self.config_entry.data[CONF_USERNAME],
|
||||
CONF_FOLDER: user_input[CONF_FOLDER],
|
||||
CONF_SEARCH: user_input[CONF_SEARCH],
|
||||
}
|
||||
|
|
|
@ -8,11 +8,7 @@ from typing import Any
|
|||
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.config_entries import (
|
||||
ConfigFlow,
|
||||
ConfigFlowResult,
|
||||
OptionsFlowWithConfigEntry,
|
||||
)
|
||||
from homeassistant.config_entries import ConfigFlow, ConfigFlowResult, OptionsFlow
|
||||
from homeassistant.const import CONF_PASSWORD, CONF_URL, CONF_USERNAME
|
||||
from homeassistant.core import callback
|
||||
from homeassistant.util.uuid import random_uuid_hex
|
||||
|
@ -143,12 +139,12 @@ class JellyfinConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||
@callback
|
||||
def async_get_options_flow(
|
||||
config_entry: JellyfinConfigEntry,
|
||||
) -> OptionsFlowWithConfigEntry:
|
||||
) -> OptionsFlowHandler:
|
||||
"""Create the options flow."""
|
||||
return OptionsFlowHandler(config_entry)
|
||||
return OptionsFlowHandler()
|
||||
|
||||
|
||||
class OptionsFlowHandler(OptionsFlowWithConfigEntry):
|
||||
class OptionsFlowHandler(OptionsFlow):
|
||||
"""Handle an option flow for jellyfin."""
|
||||
|
||||
async def async_step_init(
|
||||
|
|
|
@ -12,7 +12,7 @@ from homeassistant.config_entries import (
|
|||
ConfigEntry,
|
||||
ConfigFlow,
|
||||
ConfigFlowResult,
|
||||
OptionsFlowWithConfigEntry,
|
||||
OptionsFlow,
|
||||
)
|
||||
from homeassistant.const import (
|
||||
CONF_ELEVATION,
|
||||
|
@ -90,9 +90,11 @@ class JewishCalendarConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||
|
||||
@staticmethod
|
||||
@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."""
|
||||
return JewishCalendarOptionsFlowHandler(config_entry)
|
||||
return JewishCalendarOptionsFlowHandler()
|
||||
|
||||
async def async_step_user(
|
||||
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)
|
||||
|
||||
|
||||
class JewishCalendarOptionsFlowHandler(OptionsFlowWithConfigEntry):
|
||||
class JewishCalendarOptionsFlowHandler(OptionsFlow):
|
||||
"""Handle Jewish Calendar options."""
|
||||
|
||||
async def async_step_init(
|
||||
|
|
|
@ -12,7 +12,7 @@ from homeassistant.config_entries import (
|
|||
ConfigEntry,
|
||||
ConfigFlow,
|
||||
ConfigFlowResult,
|
||||
OptionsFlowWithConfigEntry,
|
||||
OptionsFlow,
|
||||
)
|
||||
from homeassistant.core import callback
|
||||
|
||||
|
@ -33,7 +33,7 @@ class KitchenSinkConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||
config_entry: ConfigEntry,
|
||||
) -> OptionsFlowHandler:
|
||||
"""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:
|
||||
"""Set the config entry up from yaml."""
|
||||
|
@ -54,7 +54,7 @@ class KitchenSinkConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||
return self.async_abort(reason="reauth_successful")
|
||||
|
||||
|
||||
class OptionsFlowHandler(OptionsFlowWithConfigEntry):
|
||||
class OptionsFlowHandler(OptionsFlow):
|
||||
"""Handle options."""
|
||||
|
||||
async def async_step_init(
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
"""Config flow for La Marzocco integration."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
import logging
|
||||
from typing import Any
|
||||
|
@ -22,7 +24,6 @@ from homeassistant.config_entries import (
|
|||
ConfigFlow,
|
||||
ConfigFlowResult,
|
||||
OptionsFlow,
|
||||
OptionsFlowWithConfigEntry,
|
||||
)
|
||||
from homeassistant.const import (
|
||||
CONF_HOST,
|
||||
|
@ -339,12 +340,12 @@ class LmConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||
@callback
|
||||
def async_get_options_flow(
|
||||
config_entry: ConfigEntry,
|
||||
) -> OptionsFlow:
|
||||
) -> LmOptionsFlowHandler:
|
||||
"""Create the options flow."""
|
||||
return LmOptionsFlowHandler(config_entry)
|
||||
return LmOptionsFlowHandler()
|
||||
|
||||
|
||||
class LmOptionsFlowHandler(OptionsFlowWithConfigEntry):
|
||||
class LmOptionsFlowHandler(OptionsFlow):
|
||||
"""Handles options flow for the component."""
|
||||
|
||||
async def async_step_init(
|
||||
|
|
|
@ -11,7 +11,7 @@ from homeassistant.config_entries import (
|
|||
ConfigEntry,
|
||||
ConfigFlow,
|
||||
ConfigFlowResult,
|
||||
OptionsFlowWithConfigEntry,
|
||||
OptionsFlow,
|
||||
)
|
||||
from homeassistant.const import CONF_API_KEY
|
||||
from homeassistant.core import callback
|
||||
|
@ -80,7 +80,7 @@ class LastFmConfigFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||
config_entry: ConfigEntry,
|
||||
) -> LastFmOptionsFlowHandler:
|
||||
"""Get the options flow for this handler."""
|
||||
return LastFmOptionsFlowHandler(config_entry)
|
||||
return LastFmOptionsFlowHandler()
|
||||
|
||||
async def async_step_user(
|
||||
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."""
|
||||
|
||||
async def async_step_init(
|
||||
|
|
|
@ -11,7 +11,6 @@ from homeassistant.config_entries import (
|
|||
ConfigFlow,
|
||||
ConfigFlowResult,
|
||||
OptionsFlow,
|
||||
OptionsFlowWithConfigEntry,
|
||||
)
|
||||
from homeassistant.const import (
|
||||
CONF_ELEVATION,
|
||||
|
@ -143,12 +142,12 @@ class MetConfigFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||
@callback
|
||||
def async_get_options_flow(
|
||||
config_entry: ConfigEntry,
|
||||
) -> OptionsFlow:
|
||||
) -> MetOptionsFlowHandler:
|
||||
"""Get the options flow for Met."""
|
||||
return MetOptionsFlowHandler(config_entry)
|
||||
return MetOptionsFlowHandler()
|
||||
|
||||
|
||||
class MetOptionsFlowHandler(OptionsFlowWithConfigEntry):
|
||||
class MetOptionsFlowHandler(OptionsFlow):
|
||||
"""Options flow for Met component."""
|
||||
|
||||
async def async_step_init(
|
||||
|
@ -159,13 +158,13 @@ class MetOptionsFlowHandler(OptionsFlowWithConfigEntry):
|
|||
if user_input is not None:
|
||||
# Update config entry with data from user input
|
||||
self.hass.config_entries.async_update_entry(
|
||||
self._config_entry, data=user_input
|
||||
self.config_entry, data=user_input
|
||||
)
|
||||
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(
|
||||
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),
|
||||
)
|
||||
|
|
|
@ -10,7 +10,7 @@ from homeassistant.config_entries import (
|
|||
ConfigEntry,
|
||||
ConfigFlow,
|
||||
ConfigFlowResult,
|
||||
OptionsFlowWithConfigEntry,
|
||||
OptionsFlow,
|
||||
)
|
||||
from homeassistant.const import CONF_HOST, CONF_PORT
|
||||
from homeassistant.core import HomeAssistant, callback
|
||||
|
@ -100,12 +100,14 @@ class OneWireFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||
|
||||
@staticmethod
|
||||
@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."""
|
||||
return OnewireOptionsFlowHandler(config_entry)
|
||||
return OnewireOptionsFlowHandler()
|
||||
|
||||
|
||||
class OnewireOptionsFlowHandler(OptionsFlowWithConfigEntry):
|
||||
class OnewireOptionsFlowHandler(OptionsFlow):
|
||||
"""Handle OneWire Config options."""
|
||||
|
||||
configurable_devices: dict[str, str]
|
||||
|
|
|
@ -13,7 +13,7 @@ from homeassistant.config_entries import (
|
|||
ConfigEntry,
|
||||
ConfigFlow,
|
||||
ConfigFlowResult,
|
||||
OptionsFlowWithConfigEntry,
|
||||
OptionsFlow,
|
||||
)
|
||||
from homeassistant.const import (
|
||||
CONF_LATITUDE,
|
||||
|
@ -45,7 +45,7 @@ class OpenSkyConfigFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||
config_entry: ConfigEntry,
|
||||
) -> OpenSkyOptionsFlowHandler:
|
||||
"""Get the options flow for this handler."""
|
||||
return OpenSkyOptionsFlowHandler(config_entry)
|
||||
return OpenSkyOptionsFlowHandler()
|
||||
|
||||
async def async_step_user(
|
||||
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."""
|
||||
|
||||
async def async_step_init(
|
||||
|
|
|
@ -13,7 +13,7 @@ from homeassistant.config_entries import (
|
|||
ConfigEntry,
|
||||
ConfigFlow,
|
||||
ConfigFlowResult,
|
||||
OptionsFlowWithConfigEntry,
|
||||
OptionsFlow,
|
||||
)
|
||||
from homeassistant.const import CONF_API_TOKEN, CONF_NAME
|
||||
from homeassistant.core import callback
|
||||
|
@ -56,7 +56,7 @@ class TariffSelectorConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||
config_entry: ConfigEntry,
|
||||
) -> PVPCOptionsFlowHandler:
|
||||
"""Get the options flow for this handler."""
|
||||
return PVPCOptionsFlowHandler(config_entry)
|
||||
return PVPCOptionsFlowHandler()
|
||||
|
||||
async def async_step_user(
|
||||
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)
|
||||
|
||||
|
||||
class PVPCOptionsFlowHandler(OptionsFlowWithConfigEntry):
|
||||
class PVPCOptionsFlowHandler(OptionsFlow):
|
||||
"""Handle PVPC options."""
|
||||
|
||||
_power: float | None = None
|
||||
|
|
|
@ -24,7 +24,6 @@ from homeassistant.config_entries import (
|
|||
ConfigFlow,
|
||||
ConfigFlowResult,
|
||||
OptionsFlow,
|
||||
OptionsFlowWithConfigEntry,
|
||||
)
|
||||
from homeassistant.const import CONF_USERNAME
|
||||
from homeassistant.core import callback
|
||||
|
@ -171,12 +170,12 @@ class RoborockFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||
@callback
|
||||
def async_get_options_flow(
|
||||
config_entry: ConfigEntry,
|
||||
) -> OptionsFlow:
|
||||
) -> RoborockOptionsFlowHandler:
|
||||
"""Create the options flow."""
|
||||
return RoborockOptionsFlowHandler(config_entry)
|
||||
return RoborockOptionsFlowHandler()
|
||||
|
||||
|
||||
class RoborockOptionsFlowHandler(OptionsFlowWithConfigEntry):
|
||||
class RoborockOptionsFlowHandler(OptionsFlow):
|
||||
"""Handle an option flow for Roborock."""
|
||||
|
||||
async def async_step_init(
|
||||
|
|
|
@ -14,7 +14,7 @@ from homeassistant.config_entries import (
|
|||
ConfigEntry,
|
||||
ConfigFlow,
|
||||
ConfigFlowResult,
|
||||
OptionsFlowWithConfigEntry,
|
||||
OptionsFlow,
|
||||
)
|
||||
from homeassistant.const import CONF_HOST, CONF_NAME
|
||||
from homeassistant.core import HomeAssistant, callback
|
||||
|
@ -165,12 +165,12 @@ class RokuConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||
@callback
|
||||
def async_get_options_flow(
|
||||
config_entry: ConfigEntry,
|
||||
) -> OptionsFlowWithConfigEntry:
|
||||
) -> RokuOptionsFlowHandler:
|
||||
"""Create the options flow."""
|
||||
return RokuOptionsFlowHandler(config_entry)
|
||||
return RokuOptionsFlowHandler()
|
||||
|
||||
|
||||
class RokuOptionsFlowHandler(OptionsFlowWithConfigEntry):
|
||||
class RokuOptionsFlowHandler(OptionsFlow):
|
||||
"""Handle Roku options."""
|
||||
|
||||
async def async_step_init(
|
||||
|
|
|
@ -16,7 +16,7 @@ from homeassistant.config_entries import (
|
|||
ConfigEntry,
|
||||
ConfigFlow,
|
||||
ConfigFlowResult,
|
||||
OptionsFlowWithConfigEntry,
|
||||
OptionsFlow,
|
||||
)
|
||||
from homeassistant.const import CONF_DELAY, CONF_HOST, CONF_NAME, CONF_PASSWORD
|
||||
from homeassistant.core import HomeAssistant, callback
|
||||
|
@ -92,7 +92,7 @@ class RoombaConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||
config_entry: ConfigEntry,
|
||||
) -> RoombaOptionsFlowHandler:
|
||||
"""Get the options flow for this handler."""
|
||||
return RoombaOptionsFlowHandler(config_entry)
|
||||
return RoombaOptionsFlowHandler()
|
||||
|
||||
async def async_step_zeroconf(
|
||||
self, discovery_info: zeroconf.ZeroconfServiceInfo
|
||||
|
@ -300,7 +300,7 @@ class RoombaConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||
)
|
||||
|
||||
|
||||
class RoombaOptionsFlowHandler(OptionsFlowWithConfigEntry):
|
||||
class RoombaOptionsFlowHandler(OptionsFlow):
|
||||
"""Handle options."""
|
||||
|
||||
async def async_step_init(
|
||||
|
|
|
@ -23,7 +23,7 @@ from homeassistant.config_entries import (
|
|||
ConfigEntry,
|
||||
ConfigFlow,
|
||||
ConfigFlowResult,
|
||||
OptionsFlowWithConfigEntry,
|
||||
OptionsFlow,
|
||||
)
|
||||
from homeassistant.const import (
|
||||
CONF_DEVICE_CLASS,
|
||||
|
@ -144,7 +144,7 @@ class SQLConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||
config_entry: ConfigEntry,
|
||||
) -> SQLOptionsFlowHandler:
|
||||
"""Get the options flow for this handler."""
|
||||
return SQLOptionsFlowHandler(config_entry)
|
||||
return SQLOptionsFlowHandler()
|
||||
|
||||
async def async_step_user(
|
||||
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."""
|
||||
|
||||
async def async_step_init(
|
||||
|
|
|
@ -21,7 +21,7 @@ from homeassistant.config_entries import (
|
|||
ConfigEntry,
|
||||
ConfigFlow,
|
||||
ConfigFlowResult,
|
||||
OptionsFlowWithConfigEntry,
|
||||
OptionsFlow,
|
||||
)
|
||||
from homeassistant.const import CONF_API_KEY, CONF_NAME, CONF_WEEKDAY, WEEKDAYS
|
||||
from homeassistant.core import HomeAssistant, callback
|
||||
|
@ -132,7 +132,7 @@ class TVTrainConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||
config_entry: ConfigEntry,
|
||||
) -> TVTrainOptionsFlowHandler:
|
||||
"""Get the options flow for this handler."""
|
||||
return TVTrainOptionsFlowHandler(config_entry)
|
||||
return TVTrainOptionsFlowHandler()
|
||||
|
||||
async def async_step_reauth(
|
||||
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."""
|
||||
|
||||
async def async_step_init(
|
||||
|
|
|
@ -16,7 +16,6 @@ from homeassistant.config_entries import (
|
|||
ConfigFlow,
|
||||
ConfigFlowResult,
|
||||
OptionsFlow,
|
||||
OptionsFlowWithConfigEntry,
|
||||
)
|
||||
from homeassistant.core import HomeAssistant, callback
|
||||
|
||||
|
@ -94,9 +93,11 @@ class UpnpFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||
|
||||
@staticmethod
|
||||
@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."""
|
||||
return UpnpOptionsFlowHandler(config_entry)
|
||||
return UpnpOptionsFlowHandler()
|
||||
|
||||
@property
|
||||
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)
|
||||
|
||||
|
||||
class UpnpOptionsFlowHandler(OptionsFlowWithConfigEntry):
|
||||
class UpnpOptionsFlowHandler(OptionsFlow):
|
||||
"""Handle an options flow."""
|
||||
|
||||
async def async_step_init(
|
||||
|
|
|
@ -17,7 +17,6 @@ from homeassistant.config_entries import (
|
|||
ConfigFlow,
|
||||
ConfigFlowResult,
|
||||
OptionsFlow,
|
||||
OptionsFlowWithConfigEntry,
|
||||
)
|
||||
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_USERNAME
|
||||
from homeassistant.core import HomeAssistant, callback
|
||||
|
@ -63,9 +62,11 @@ class VodafoneStationConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||
|
||||
@staticmethod
|
||||
@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."""
|
||||
return VodafoneStationOptionsFlowHandler(config_entry)
|
||||
return VodafoneStationOptionsFlowHandler()
|
||||
|
||||
async def async_step_user(
|
||||
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."""
|
||||
|
||||
async def async_step_init(
|
||||
|
|
|
@ -12,7 +12,7 @@ from homeassistant.config_entries import (
|
|||
ConfigEntry,
|
||||
ConfigFlow,
|
||||
ConfigFlowResult,
|
||||
OptionsFlowWithConfigEntry,
|
||||
OptionsFlow,
|
||||
)
|
||||
from homeassistant.const import CONF_HOST, CONF_MAC
|
||||
from homeassistant.core import callback
|
||||
|
@ -30,9 +30,11 @@ class WLEDFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||
|
||||
@staticmethod
|
||||
@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."""
|
||||
return WLEDOptionsFlowHandler(config_entry)
|
||||
return WLEDOptionsFlowHandler()
|
||||
|
||||
async def async_step_user(
|
||||
self, user_input: dict[str, Any] | None = None
|
||||
|
@ -117,7 +119,7 @@ class WLEDFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||
return await wled.update()
|
||||
|
||||
|
||||
class WLEDOptionsFlowHandler(OptionsFlowWithConfigEntry):
|
||||
class WLEDOptionsFlowHandler(OptionsFlow):
|
||||
"""Handle WLED options."""
|
||||
|
||||
async def async_step_init(
|
||||
|
|
|
@ -12,7 +12,7 @@ from homeassistant.config_entries import (
|
|||
ConfigEntry,
|
||||
ConfigFlow,
|
||||
ConfigFlowResult,
|
||||
OptionsFlowWithConfigEntry,
|
||||
OptionsFlow,
|
||||
)
|
||||
from homeassistant.const import CONF_COUNTRY, CONF_LANGUAGE, CONF_NAME
|
||||
from homeassistant.core import callback
|
||||
|
@ -219,7 +219,7 @@ class WorkdayConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||
config_entry: ConfigEntry,
|
||||
) -> WorkdayOptionsFlowHandler:
|
||||
"""Get the options flow for this handler."""
|
||||
return WorkdayOptionsFlowHandler(config_entry)
|
||||
return WorkdayOptionsFlowHandler()
|
||||
|
||||
async def async_step_user(
|
||||
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."""
|
||||
|
||||
async def async_step_init(
|
||||
|
@ -340,7 +340,7 @@ class WorkdayOptionsFlowHandler(OptionsFlowWithConfigEntry):
|
|||
else:
|
||||
LOGGER.debug("abort_check in options with %s", combined_input)
|
||||
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_OFFSET: combined_input[CONF_OFFSET],
|
||||
CONF_WORKDAYS: combined_input[CONF_WORKDAYS],
|
||||
|
|
|
@ -15,7 +15,7 @@ from homeassistant.config_entries import (
|
|||
SOURCE_REAUTH,
|
||||
ConfigEntry,
|
||||
ConfigFlowResult,
|
||||
OptionsFlowWithConfigEntry,
|
||||
OptionsFlow,
|
||||
)
|
||||
from homeassistant.const import CONF_ACCESS_TOKEN, CONF_TOKEN
|
||||
from homeassistant.core import callback
|
||||
|
@ -54,7 +54,7 @@ class OAuth2FlowHandler(
|
|||
config_entry: ConfigEntry,
|
||||
) -> YouTubeOptionsFlowHandler:
|
||||
"""Get the options flow for this handler."""
|
||||
return YouTubeOptionsFlowHandler(config_entry)
|
||||
return YouTubeOptionsFlowHandler()
|
||||
|
||||
@property
|
||||
def logger(self) -> logging.Logger:
|
||||
|
@ -159,7 +159,7 @@ class OAuth2FlowHandler(
|
|||
)
|
||||
|
||||
|
||||
class YouTubeOptionsFlowHandler(OptionsFlowWithConfigEntry):
|
||||
class YouTubeOptionsFlowHandler(OptionsFlow):
|
||||
"""YouTube Options flow handler."""
|
||||
|
||||
async def async_step_init(
|
||||
|
|
Loading…
Reference in New Issue