Add async_get_options_flow type hints (a-m) (#73430)

This commit is contained in:
epenet 2022-06-13 13:17:59 +02:00 committed by GitHub
parent ca0a185b32
commit b589700651
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
25 changed files with 129 additions and 42 deletions

View File

@ -1,4 +1,6 @@
"""Config flow for AEMET OpenData."""
from __future__ import annotations
from aemet_opendata import AEMET
import voluptuous as vol
@ -50,7 +52,9 @@ class AemetConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
@staticmethod
@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."""
return OptionsFlowHandler(config_entry)

View File

@ -1,4 +1,6 @@
"""Config flow for AlarmDecoder."""
from __future__ import annotations
import logging
from adext import AdExt
@ -58,7 +60,9 @@ class AlarmDecoderFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
@staticmethod
@callback
def async_get_options_flow(config_entry):
def async_get_options_flow(
config_entry: config_entries.ConfigEntry,
) -> AlarmDecoderOptionsFlowHandler:
"""Get the options flow for AlarmDecoder."""
return AlarmDecoderOptionsFlowHandler(config_entry)

View File

@ -71,7 +71,9 @@ class AppleTVConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
@staticmethod
@callback
def async_get_options_flow(config_entry):
def async_get_options_flow(
config_entry: config_entries.ConfigEntry,
) -> AppleTVOptionsFlow:
"""Get options flow for this handler."""
return AppleTVOptionsFlow(config_entry)
@ -523,7 +525,7 @@ class AppleTVConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
class AppleTVOptionsFlow(config_entries.OptionsFlow):
"""Handle Apple TV options."""
def __init__(self, config_entry):
def __init__(self, config_entry: config_entries.ConfigEntry) -> None:
"""Initialize Apple TV options flow."""
self.config_entry = config_entry
self.options = dict(config_entry.options)

View File

@ -1,4 +1,6 @@
"""Config flow for SpaceX Launches and Starman."""
from __future__ import annotations
import logging
from aiohttp import ClientError
@ -22,7 +24,9 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
@staticmethod
@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."""
return OptionsFlowHandler(config_entry)
@ -82,7 +86,7 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
class OptionsFlowHandler(config_entries.OptionsFlow):
"""Handle options flow changes."""
def __init__(self, config_entry):
def __init__(self, config_entry: config_entries.ConfigEntry) -> None:
"""Initialize options flow."""
self.config_entry = config_entry

View File

@ -79,7 +79,9 @@ class AEHConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
@staticmethod
@callback
def async_get_options_flow(config_entry):
def async_get_options_flow(
config_entry: config_entries.ConfigEntry,
) -> AEHOptionsFlowHandler:
"""Get the options flow for this handler."""
return AEHOptionsFlowHandler(config_entry)
@ -170,7 +172,7 @@ class AEHConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
class AEHOptionsFlowHandler(config_entries.OptionsFlow):
"""Handle azure event hub options."""
def __init__(self, config_entry):
def __init__(self, config_entry: config_entries.ConfigEntry) -> None:
"""Initialize AEH options flow."""
self.config_entry = config_entry
self.options = deepcopy(dict(config_entry.options))

View File

@ -1,4 +1,6 @@
"""Config flow to configure Blink."""
from __future__ import annotations
import logging
from blinkpy.auth import Auth, LoginError, TokenRefreshFailed
@ -49,7 +51,9 @@ class BlinkConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
@staticmethod
@callback
def async_get_options_flow(config_entry):
def async_get_options_flow(
config_entry: config_entries.ConfigEntry,
) -> BlinkOptionsFlowHandler:
"""Get options flow for this handler."""
return BlinkOptionsFlowHandler(config_entry)
@ -129,7 +133,7 @@ class BlinkConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
class BlinkOptionsFlowHandler(config_entries.OptionsFlow):
"""Handle Blink options."""
def __init__(self, config_entry):
def __init__(self, config_entry: config_entries.ConfigEntry) -> None:
"""Initialize Blink options flow."""
self.config_entry = config_entry
self.options = dict(config_entry.options)

View File

@ -1,4 +1,6 @@
"""Config flow for Coinbase integration."""
from __future__ import annotations
import logging
from coinbase.wallet.client import Client
@ -160,7 +162,9 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
@staticmethod
@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."""
return OptionsFlowHandler(config_entry)

View File

@ -1,4 +1,6 @@
"""Config flow for Control4 integration."""
from __future__ import annotations
from asyncio import TimeoutError as asyncioTimeoutError
import logging
@ -136,7 +138,9 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
@staticmethod
@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."""
return OptionsFlowHandler(config_entry)

View File

@ -1,4 +1,6 @@
"""Config flow to configure demo component."""
from __future__ import annotations
import voluptuous as vol
from homeassistant import config_entries
@ -21,7 +23,9 @@ class DemoConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
@staticmethod
@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."""
return OptionsFlowHandler(config_entry)
@ -33,7 +37,7 @@ class DemoConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
class OptionsFlowHandler(config_entries.OptionsFlow):
"""Handle options."""
def __init__(self, config_entry):
def __init__(self, config_entry: config_entries.ConfigEntry) -> None:
"""Initialize options flow."""
self.config_entry = config_entry
self.options = dict(config_entry.options)

View File

@ -1,4 +1,6 @@
"""Config flow for Dexcom integration."""
from __future__ import annotations
from pydexcom import AccountError, Dexcom, SessionError
import voluptuous as vol
@ -53,7 +55,9 @@ class DexcomConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
@staticmethod
@callback
def async_get_options_flow(config_entry):
def async_get_options_flow(
config_entry: config_entries.ConfigEntry,
) -> DexcomOptionsFlowHandler:
"""Get the options flow for this handler."""
return DexcomOptionsFlowHandler(config_entry)

View File

@ -1,4 +1,6 @@
"""Config flow for DoorBird integration."""
from __future__ import annotations
from http import HTTPStatus
from ipaddress import ip_address
import logging
@ -144,7 +146,9 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
@staticmethod
@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."""
return OptionsFlowHandler(config_entry)

View File

@ -1,4 +1,6 @@
"""Config flow for ezviz."""
from __future__ import annotations
import logging
from pyezviz.client import EzvizClient
@ -12,7 +14,7 @@ from pyezviz.exceptions import (
from pyezviz.test_cam_rtsp import TestRTSPAuth
import voluptuous as vol
from homeassistant.config_entries import ConfigFlow, OptionsFlow
from homeassistant.config_entries import ConfigEntry, ConfigFlow, OptionsFlow
from homeassistant.const import (
CONF_CUSTOMIZE,
CONF_IP_ADDRESS,
@ -164,7 +166,7 @@ class EzvizConfigFlow(ConfigFlow, domain=DOMAIN):
@staticmethod
@callback
def async_get_options_flow(config_entry):
def async_get_options_flow(config_entry: ConfigEntry) -> EzvizOptionsFlowHandler:
"""Get the options flow for this handler."""
return EzvizOptionsFlowHandler(config_entry)
@ -311,7 +313,7 @@ class EzvizConfigFlow(ConfigFlow, domain=DOMAIN):
class EzvizOptionsFlowHandler(OptionsFlow):
"""Handle Ezviz client options."""
def __init__(self, config_entry):
def __init__(self, config_entry: ConfigEntry) -> None:
"""Initialize options flow."""
self.config_entry = config_entry

View File

@ -46,7 +46,7 @@ TEST_CONNECTION_ERROR_DICT = {
class ForkedDaapdOptionsFlowHandler(config_entries.OptionsFlow):
"""Handle a forked-daapd options flow."""
def __init__(self, config_entry):
def __init__(self, config_entry: config_entries.ConfigEntry) -> None:
"""Initialize."""
self.config_entry = config_entry
@ -110,7 +110,9 @@ class ForkedDaapdFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
@staticmethod
@callback
def async_get_options_flow(config_entry):
def async_get_options_flow(
config_entry: config_entries.ConfigEntry,
) -> ForkedDaapdOptionsFlowHandler:
"""Return options flow handler."""
return ForkedDaapdOptionsFlowHandler(config_entry)

View File

@ -1,4 +1,6 @@
"""Config flow for Glances."""
from __future__ import annotations
import glances_api
import voluptuous as vol
@ -59,7 +61,9 @@ class GlancesFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
@staticmethod
@callback
def async_get_options_flow(config_entry):
def async_get_options_flow(
config_entry: config_entries.ConfigEntry,
) -> GlancesOptionsFlowHandler:
"""Get the options flow for this handler."""
return GlancesOptionsFlowHandler(config_entry)
@ -86,7 +90,7 @@ class GlancesFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
class GlancesOptionsFlowHandler(config_entries.OptionsFlow):
"""Handle Glances client options."""
def __init__(self, config_entry):
def __init__(self, config_entry: config_entries.ConfigEntry) -> None:
"""Initialize Glances options flow."""
self.config_entry = config_entry

View File

@ -1,4 +1,6 @@
"""Config flow for Logitech Harmony Hub integration."""
from __future__ import annotations
import asyncio
import logging
from urllib.parse import urlparse
@ -137,7 +139,9 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
@staticmethod
@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."""
return OptionsFlowHandler(config_entry)

View File

@ -1,4 +1,5 @@
"""Config Flow for Hive."""
from __future__ import annotations
from apyhiveapi import Auth
from apyhiveapi.helper.hive_exceptions import (
@ -130,7 +131,9 @@ class HiveFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
@staticmethod
@callback
def async_get_options_flow(config_entry):
def async_get_options_flow(
config_entry: config_entries.ConfigEntry,
) -> HiveOptionsFlowHandler:
"""Hive options callback."""
return HiveOptionsFlowHandler(config_entry)
@ -138,7 +141,7 @@ class HiveFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
class HiveOptionsFlowHandler(config_entries.OptionsFlow):
"""Config flow options for Hive."""
def __init__(self, config_entry):
def __init__(self, config_entry: config_entries.ConfigEntry) -> None:
"""Initialize Hive options flow."""
self.hive = None
self.config_entry = config_entry

View File

@ -1,4 +1,6 @@
"""Config flow to configure the honeywell integration."""
from __future__ import annotations
import voluptuous as vol
from homeassistant import config_entries
@ -52,7 +54,9 @@ class HoneywellConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
@staticmethod
@callback
def async_get_options_flow(config_entry):
def async_get_options_flow(
config_entry: config_entries.ConfigEntry,
) -> HoneywellOptionsFlowHandler:
"""Options callback for Honeywell."""
return HoneywellOptionsFlowHandler(config_entry)

View File

@ -119,7 +119,9 @@ class InsteonFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
@staticmethod
@callback
def async_get_options_flow(config_entry):
def async_get_options_flow(
config_entry: config_entries.ConfigEntry,
) -> InsteonOptionsFlowHandler:
"""Define the config flow to handle options."""
return InsteonOptionsFlowHandler(config_entry)
@ -234,7 +236,7 @@ class InsteonFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
class InsteonOptionsFlowHandler(config_entries.OptionsFlow):
"""Handle an Insteon options flow."""
def __init__(self, config_entry):
def __init__(self, config_entry: config_entries.ConfigEntry) -> None:
"""Init the InsteonOptionsFlowHandler class."""
self.config_entry = config_entry

View File

@ -1,4 +1,6 @@
"""Config flow for Islamic Prayer Times integration."""
from __future__ import annotations
import voluptuous as vol
from homeassistant import config_entries
@ -14,7 +16,9 @@ class IslamicPrayerFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
@staticmethod
@callback
def async_get_options_flow(config_entry):
def async_get_options_flow(
config_entry: config_entries.ConfigEntry,
) -> IslamicPrayerOptionsFlowHandler:
"""Get the options flow for this handler."""
return IslamicPrayerOptionsFlowHandler(config_entry)
@ -36,7 +40,7 @@ class IslamicPrayerFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
class IslamicPrayerOptionsFlowHandler(config_entries.OptionsFlow):
"""Handle Islamic Prayer client options."""
def __init__(self, config_entry):
def __init__(self, config_entry: config_entries.ConfigEntry) -> None:
"""Initialize options flow."""
self.config_entry = config_entry

View File

@ -1,4 +1,6 @@
"""Config flow for kmtronic integration."""
from __future__ import annotations
import logging
import aiohttp
@ -52,7 +54,9 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
@staticmethod
@callback
def async_get_options_flow(config_entry):
def async_get_options_flow(
config_entry: config_entries.ConfigEntry,
) -> KMTronicOptionsFlow:
"""Get the options flow for this handler."""
return KMTronicOptionsFlow(config_entry)
@ -88,7 +92,7 @@ class InvalidAuth(exceptions.HomeAssistantError):
class KMTronicOptionsFlow(config_entries.OptionsFlow):
"""Handle options."""
def __init__(self, config_entry):
def __init__(self, config_entry: config_entries.ConfigEntry) -> None:
"""Initialize options flow."""
self.config_entry = config_entry

View File

@ -1,4 +1,6 @@
"""Config flow for konnected.io integration."""
from __future__ import annotations
import asyncio
import copy
import logging
@ -373,7 +375,9 @@ class KonnectedFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
@staticmethod
@callback
def async_get_options_flow(config_entry):
def async_get_options_flow(
config_entry: config_entries.ConfigEntry,
) -> OptionsFlowHandler:
"""Return the Options Flow."""
return OptionsFlowHandler(config_entry)

View File

@ -19,7 +19,7 @@ from .const import CONF_DEFAULT_TRANSITION, DOMAIN
class LiteJetOptionsFlow(config_entries.OptionsFlow):
"""Handle LiteJet options."""
def __init__(self, config_entry):
def __init__(self, config_entry: config_entries.ConfigEntry) -> None:
"""Initialize LiteJet options flow."""
self.config_entry = config_entry
@ -85,6 +85,8 @@ class LiteJetConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
@staticmethod
@callback
def async_get_options_flow(config_entry):
def async_get_options_flow(
config_entry: config_entries.ConfigEntry,
) -> LiteJetOptionsFlow:
"""Get the options flow for this handler."""
return LiteJetOptionsFlow(config_entry)

View File

@ -1,11 +1,13 @@
"""Config flow to configure the Meteo-France integration."""
from __future__ import annotations
import logging
from meteofrance_api.client import MeteoFranceClient
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.config_entries import SOURCE_IMPORT
from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry
from homeassistant.const import CONF_LATITUDE, CONF_LONGITUDE, CONF_MODE
from homeassistant.core import callback
@ -25,7 +27,9 @@ class MeteoFranceFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
@staticmethod
@callback
def async_get_options_flow(config_entry):
def async_get_options_flow(
config_entry: ConfigEntry,
) -> MeteoFranceOptionsFlowHandler:
"""Get the options flow for this handler."""
return MeteoFranceOptionsFlowHandler(config_entry)

View File

@ -1,4 +1,6 @@
"""Config flow for Mikrotik."""
from __future__ import annotations
import voluptuous as vol
from homeassistant import config_entries
@ -32,7 +34,9 @@ class MikrotikFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
@staticmethod
@callback
def async_get_options_flow(config_entry):
def async_get_options_flow(
config_entry: config_entries.ConfigEntry,
) -> MikrotikOptionsFlowHandler:
"""Get the options flow for this handler."""
return MikrotikOptionsFlowHandler(config_entry)
@ -78,7 +82,7 @@ class MikrotikFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
class MikrotikOptionsFlowHandler(config_entries.OptionsFlow):
"""Handle Mikrotik options."""
def __init__(self, config_entry):
def __init__(self, config_entry: config_entries.ConfigEntry) -> None:
"""Initialize Mikrotik options flow."""
self.config_entry = config_entry

View File

@ -1,4 +1,6 @@
"""Config flow for Monoprice 6-Zone Amplifier integration."""
from __future__ import annotations
import logging
from pymonoprice import get_async_monoprice
@ -90,7 +92,9 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
@staticmethod
@core.callback
def async_get_options_flow(config_entry):
def async_get_options_flow(
config_entry: config_entries.ConfigEntry,
) -> MonopriceOptionsFlowHandler:
"""Define the config flow to handle options."""
return MonopriceOptionsFlowHandler(config_entry)
@ -110,7 +114,7 @@ def _key_for_source(index, source, previous_sources):
class MonopriceOptionsFlowHandler(config_entries.OptionsFlow):
"""Handle a Monoprice options flow."""
def __init__(self, config_entry):
def __init__(self, config_entry: config_entries.ConfigEntry) -> None:
"""Initialize."""
self.config_entry = config_entry