mirror of
https://github.com/Electric-Special/ha-core.git
synced 2026-03-21 07:05:48 +01:00
Typevar T for vesync strict typing (#161595)
Co-authored-by: Joostlek <joostlek@outlook.com>
This commit is contained in:
@@ -9,14 +9,12 @@ from .const import DOMAIN
|
||||
from .coordinator import VeSyncDataCoordinator
|
||||
|
||||
|
||||
class VeSyncBaseEntity(CoordinatorEntity[VeSyncDataCoordinator]):
|
||||
class VeSyncBaseEntity[T: VeSyncBaseDevice](CoordinatorEntity[VeSyncDataCoordinator]):
|
||||
"""Base class for VeSync Entity Representations."""
|
||||
|
||||
_attr_has_entity_name = True
|
||||
|
||||
def __init__(
|
||||
self, device: VeSyncBaseDevice, coordinator: VeSyncDataCoordinator
|
||||
) -> None:
|
||||
def __init__(self, device: T, coordinator: VeSyncDataCoordinator) -> None:
|
||||
"""Initialize the VeSync device."""
|
||||
super().__init__(coordinator)
|
||||
self.device = device
|
||||
|
||||
Reference in New Issue
Block a user