From 29fa9278a2c023d64cf34484254e3f25e4515bdf Mon Sep 17 00:00:00 2001 From: cdnninja Date: Mon, 26 Jan 2026 04:58:45 -0700 Subject: [PATCH] Typevar T for vesync strict typing (#161595) Co-authored-by: Joostlek --- homeassistant/components/vesync/entity.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/vesync/entity.py b/homeassistant/components/vesync/entity.py index 10868836ee3..136856c7590 100644 --- a/homeassistant/components/vesync/entity.py +++ b/homeassistant/components/vesync/entity.py @@ -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