Improve bluetooth generic typing (#84891)

Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
Marc Mueller 2023-01-03 08:19:53 +01:00 committed by GitHub
parent 6b95fa5942
commit 972eb34ed9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 71 additions and 42 deletions

View file

@ -1,7 +1,7 @@
"""MicroBot class."""
from __future__ import annotations
from typing import TYPE_CHECKING, Any
from typing import Any
from homeassistant.components.bluetooth.passive_update_coordinator import (
PassiveBluetoothCoordinatorEntity,
@ -10,16 +10,12 @@ from homeassistant.helpers import device_registry as dr
from homeassistant.helpers.entity import DeviceInfo
from .const import MANUFACTURER
if TYPE_CHECKING:
from . import MicroBotDataUpdateCoordinator
from .coordinator import MicroBotDataUpdateCoordinator
class MicroBotEntity(PassiveBluetoothCoordinatorEntity):
class MicroBotEntity(PassiveBluetoothCoordinatorEntity[MicroBotDataUpdateCoordinator]):
"""Generic entity for all MicroBots."""
coordinator: MicroBotDataUpdateCoordinator
def __init__(self, coordinator, config_entry):
"""Initialise the entity."""
super().__init__(coordinator)