Improve bluetooth
generic typing (#84891)
Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
parent
6b95fa5942
commit
972eb34ed9
10 changed files with 71 additions and 42 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue