Add async_get_options_flow type hints (n-z) (#73431)
This commit is contained in:
parent
b589700651
commit
42ed0fd47b
20 changed files with 106 additions and 35 deletions
|
@ -1,4 +1,6 @@
|
||||||
"""Config flow for Omnilogic integration."""
|
"""Config flow for Omnilogic integration."""
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from omnilogic import LoginException, OmniLogic, OmniLogicException
|
from omnilogic import LoginException, OmniLogic, OmniLogicException
|
||||||
|
@ -21,7 +23,9 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@callback
|
@callback
|
||||||
def async_get_options_flow(config_entry):
|
def async_get_options_flow(
|
||||||
|
config_entry: config_entries.ConfigEntry,
|
||||||
|
) -> OptionsFlowHandler:
|
||||||
"""Get the options flow for this handler."""
|
"""Get the options flow for this handler."""
|
||||||
return OptionsFlowHandler(config_entry)
|
return OptionsFlowHandler(config_entry)
|
||||||
|
|
||||||
|
@ -71,7 +75,7 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
||||||
class OptionsFlowHandler(config_entries.OptionsFlow):
|
class OptionsFlowHandler(config_entries.OptionsFlow):
|
||||||
"""Handle Omnilogic client options."""
|
"""Handle Omnilogic client options."""
|
||||||
|
|
||||||
def __init__(self, config_entry):
|
def __init__(self, config_entry: config_entries.ConfigEntry) -> None:
|
||||||
"""Initialize options flow."""
|
"""Initialize options flow."""
|
||||||
self.config_entry = config_entry
|
self.config_entry = config_entry
|
||||||
|
|
||||||
|
|
|
@ -76,7 +76,9 @@ class OnvifFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@callback
|
@callback
|
||||||
def async_get_options_flow(config_entry):
|
def async_get_options_flow(
|
||||||
|
config_entry: config_entries.ConfigEntry,
|
||||||
|
) -> OnvifOptionsFlowHandler:
|
||||||
"""Get the options flow for this handler."""
|
"""Get the options flow for this handler."""
|
||||||
return OnvifOptionsFlowHandler(config_entry)
|
return OnvifOptionsFlowHandler(config_entry)
|
||||||
|
|
||||||
|
@ -262,7 +264,7 @@ class OnvifFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
||||||
class OnvifOptionsFlowHandler(config_entries.OptionsFlow):
|
class OnvifOptionsFlowHandler(config_entries.OptionsFlow):
|
||||||
"""Handle ONVIF options."""
|
"""Handle ONVIF options."""
|
||||||
|
|
||||||
def __init__(self, config_entry):
|
def __init__(self, config_entry: config_entries.ConfigEntry) -> None:
|
||||||
"""Initialize ONVIF options flow."""
|
"""Initialize ONVIF options flow."""
|
||||||
self.config_entry = config_entry
|
self.config_entry = config_entry
|
||||||
self.options = dict(config_entry.options)
|
self.options = dict(config_entry.options)
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
"""OpenTherm Gateway config flow."""
|
"""OpenTherm Gateway config flow."""
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
|
||||||
import pyotgw
|
import pyotgw
|
||||||
|
@ -34,7 +36,9 @@ class OpenThermGwConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@callback
|
@callback
|
||||||
def async_get_options_flow(config_entry):
|
def async_get_options_flow(
|
||||||
|
config_entry: config_entries.ConfigEntry,
|
||||||
|
) -> OpenThermGwOptionsFlow:
|
||||||
"""Get the options flow for this handler."""
|
"""Get the options flow for this handler."""
|
||||||
return OpenThermGwOptionsFlow(config_entry)
|
return OpenThermGwOptionsFlow(config_entry)
|
||||||
|
|
||||||
|
@ -111,7 +115,7 @@ class OpenThermGwConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
||||||
class OpenThermGwOptionsFlow(config_entries.OptionsFlow):
|
class OpenThermGwOptionsFlow(config_entries.OptionsFlow):
|
||||||
"""Handle opentherm_gw options."""
|
"""Handle opentherm_gw options."""
|
||||||
|
|
||||||
def __init__(self, config_entry):
|
def __init__(self, config_entry: config_entries.ConfigEntry) -> None:
|
||||||
"""Initialize the options flow."""
|
"""Initialize the options flow."""
|
||||||
self.config_entry = config_entry
|
self.config_entry = config_entry
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
"""Config flow for OpenWeatherMap."""
|
"""Config flow for OpenWeatherMap."""
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
from pyowm import OWM
|
from pyowm import OWM
|
||||||
from pyowm.commons.exceptions import APIRequestError, UnauthorizedError
|
from pyowm.commons.exceptions import APIRequestError, UnauthorizedError
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
@ -33,7 +35,9 @@ class OpenWeatherMapConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@callback
|
@callback
|
||||||
def async_get_options_flow(config_entry):
|
def async_get_options_flow(
|
||||||
|
config_entry: config_entries.ConfigEntry,
|
||||||
|
) -> OpenWeatherMapOptionsFlow:
|
||||||
"""Get the options flow for this handler."""
|
"""Get the options flow for this handler."""
|
||||||
return OpenWeatherMapOptionsFlow(config_entry)
|
return OpenWeatherMapOptionsFlow(config_entry)
|
||||||
|
|
||||||
|
@ -89,7 +93,7 @@ class OpenWeatherMapConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
||||||
class OpenWeatherMapOptionsFlow(config_entries.OptionsFlow):
|
class OpenWeatherMapOptionsFlow(config_entries.OptionsFlow):
|
||||||
"""Handle options."""
|
"""Handle options."""
|
||||||
|
|
||||||
def __init__(self, config_entry):
|
def __init__(self, config_entry: config_entries.ConfigEntry) -> None:
|
||||||
"""Initialize options flow."""
|
"""Initialize options flow."""
|
||||||
self.config_entry = config_entry
|
self.config_entry = config_entry
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
"""Config flow for Plaato."""
|
"""Config flow for Plaato."""
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
from pyplaato.plaato import PlaatoDeviceType
|
from pyplaato.plaato import PlaatoDeviceType
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
|
@ -161,7 +163,7 @@ class PlaatoConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@callback
|
@callback
|
||||||
def async_get_options_flow(config_entry):
|
def async_get_options_flow(config_entry: ConfigEntry) -> PlaatoOptionsFlowHandler:
|
||||||
"""Get the options flow for this handler."""
|
"""Get the options flow for this handler."""
|
||||||
return PlaatoOptionsFlowHandler(config_entry)
|
return PlaatoOptionsFlowHandler(config_entry)
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
"""Config flow for Plex."""
|
"""Config flow for Plex."""
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
@ -85,7 +87,9 @@ class PlexFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@callback
|
@callback
|
||||||
def async_get_options_flow(config_entry):
|
def async_get_options_flow(
|
||||||
|
config_entry: config_entries.ConfigEntry,
|
||||||
|
) -> PlexOptionsFlowHandler:
|
||||||
"""Get the options flow for this handler."""
|
"""Get the options flow for this handler."""
|
||||||
return PlexOptionsFlowHandler(config_entry)
|
return PlexOptionsFlowHandler(config_entry)
|
||||||
|
|
||||||
|
@ -334,7 +338,7 @@ class PlexFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
||||||
class PlexOptionsFlowHandler(config_entries.OptionsFlow):
|
class PlexOptionsFlowHandler(config_entries.OptionsFlow):
|
||||||
"""Handle Plex options."""
|
"""Handle Plex options."""
|
||||||
|
|
||||||
def __init__(self, config_entry):
|
def __init__(self, config_entry: config_entries.ConfigEntry) -> None:
|
||||||
"""Initialize Plex options flow."""
|
"""Initialize Plex options flow."""
|
||||||
self.options = copy.deepcopy(dict(config_entry.options))
|
self.options = copy.deepcopy(dict(config_entry.options))
|
||||||
self.server_id = config_entry.data[CONF_SERVER_IDENTIFIER]
|
self.server_id = config_entry.data[CONF_SERVER_IDENTIFIER]
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
"""Config flow for pvpc_hourly_pricing."""
|
"""Config flow for pvpc_hourly_pricing."""
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant import config_entries
|
from homeassistant import config_entries
|
||||||
|
@ -15,7 +17,9 @@ class TariffSelectorConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@callback
|
@callback
|
||||||
def async_get_options_flow(config_entry):
|
def async_get_options_flow(
|
||||||
|
config_entry: config_entries.ConfigEntry,
|
||||||
|
) -> PVPCOptionsFlowHandler:
|
||||||
"""Get the options flow for this handler."""
|
"""Get the options flow for this handler."""
|
||||||
return PVPCOptionsFlowHandler(config_entry)
|
return PVPCOptionsFlowHandler(config_entry)
|
||||||
|
|
||||||
|
@ -36,7 +40,7 @@ class TariffSelectorConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
||||||
class PVPCOptionsFlowHandler(config_entries.OptionsFlow):
|
class PVPCOptionsFlowHandler(config_entries.OptionsFlow):
|
||||||
"""Handle PVPC options."""
|
"""Handle PVPC options."""
|
||||||
|
|
||||||
def __init__(self, config_entry):
|
def __init__(self, config_entry: config_entries.ConfigEntry) -> None:
|
||||||
"""Initialize options flow."""
|
"""Initialize options flow."""
|
||||||
self.config_entry = config_entry
|
self.config_entry = config_entry
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
"""Config flow for Rachio integration."""
|
"""Config flow for Rachio integration."""
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
from http import HTTPStatus
|
from http import HTTPStatus
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
@ -92,7 +94,9 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@callback
|
@callback
|
||||||
def async_get_options_flow(config_entry):
|
def async_get_options_flow(
|
||||||
|
config_entry: config_entries.ConfigEntry,
|
||||||
|
) -> OptionsFlowHandler:
|
||||||
"""Get the options flow for this handler."""
|
"""Get the options flow for this handler."""
|
||||||
return OptionsFlowHandler(config_entry)
|
return OptionsFlowHandler(config_entry)
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
"""Config flow for Risco integration."""
|
"""Config flow for Risco integration."""
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from pyrisco import CannotConnectError, RiscoAPI, UnauthorizedError
|
from pyrisco import CannotConnectError, RiscoAPI, UnauthorizedError
|
||||||
|
@ -67,7 +69,9 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@core.callback
|
@core.callback
|
||||||
def async_get_options_flow(config_entry):
|
def async_get_options_flow(
|
||||||
|
config_entry: config_entries.ConfigEntry,
|
||||||
|
) -> RiscoOptionsFlowHandler:
|
||||||
"""Define the config flow to handle options."""
|
"""Define the config flow to handle options."""
|
||||||
return RiscoOptionsFlowHandler(config_entry)
|
return RiscoOptionsFlowHandler(config_entry)
|
||||||
|
|
||||||
|
@ -98,7 +102,7 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
||||||
class RiscoOptionsFlowHandler(config_entries.OptionsFlow):
|
class RiscoOptionsFlowHandler(config_entries.OptionsFlow):
|
||||||
"""Handle a Risco options flow."""
|
"""Handle a Risco options flow."""
|
||||||
|
|
||||||
def __init__(self, config_entry):
|
def __init__(self, config_entry: config_entries.ConfigEntry) -> None:
|
||||||
"""Initialize."""
|
"""Initialize."""
|
||||||
self.config_entry = config_entry
|
self.config_entry = config_entry
|
||||||
self._data = {**DEFAULT_OPTIONS, **config_entry.options}
|
self._data = {**DEFAULT_OPTIONS, **config_entry.options}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
"""Config flow to configure roomba component."""
|
"""Config flow to configure roomba component."""
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
from functools import partial
|
from functools import partial
|
||||||
|
@ -78,7 +79,9 @@ class RoombaConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@callback
|
@callback
|
||||||
def async_get_options_flow(config_entry):
|
def async_get_options_flow(
|
||||||
|
config_entry: config_entries.ConfigEntry,
|
||||||
|
) -> OptionsFlowHandler:
|
||||||
"""Get the options flow for this handler."""
|
"""Get the options flow for this handler."""
|
||||||
return OptionsFlowHandler(config_entry)
|
return OptionsFlowHandler(config_entry)
|
||||||
|
|
||||||
|
@ -267,7 +270,7 @@ class RoombaConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
||||||
class OptionsFlowHandler(config_entries.OptionsFlow):
|
class OptionsFlowHandler(config_entries.OptionsFlow):
|
||||||
"""Handle options."""
|
"""Handle options."""
|
||||||
|
|
||||||
def __init__(self, config_entry):
|
def __init__(self, config_entry: config_entries.ConfigEntry) -> None:
|
||||||
"""Initialize options flow."""
|
"""Initialize options flow."""
|
||||||
self.config_entry = config_entry
|
self.config_entry = config_entry
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
"""Config flow for ScreenLogic."""
|
"""Config flow for ScreenLogic."""
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from screenlogicpy import ScreenLogicError, discovery
|
from screenlogicpy import ScreenLogicError, discovery
|
||||||
|
@ -69,7 +71,9 @@ class ScreenlogicConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@callback
|
@callback
|
||||||
def async_get_options_flow(config_entry):
|
def async_get_options_flow(
|
||||||
|
config_entry: config_entries.ConfigEntry,
|
||||||
|
) -> ScreenLogicOptionsFlowHandler:
|
||||||
"""Get the options flow for ScreenLogic."""
|
"""Get the options flow for ScreenLogic."""
|
||||||
return ScreenLogicOptionsFlowHandler(config_entry)
|
return ScreenLogicOptionsFlowHandler(config_entry)
|
||||||
|
|
||||||
|
|
|
@ -94,7 +94,9 @@ class SIAConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@callback
|
@callback
|
||||||
def async_get_options_flow(config_entry):
|
def async_get_options_flow(
|
||||||
|
config_entry: config_entries.ConfigEntry,
|
||||||
|
) -> SIAOptionsFlowHandler:
|
||||||
"""Get the options flow for this handler."""
|
"""Get the options flow for this handler."""
|
||||||
return SIAOptionsFlowHandler(config_entry)
|
return SIAOptionsFlowHandler(config_entry)
|
||||||
|
|
||||||
|
@ -170,7 +172,7 @@ class SIAConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
||||||
class SIAOptionsFlowHandler(config_entries.OptionsFlow):
|
class SIAOptionsFlowHandler(config_entries.OptionsFlow):
|
||||||
"""Handle SIA options."""
|
"""Handle SIA options."""
|
||||||
|
|
||||||
def __init__(self, config_entry):
|
def __init__(self, config_entry: config_entries.ConfigEntry) -> None:
|
||||||
"""Initialize SIA options flow."""
|
"""Initialize SIA options flow."""
|
||||||
self.config_entry = config_entry
|
self.config_entry = config_entry
|
||||||
self.options = deepcopy(dict(config_entry.options))
|
self.options = deepcopy(dict(config_entry.options))
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
"""Config flow for Somfy MyLink integration."""
|
"""Config flow for Somfy MyLink integration."""
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
from copy import deepcopy
|
from copy import deepcopy
|
||||||
import logging
|
import logging
|
||||||
|
@ -110,7 +112,9 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@callback
|
@callback
|
||||||
def async_get_options_flow(config_entry):
|
def async_get_options_flow(
|
||||||
|
config_entry: config_entries.ConfigEntry,
|
||||||
|
) -> OptionsFlowHandler:
|
||||||
"""Get the options flow for this handler."""
|
"""Get the options flow for this handler."""
|
||||||
return OptionsFlowHandler(config_entry)
|
return OptionsFlowHandler(config_entry)
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
"""Config flow for Subaru integration."""
|
"""Config flow for Subaru integration."""
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
@ -83,7 +85,9 @@ class SubaruConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@callback
|
@callback
|
||||||
def async_get_options_flow(config_entry):
|
def async_get_options_flow(
|
||||||
|
config_entry: config_entries.ConfigEntry,
|
||||||
|
) -> OptionsFlowHandler:
|
||||||
"""Get the options flow for this handler."""
|
"""Get the options flow for this handler."""
|
||||||
return OptionsFlowHandler(config_entry)
|
return OptionsFlowHandler(config_entry)
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
"""Config flow for Tado integration."""
|
"""Config flow for Tado integration."""
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from PyTado.interface import Tado
|
from PyTado.interface import Tado
|
||||||
|
@ -112,7 +114,9 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@callback
|
@callback
|
||||||
def async_get_options_flow(config_entry):
|
def async_get_options_flow(
|
||||||
|
config_entry: config_entries.ConfigEntry,
|
||||||
|
) -> OptionsFlowHandler:
|
||||||
"""Get the options flow for this handler."""
|
"""Get the options flow for this handler."""
|
||||||
return OptionsFlowHandler(config_entry)
|
return OptionsFlowHandler(config_entry)
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
"""Config flow for the Total Connect component."""
|
"""Config flow for the Total Connect component."""
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
from total_connect_client.client import TotalConnectClient
|
from total_connect_client.client import TotalConnectClient
|
||||||
from total_connect_client.exceptions import AuthenticationError
|
from total_connect_client.exceptions import AuthenticationError
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
@ -166,7 +168,9 @@ class TotalConnectConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@callback
|
@callback
|
||||||
def async_get_options_flow(config_entry):
|
def async_get_options_flow(
|
||||||
|
config_entry: config_entries.ConfigEntry,
|
||||||
|
) -> TotalConnectOptionsFlowHandler:
|
||||||
"""Get options flow."""
|
"""Get options flow."""
|
||||||
return TotalConnectOptionsFlowHandler(config_entry)
|
return TotalConnectOptionsFlowHandler(config_entry)
|
||||||
|
|
||||||
|
@ -174,7 +178,7 @@ class TotalConnectConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
||||||
class TotalConnectOptionsFlowHandler(config_entries.OptionsFlow):
|
class TotalConnectOptionsFlowHandler(config_entries.OptionsFlow):
|
||||||
"""TotalConnect options flow handler."""
|
"""TotalConnect options flow handler."""
|
||||||
|
|
||||||
def __init__(self, config_entry):
|
def __init__(self, config_entry: config_entries.ConfigEntry) -> None:
|
||||||
"""Initialize options flow."""
|
"""Initialize options flow."""
|
||||||
self.config_entry = config_entry
|
self.config_entry = config_entry
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
"""Config flow for Transmission Bittorent Client."""
|
"""Config flow for Transmission Bittorent Client."""
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant import config_entries
|
from homeassistant import config_entries
|
||||||
|
@ -44,7 +46,9 @@ class TransmissionFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@callback
|
@callback
|
||||||
def async_get_options_flow(config_entry):
|
def async_get_options_flow(
|
||||||
|
config_entry: config_entries.ConfigEntry,
|
||||||
|
) -> TransmissionOptionsFlowHandler:
|
||||||
"""Get the options flow for this handler."""
|
"""Get the options flow for this handler."""
|
||||||
return TransmissionOptionsFlowHandler(config_entry)
|
return TransmissionOptionsFlowHandler(config_entry)
|
||||||
|
|
||||||
|
@ -87,7 +91,7 @@ class TransmissionFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
||||||
class TransmissionOptionsFlowHandler(config_entries.OptionsFlow):
|
class TransmissionOptionsFlowHandler(config_entries.OptionsFlow):
|
||||||
"""Handle Transmission client options."""
|
"""Handle Transmission client options."""
|
||||||
|
|
||||||
def __init__(self, config_entry):
|
def __init__(self, config_entry: config_entries.ConfigEntry) -> None:
|
||||||
"""Initialize Transmission options flow."""
|
"""Initialize Transmission options flow."""
|
||||||
self.config_entry = config_entry
|
self.config_entry = config_entry
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
Used by UI to setup a wiffi integration.
|
Used by UI to setup a wiffi integration.
|
||||||
"""
|
"""
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
import errno
|
import errno
|
||||||
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
@ -21,7 +23,9 @@ class WiffiFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@callback
|
@callback
|
||||||
def async_get_options_flow(config_entry):
|
def async_get_options_flow(
|
||||||
|
config_entry: config_entries.ConfigEntry,
|
||||||
|
) -> OptionsFlowHandler:
|
||||||
"""Create Wiffi server setup option flow."""
|
"""Create Wiffi server setup option flow."""
|
||||||
return OptionsFlowHandler(config_entry)
|
return OptionsFlowHandler(config_entry)
|
||||||
|
|
||||||
|
@ -66,7 +70,7 @@ class WiffiFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
||||||
class OptionsFlowHandler(config_entries.OptionsFlow):
|
class OptionsFlowHandler(config_entries.OptionsFlow):
|
||||||
"""Wiffi server setup option flow."""
|
"""Wiffi server setup option flow."""
|
||||||
|
|
||||||
def __init__(self, config_entry):
|
def __init__(self, config_entry: config_entries.ConfigEntry) -> None:
|
||||||
"""Initialize options flow."""
|
"""Initialize options flow."""
|
||||||
self.config_entry = config_entry
|
self.config_entry = config_entry
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
"""Config flow for WS66i 6-Zone Amplifier integration."""
|
"""Config flow for WS66i 6-Zone Amplifier integration."""
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
|
@ -114,7 +116,9 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@core.callback
|
@core.callback
|
||||||
def async_get_options_flow(config_entry):
|
def async_get_options_flow(
|
||||||
|
config_entry: config_entries.ConfigEntry,
|
||||||
|
) -> Ws66iOptionsFlowHandler:
|
||||||
"""Define the config flow to handle options."""
|
"""Define the config flow to handle options."""
|
||||||
return Ws66iOptionsFlowHandler(config_entry)
|
return Ws66iOptionsFlowHandler(config_entry)
|
||||||
|
|
||||||
|
@ -131,7 +135,7 @@ def _key_for_source(index, source, previous_sources):
|
||||||
class Ws66iOptionsFlowHandler(config_entries.OptionsFlow):
|
class Ws66iOptionsFlowHandler(config_entries.OptionsFlow):
|
||||||
"""Handle a WS66i options flow."""
|
"""Handle a WS66i options flow."""
|
||||||
|
|
||||||
def __init__(self, config_entry):
|
def __init__(self, config_entry: config_entries.ConfigEntry) -> None:
|
||||||
"""Initialize."""
|
"""Initialize."""
|
||||||
self.config_entry = config_entry
|
self.config_entry = config_entry
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
"""Config flow for Yeelight integration."""
|
"""Config flow for Yeelight integration."""
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
import logging
|
import logging
|
||||||
from urllib.parse import urlparse
|
from urllib.parse import urlparse
|
||||||
|
@ -10,7 +12,7 @@ from yeelight.main import get_known_models
|
||||||
|
|
||||||
from homeassistant import config_entries, exceptions
|
from homeassistant import config_entries, exceptions
|
||||||
from homeassistant.components import dhcp, ssdp, zeroconf
|
from homeassistant.components import dhcp, ssdp, zeroconf
|
||||||
from homeassistant.config_entries import ConfigEntryState
|
from homeassistant.config_entries import ConfigEntry, ConfigEntryState
|
||||||
from homeassistant.const import CONF_DEVICE, CONF_HOST, CONF_ID, CONF_MODEL, CONF_NAME
|
from homeassistant.const import CONF_DEVICE, CONF_HOST, CONF_ID, CONF_MODEL, CONF_NAME
|
||||||
from homeassistant.core import callback
|
from homeassistant.core import callback
|
||||||
from homeassistant.data_entry_flow import FlowResult
|
from homeassistant.data_entry_flow import FlowResult
|
||||||
|
@ -46,7 +48,7 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@callback
|
@callback
|
||||||
def async_get_options_flow(config_entry):
|
def async_get_options_flow(config_entry: ConfigEntry) -> OptionsFlowHandler:
|
||||||
"""Return the options flow."""
|
"""Return the options flow."""
|
||||||
return OptionsFlowHandler(config_entry)
|
return OptionsFlowHandler(config_entry)
|
||||||
|
|
||||||
|
@ -276,7 +278,7 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
||||||
class OptionsFlowHandler(config_entries.OptionsFlow):
|
class OptionsFlowHandler(config_entries.OptionsFlow):
|
||||||
"""Handle a option flow for Yeelight."""
|
"""Handle a option flow for Yeelight."""
|
||||||
|
|
||||||
def __init__(self, config_entry):
|
def __init__(self, config_entry: ConfigEntry) -> None:
|
||||||
"""Initialize the option flow."""
|
"""Initialize the option flow."""
|
||||||
self._config_entry = config_entry
|
self._config_entry = config_entry
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue