Add constructor return type in integrations E-K (#50902)

pull/50909/head
Michael 2021-05-20 17:47:30 +02:00 committed by GitHub
parent d7c0da90c5
commit b1138b1aab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
49 changed files with 64 additions and 60 deletions

View File

@ -37,7 +37,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
class EmonitorPowerSensor(CoordinatorEntity, SensorEntity): class EmonitorPowerSensor(CoordinatorEntity, SensorEntity):
"""Representation of an Emonitor power sensor entity.""" """Representation of an Emonitor power sensor entity."""
def __init__(self, coordinator: DataUpdateCoordinator, channel_number: int): def __init__(self, coordinator: DataUpdateCoordinator, channel_number: int) -> None:
"""Initialize the channel sensor.""" """Initialize the channel sensor."""
self.channel_number = channel_number self.channel_number = channel_number
super().__init__(coordinator) super().__init__(coordinator)

View File

@ -150,7 +150,9 @@ class EnturProxy:
class EnturPublicTransportSensor(SensorEntity): class EnturPublicTransportSensor(SensorEntity):
"""Implementation of a Entur public transport sensor.""" """Implementation of a Entur public transport sensor."""
def __init__(self, api: EnturProxy, name: str, stop: str, show_on_map: bool): def __init__(
self, api: EnturProxy, name: str, stop: str, show_on_map: bool
) -> None:
"""Initialize the sensor.""" """Initialize the sensor."""
self.api = api self.api = api
self._stop = stop self._stop = stop

View File

@ -724,7 +724,7 @@ def esphome_state_property(func):
class EsphomeEnumMapper: class EsphomeEnumMapper:
"""Helper class to convert between hass and esphome enum values.""" """Helper class to convert between hass and esphome enum values."""
def __init__(self, func: Callable[[], dict[int, str]]): def __init__(self, func: Callable[[], dict[int, str]]) -> None:
"""Construct a EsphomeEnumMapper.""" """Construct a EsphomeEnumMapper."""
self._func = func self._func = func
@ -750,7 +750,7 @@ def esphome_map_enum(func: Callable[[], dict[int, str]]):
class EsphomeBaseEntity(Entity): class EsphomeBaseEntity(Entity):
"""Define a base esphome entity.""" """Define a base esphome entity."""
def __init__(self, entry_id: str, component_key: str, key: int): def __init__(self, entry_id: str, component_key: str, key: int) -> None:
"""Initialize.""" """Initialize."""
self._entry_id = entry_id self._entry_id = entry_id
self._component_key = component_key self._component_key = component_key

View File

@ -32,7 +32,7 @@ async def async_setup_entry(
class EsphomeCamera(Camera, EsphomeBaseEntity): class EsphomeCamera(Camera, EsphomeBaseEntity):
"""A camera implementation for ESPHome.""" """A camera implementation for ESPHome."""
def __init__(self, entry_id: str, component_key: str, key: int): def __init__(self, entry_id: str, component_key: str, key: int) -> None:
"""Initialize.""" """Initialize."""
Camera.__init__(self) Camera.__init__(self)
EsphomeBaseEntity.__init__(self, entry_id, component_key, key) EsphomeBaseEntity.__init__(self, entry_id, component_key, key)

View File

@ -107,7 +107,7 @@ class FinTsClient:
Use this class as Context Manager to get the FinTS3Client object. Use this class as Context Manager to get the FinTS3Client object.
""" """
def __init__(self, credentials: BankCredentials, name: str): def __init__(self, credentials: BankCredentials, name: str) -> None:
"""Initialize a FinTsClient.""" """Initialize a FinTsClient."""
self._credentials = credentials self._credentials = credentials
self.name = name self.name = name

View File

@ -32,7 +32,7 @@ FirmataPinType = Union[int, str]
class FirmataBoard: class FirmataBoard:
"""Manages a single Firmata board.""" """Manages a single Firmata board."""
def __init__(self, config: dict): def __init__(self, config: dict) -> None:
"""Initialize the board.""" """Initialize the board."""
self.config = config self.config = config
self.api = None self.api = None

View File

@ -37,7 +37,7 @@ class FirmataPinEntity(FirmataEntity):
config_entry: ConfigEntry, config_entry: ConfigEntry,
name: str, name: str,
pin: FirmataPinType, pin: FirmataPinType,
): ) -> None:
"""Initialize the pin entity.""" """Initialize the pin entity."""
super().__init__(api) super().__init__(api)
self._name = name self._name = name

View File

@ -59,7 +59,7 @@ class FirmataLight(FirmataPinEntity, LightEntity):
config_entry: ConfigEntry, config_entry: ConfigEntry,
name: str, name: str,
pin: FirmataPinType, pin: FirmataPinType,
): ) -> None:
"""Initialize the light pin entity.""" """Initialize the light pin entity."""
super().__init__(api, config_entry, name, pin) super().__init__(api, config_entry, name, pin)

View File

@ -15,7 +15,7 @@ class FirmataPinUsedException(Exception):
class FirmataBoardPin: class FirmataBoardPin:
"""Manages a single Firmata board pin.""" """Manages a single Firmata board pin."""
def __init__(self, board: FirmataBoard, pin: FirmataPinType, pin_mode: str): def __init__(self, board: FirmataBoard, pin: FirmataPinType, pin_mode: str) -> None:
"""Initialize the pin.""" """Initialize the pin."""
self.board = board self.board = board
self._pin = pin self._pin = pin
@ -43,7 +43,7 @@ class FirmataBinaryDigitalOutput(FirmataBoardPin):
pin_mode: str, pin_mode: str,
initial: bool, initial: bool,
negate: bool, negate: bool,
): ) -> None:
"""Initialize the digital output pin.""" """Initialize the digital output pin."""
self._initial = initial self._initial = initial
self._negate = negate self._negate = negate
@ -98,7 +98,7 @@ class FirmataPWMOutput(FirmataBoardPin):
initial: bool, initial: bool,
minimum: int, minimum: int,
maximum: int, maximum: int,
): ) -> None:
"""Initialize the PWM/analog output pin.""" """Initialize the PWM/analog output pin."""
self._initial = initial self._initial = initial
self._min = minimum self._min = minimum
@ -139,7 +139,7 @@ class FirmataBinaryDigitalInput(FirmataBoardPin):
def __init__( def __init__(
self, board: FirmataBoard, pin: FirmataPinType, pin_mode: str, negate: bool self, board: FirmataBoard, pin: FirmataPinType, pin_mode: str, negate: bool
): ) -> None:
"""Initialize the digital input pin.""" """Initialize the digital input pin."""
self._negate = negate self._negate = negate
self._forward_callback = None self._forward_callback = None
@ -206,7 +206,7 @@ class FirmataAnalogInput(FirmataBoardPin):
def __init__( def __init__(
self, board: FirmataBoard, pin: FirmataPinType, pin_mode: str, differential: int self, board: FirmataBoard, pin: FirmataPinType, pin_mode: str, differential: int
): ) -> None:
"""Initialize the analog input pin.""" """Initialize the analog input pin."""
self._differential = differential self._differential = differential
self._forward_callback = None self._forward_callback = None

View File

@ -47,7 +47,7 @@ async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry):
class HassFlickAuth(AbstractFlickAuth): class HassFlickAuth(AbstractFlickAuth):
"""Implementation of AbstractFlickAuth based on a Home Assistant entity config.""" """Implementation of AbstractFlickAuth based on a Home Assistant entity config."""
def __init__(self, hass: HomeAssistant, entry: ConfigEntry): def __init__(self, hass: HomeAssistant, entry: ConfigEntry) -> None:
"""Flick authention based on a Home Assistant entity config.""" """Flick authention based on a Home Assistant entity config."""
super().__init__(aiohttp_client.async_get_clientsession(hass)) super().__init__(aiohttp_client.async_get_clientsession(hass))
self._entry = entry self._entry = entry

View File

@ -36,7 +36,7 @@ async def async_setup_entry(
class FlickPricingSensor(SensorEntity): class FlickPricingSensor(SensorEntity):
"""Entity object for Flick Electric sensor.""" """Entity object for Flick Electric sensor."""
def __init__(self, api: FlickAPI): def __init__(self, api: FlickAPI) -> None:
"""Entity object for Flick Electric sensor.""" """Entity object for Flick Electric sensor."""
self._api: FlickAPI = api self._api: FlickAPI = api
self._price: FlickPrice = None self._price: FlickPrice = None

View File

@ -21,7 +21,7 @@ class FloDeviceDataUpdateCoordinator(DataUpdateCoordinator):
def __init__( def __init__(
self, hass: HomeAssistant, api_client: API, location_id: str, device_id: str self, hass: HomeAssistant, api_client: API, location_id: str, device_id: str
): ) -> None:
"""Initialize the device.""" """Initialize the device."""
self.hass: HomeAssistant = hass self.hass: HomeAssistant = hass
self.api_client: API = api_client self.api_client: API = api_client

View File

@ -19,7 +19,7 @@ class FloEntity(Entity):
name: str, name: str,
device: FloDeviceDataUpdateCoordinator, device: FloDeviceDataUpdateCoordinator,
**kwargs, **kwargs,
): ) -> None:
"""Init Flo entity.""" """Init Flo entity."""
self._unique_id: str = f"{device.mac_address}_{entity_type}" self._unique_id: str = f"{device.mac_address}_{entity_type}"
self._name: str = name self._name: str = name

View File

@ -57,7 +57,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
class FloSwitch(FloEntity, SwitchEntity): class FloSwitch(FloEntity, SwitchEntity):
"""Switch class for the Flo by Moen valve.""" """Switch class for the Flo by Moen valve."""
def __init__(self, device: FloDeviceDataUpdateCoordinator): def __init__(self, device: FloDeviceDataUpdateCoordinator) -> None:
"""Initialize the Flo switch.""" """Initialize the Flo switch."""
super().__init__("shutoff_valve", "Shutoff Valve", device) super().__init__("shutoff_valve", "Shutoff Valve", device)
self._state = self._device.last_known_valve_state == "open" self._state = self._device.last_known_valve_state == "open"

View File

@ -51,7 +51,7 @@ class DeviceDataUpdateCoordinator(DataUpdateCoordinator):
update_interval: timedelta, update_interval: timedelta,
update_method: Callable[[], Awaitable] | None = None, update_method: Callable[[], Awaitable] | None = None,
request_refresh_debouncer: Debouncer | None = None, request_refresh_debouncer: Debouncer | None = None,
): ) -> None:
"""Initialize the data update coordinator.""" """Initialize the data update coordinator."""
DataUpdateCoordinator.__init__( DataUpdateCoordinator.__init__(
self, self,

View File

@ -364,7 +364,7 @@ class RequestData:
source: str, source: str,
request_id: str, request_id: str,
devices: list[dict] | None, devices: list[dict] | None,
): ) -> None:
"""Initialize the request data.""" """Initialize the request data."""
self.config = config self.config = config
self.source = source self.source = source
@ -388,7 +388,9 @@ def get_google_type(domain, device_class):
class GoogleEntity: class GoogleEntity:
"""Adaptation of Entity expressed in Google's terms.""" """Adaptation of Entity expressed in Google's terms."""
def __init__(self, hass: HomeAssistant, config: AbstractConfig, state: State): def __init__(
self, hass: HomeAssistant, config: AbstractConfig, state: State
) -> None:
"""Initialize a Google entity.""" """Initialize a Google entity."""
self.hass = hass self.hass = hass
self.config = config self.config = config

View File

@ -26,7 +26,7 @@ _LOGGER = logging.getLogger(__name__)
class DeviceDataUpdateCoordinator(DataUpdateCoordinator): class DeviceDataUpdateCoordinator(DataUpdateCoordinator):
"""Manages polling for state changes from the device.""" """Manages polling for state changes from the device."""
def __init__(self, hass: HomeAssistant, device: Device): def __init__(self, hass: HomeAssistant, device: Device) -> None:
"""Initialize the data update coordinator.""" """Initialize the data update coordinator."""
DataUpdateCoordinator.__init__( DataUpdateCoordinator.__init__(
self, self,

View File

@ -86,7 +86,7 @@ class ValveControllerSwitch(ValveControllerEntity, SwitchEntity):
entry: ConfigEntry, entry: ConfigEntry,
client: Client, client: Client,
coordinators: dict[str, DataUpdateCoordinator], coordinators: dict[str, DataUpdateCoordinator],
): ) -> None:
"""Initialize.""" """Initialize."""
super().__init__( super().__init__(
entry, coordinators, "valve", "Valve Controller", None, "mdi:water" entry, coordinators, "valve", "Valve Controller", None, "mdi:water"

View File

@ -29,7 +29,7 @@ class GuardianDataUpdateCoordinator(DataUpdateCoordinator[dict]):
api_coro: Callable[..., Awaitable], api_coro: Callable[..., Awaitable],
api_lock: asyncio.Lock, api_lock: asyncio.Lock,
valve_controller_uid: str, valve_controller_uid: str,
): ) -> None:
"""Initialize.""" """Initialize."""
super().__init__( super().__init__(
hass, hass,

View File

@ -49,7 +49,7 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
VERSION = 1 VERSION = 1
def __init__(self): def __init__(self) -> None:
"""Initialize the Harmony config flow.""" """Initialize the Harmony config flow."""
self.harmony_config = {} self.harmony_config = {}
@ -159,7 +159,7 @@ def _options_from_user_input(user_input):
class OptionsFlowHandler(config_entries.OptionsFlow): class OptionsFlowHandler(config_entries.OptionsFlow):
"""Handle a option flow for Harmony.""" """Handle a option flow for Harmony."""
def __init__(self, config_entry: config_entries.ConfigEntry): 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

View File

@ -34,7 +34,7 @@ def async_setup_auth_view(hass: HomeAssistant, user: User):
class HassIOBaseAuth(HomeAssistantView): class HassIOBaseAuth(HomeAssistantView):
"""Hass.io view to handle auth requests.""" """Hass.io view to handle auth requests."""
def __init__(self, hass: HomeAssistant, user: User): def __init__(self, hass: HomeAssistant, user: User) -> None:
"""Initialize WebView.""" """Initialize WebView."""
self.hass = hass self.hass = hass
self.user = user self.user = user

View File

@ -51,7 +51,7 @@ class HassIOView(HomeAssistantView):
url = "/api/hassio/{path:.+}" url = "/api/hassio/{path:.+}"
requires_auth = False requires_auth = False
def __init__(self, host: str, websession: aiohttp.ClientSession): def __init__(self, host: str, websession: aiohttp.ClientSession) -> None:
"""Initialize a Hass.io base view.""" """Initialize a Hass.io base view."""
self._host = host self._host = host
self._websession = websession self._websession = websession

View File

@ -35,7 +35,7 @@ class HassIOIngress(HomeAssistantView):
url = "/api/hassio_ingress/{token}/{path:.*}" url = "/api/hassio_ingress/{token}/{path:.*}"
requires_auth = False requires_auth = False
def __init__(self, host: str, websession: aiohttp.ClientSession): def __init__(self, host: str, websession: aiohttp.ClientSession) -> None:
"""Initialize a Hass.io ingress view.""" """Initialize a Hass.io ingress view."""
self._host = host self._host = host
self._websession = websession self._websession = websession

View File

@ -46,7 +46,7 @@ class ConfigEntryAuth(homeconnect.HomeConnectAPI):
hass: core.HomeAssistant, hass: core.HomeAssistant,
config_entry: config_entries.ConfigEntry, config_entry: config_entries.ConfigEntry,
implementation: config_entry_oauth2_flow.AbstractOAuth2Implementation, implementation: config_entry_oauth2_flow.AbstractOAuth2Implementation,
): ) -> None:
"""Initialize Home Connect Auth.""" """Initialize Home Connect Auth."""
self.hass = hass self.hass = hass
self.config_entry = config_entry self.config_entry = config_entry

View File

@ -27,7 +27,7 @@ class HomePlusControlOAuth2Implementation(
self, self,
hass: HomeAssistant, hass: HomeAssistant,
config_data: dict, config_data: dict,
): ) -> None:
"""HomePlusControlOAuth2Implementation Constructor. """HomePlusControlOAuth2Implementation Constructor.
Initialize the authentication implementation for the Legrand Home+ Control API. Initialize the authentication implementation for the Legrand Home+ Control API.

View File

@ -65,7 +65,7 @@ class AccessoryAidStorage:
persist over reboots. persist over reboots.
""" """
def __init__(self, hass: HomeAssistant, entry: ConfigEntry): def __init__(self, hass: HomeAssistant, entry: ConfigEntry) -> None:
"""Create a new entity map store.""" """Create a new entity map store."""
self.hass = hass self.hass = hass
self.allocations = {} self.allocations = {}

View File

@ -113,7 +113,7 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
VERSION = 1 VERSION = 1
def __init__(self): def __init__(self) -> None:
"""Initialize config flow.""" """Initialize config flow."""
self.hk_data = {} self.hk_data = {}
@ -263,7 +263,7 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
class OptionsFlowHandler(config_entries.OptionsFlow): class OptionsFlowHandler(config_entries.OptionsFlow):
"""Handle a option flow for homekit.""" """Handle a option flow for homekit."""
def __init__(self, config_entry: config_entries.ConfigEntry): 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
self.hk_options = {} self.hk_options = {}

View File

@ -249,7 +249,7 @@ class ConfigFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
class OptionsFlowHandler(config_entries.OptionsFlow): class OptionsFlowHandler(config_entries.OptionsFlow):
"""Huawei LTE options flow.""" """Huawei LTE options flow."""
def __init__(self, config_entry: config_entries.ConfigEntry): 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

View File

@ -38,7 +38,7 @@ class HuisbaasjeSensor(CoordinatorEntity, SensorEntity):
unit_of_measurement: str = POWER_WATT, unit_of_measurement: str = POWER_WATT,
icon: str = "mdi:lightning-bolt", icon: str = "mdi:lightning-bolt",
precision: int = 0, precision: int = 0,
): ) -> None:
"""Initialize the sensor.""" """Initialize the sensor."""
super().__init__(coordinator) super().__init__(coordinator)
self._user_id = user_id self._user_id = user_id

View File

@ -432,7 +432,7 @@ class HyperionConfigFlow(ConfigFlow, domain=DOMAIN):
class HyperionOptionsFlow(OptionsFlow): class HyperionOptionsFlow(OptionsFlow):
"""Hyperion options flow.""" """Hyperion options flow."""
def __init__(self, config_entry: ConfigEntry): def __init__(self, config_entry: ConfigEntry) -> None:
"""Initialize a Hyperion options flow.""" """Initialize a Hyperion options flow."""
self._config_entry = config_entry self._config_entry = config_entry

View File

@ -201,7 +201,7 @@ class AqualinkEntity(Entity):
class. class.
""" """
def __init__(self, dev: AqualinkDevice): def __init__(self, dev: AqualinkDevice) -> None:
"""Initialize the entity.""" """Initialize the entity."""
self.dev = dev self.dev = dev

View File

@ -85,7 +85,7 @@ class IcloudAccount:
max_interval: int, max_interval: int,
gps_accuracy_threshold: int, gps_accuracy_threshold: int,
config_entry: ConfigEntry, config_entry: ConfigEntry,
): ) -> None:
"""Initialize an iCloud account.""" """Initialize an iCloud account."""
self.hass = hass self.hass = hass
self._username = username self._username = username
@ -374,7 +374,7 @@ class IcloudAccount:
class IcloudDevice: class IcloudDevice:
"""Representation of a iCloud device.""" """Representation of a iCloud device."""
def __init__(self, account: IcloudAccount, device: AppleDevice, status): def __init__(self, account: IcloudAccount, device: AppleDevice, status) -> None:
"""Initialize the iCloud device.""" """Initialize the iCloud device."""
self._account = account self._account = account

View File

@ -61,7 +61,7 @@ def add_entities(account, async_add_entities, tracked):
class IcloudTrackerEntity(TrackerEntity): class IcloudTrackerEntity(TrackerEntity):
"""Represent a tracked device.""" """Represent a tracked device."""
def __init__(self, account: IcloudAccount, device: IcloudDevice): def __init__(self, account: IcloudAccount, device: IcloudDevice) -> None:
"""Set up the iCloud tracker entity.""" """Set up the iCloud tracker entity."""
self._account = account self._account = account
self._device = device self._device = device

View File

@ -53,7 +53,7 @@ def add_entities(account, async_add_entities, tracked):
class IcloudDeviceBatterySensor(SensorEntity): class IcloudDeviceBatterySensor(SensorEntity):
"""Representation of a iCloud device battery sensor.""" """Representation of a iCloud device battery sensor."""
def __init__(self, account: IcloudAccount, device: IcloudDevice): def __init__(self, account: IcloudAccount, device: IcloudDevice) -> None:
"""Initialize the battery sensor.""" """Initialize the battery sensor."""
self._account = account self._account = account
self._device = device self._device = device

View File

@ -159,7 +159,7 @@ class ImageServeView(HomeAssistantView):
def __init__( def __init__(
self, image_folder: pathlib.Path, image_collection: ImageStorageCollection self, image_folder: pathlib.Path, image_collection: ImageStorageCollection
): ) -> None:
"""Initialize image serve view.""" """Initialize image serve view."""
self.transform_lock = asyncio.Lock() self.transform_lock = asyncio.Lock()
self.image_folder = image_folder self.image_folder = image_folder

View File

@ -144,7 +144,7 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
class InputBoolean(ToggleEntity, RestoreEntity): class InputBoolean(ToggleEntity, RestoreEntity):
"""Representation of a boolean input.""" """Representation of a boolean input."""
def __init__(self, config: dict | None): def __init__(self, config: dict | None) -> None:
"""Initialize a boolean input.""" """Initialize a boolean input."""
self._config = config self._config = config
self.editable = True self.editable = True

View File

@ -196,7 +196,7 @@ class NumberStorageCollection(collection.StorageCollection):
class InputNumber(RestoreEntity): class InputNumber(RestoreEntity):
"""Representation of a slider.""" """Representation of a slider."""
def __init__(self, config: dict): def __init__(self, config: dict) -> None:
"""Initialize an input number.""" """Initialize an input number."""
self._config = config self._config = config
self.editable = True self.editable = True

View File

@ -201,7 +201,7 @@ class InputSelectStorageCollection(collection.StorageCollection):
class InputSelect(RestoreEntity): class InputSelect(RestoreEntity):
"""Representation of a select input.""" """Representation of a select input."""
def __init__(self, config: dict): def __init__(self, config: dict) -> None:
"""Initialize a select input.""" """Initialize a select input."""
self._config = config self._config = config
self.editable = True self.editable = True

View File

@ -190,7 +190,7 @@ class InputTextStorageCollection(collection.StorageCollection):
class InputText(RestoreEntity): class InputText(RestoreEntity):
"""Represent a text box.""" """Represent a text box."""
def __init__(self, config: dict): def __init__(self, config: dict) -> None:
"""Initialize a text input.""" """Initialize a text input."""
self._config = config self._config = config
self.editable = True self.editable = True

View File

@ -82,7 +82,7 @@ class IPPDataUpdateCoordinator(DataUpdateCoordinator[IPPPrinter]):
base_path: str, base_path: str,
tls: bool, tls: bool,
verify_ssl: bool, verify_ssl: bool,
): ) -> None:
"""Initialize global IPP data updater.""" """Initialize global IPP data updater."""
self.ipp = IPP( self.ipp = IPP(
host=host, host=host,

View File

@ -108,7 +108,7 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
VERSION = 1 VERSION = 1
def __init__(self): def __init__(self) -> None:
"""Initialize the isy994 config flow.""" """Initialize the isy994 config flow."""
self.discovered_conf = {} self.discovered_conf = {}
@ -194,7 +194,7 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
class OptionsFlowHandler(config_entries.OptionsFlow): class OptionsFlowHandler(config_entries.OptionsFlow):
"""Handle a option flow for isy994.""" """Handle a option flow for isy994."""
def __init__(self, config_entry: config_entries.ConfigEntry): 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

View File

@ -27,7 +27,7 @@ async def async_setup_entry(
class RouterOnlineBinarySensor(BinarySensorEntity): class RouterOnlineBinarySensor(BinarySensorEntity):
"""Representation router connection status.""" """Representation router connection status."""
def __init__(self, router: KeeneticRouter): def __init__(self, router: KeeneticRouter) -> None:
"""Initialize the APCUPSd binary device.""" """Initialize the APCUPSd binary device."""
self._router = router self._router = router

View File

@ -89,7 +89,7 @@ class KeeneticFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
class KeeneticOptionsFlowHandler(config_entries.OptionsFlow): class KeeneticOptionsFlowHandler(config_entries.OptionsFlow):
"""Handle options.""" """Handle options."""
def __init__(self, config_entry: ConfigEntry): def __init__(self, config_entry: ConfigEntry) -> None:
"""Initialize options flow.""" """Initialize options flow."""
self.config_entry = config_entry self.config_entry = config_entry
self._interface_options = {} self._interface_options = {}

View File

@ -155,7 +155,7 @@ def update_items(router: KeeneticRouter, async_add_entities, tracked: set[str]):
class KeeneticTracker(ScannerEntity): class KeeneticTracker(ScannerEntity):
"""Representation of network device.""" """Representation of network device."""
def __init__(self, device: Device, router: KeeneticRouter): def __init__(self, device: Device, router: KeeneticRouter) -> None:
"""Initialize the tracked device.""" """Initialize the tracked device."""
self._device = device self._device = device
self._router = router self._router = router

View File

@ -37,7 +37,7 @@ _LOGGER = logging.getLogger(__name__)
class KeeneticRouter: class KeeneticRouter:
"""Keenetic client Object.""" """Keenetic client Object."""
def __init__(self, hass: HomeAssistant, config_entry: ConfigEntry): def __init__(self, hass: HomeAssistant, config_entry: ConfigEntry) -> None:
"""Initialize the Client.""" """Initialize the Client."""
self.hass = hass self.hass = hass
self.config_entry = config_entry self.config_entry = config_entry

View File

@ -86,7 +86,7 @@ def _async_migrate_unique_id(
class KNXCover(KnxEntity, CoverEntity): class KNXCover(KnxEntity, CoverEntity):
"""Representation of a KNX cover.""" """Representation of a KNX cover."""
def __init__(self, xknx: XKNX, config: ConfigType): def __init__(self, xknx: XKNX, config: ConfigType) -> None:
"""Initialize the cover.""" """Initialize the cover."""
self._device: XknxCover self._device: XknxCover
super().__init__( super().__init__(

View File

@ -168,7 +168,7 @@ class KonnectedFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
# class variable to store/share discovered host information # class variable to store/share discovered host information
discovered_hosts = {} discovered_hosts = {}
def __init__(self): def __init__(self) -> None:
"""Initialize the Konnected flow.""" """Initialize the Konnected flow."""
self.data = {} self.data = {}
self.options = OPTIONS_SCHEMA({CONF_IO: {}}) self.options = OPTIONS_SCHEMA({CONF_IO: {}})
@ -360,7 +360,7 @@ class KonnectedFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
class OptionsFlowHandler(config_entries.OptionsFlow): class OptionsFlowHandler(config_entries.OptionsFlow):
"""Handle a option flow for a Konnected Panel.""" """Handle a option flow for a Konnected Panel."""
def __init__(self, config_entry: config_entries.ConfigEntry): def __init__(self, config_entry: config_entries.ConfigEntry) -> None:
"""Initialize options flow.""" """Initialize options flow."""
self.entry = config_entry self.entry = config_entry
self.model = self.entry.data[CONF_MODEL] self.model = self.entry.data[CONF_MODEL]

View File

@ -121,7 +121,7 @@ class PlenticoreUpdateCoordinator(DataUpdateCoordinator):
name: str, name: str,
update_inverval: timedelta, update_inverval: timedelta,
plenticore: Plenticore, plenticore: Plenticore,
): ) -> None:
"""Create a new update coordinator for plenticore data.""" """Create a new update coordinator for plenticore data."""
super().__init__( super().__init__(
hass=hass, hass=hass,

View File

@ -68,7 +68,7 @@ async def async_setup_entry(
class KulerskyLight(LightEntity): class KulerskyLight(LightEntity):
"""Representation of an Kuler Sky Light.""" """Representation of an Kuler Sky Light."""
def __init__(self, light: pykulersky.Light): def __init__(self, light: pykulersky.Light) -> None:
"""Initialize a Kuler Sky light.""" """Initialize a Kuler Sky light."""
self._light = light self._light = light
self._hs_color = None self._hs_color = None