diff --git a/homeassistant/components/unifiprotect/models.py b/homeassistant/components/unifiprotect/models.py index ecc3e4210ff..c28e1757722 100644 --- a/homeassistant/components/unifiprotect/models.py +++ b/homeassistant/components/unifiprotect/models.py @@ -46,7 +46,7 @@ class ProtectRequiredKeysMixin(EntityDescription, Generic[T]): @dataclass -class ProtectSetableKeysMixin(ProtectRequiredKeysMixin, Generic[T]): +class ProtectSetableKeysMixin(ProtectRequiredKeysMixin[T]): """Mixin for settable values.""" ufp_set_method: str | None = None diff --git a/homeassistant/components/unifiprotect/number.py b/homeassistant/components/unifiprotect/number.py index 9d0a2bd69bd..d6dfba0c38f 100644 --- a/homeassistant/components/unifiprotect/number.py +++ b/homeassistant/components/unifiprotect/number.py @@ -3,7 +3,6 @@ from __future__ import annotations from dataclasses import dataclass from datetime import timedelta -from typing import Generic from pyunifiprotect.data.devices import Camera, Doorlock, Light @@ -31,7 +30,7 @@ class NumberKeysMixin: @dataclass class ProtectNumberEntityDescription( - ProtectSetableKeysMixin, NumberEntityDescription, NumberKeysMixin, Generic[T] + ProtectSetableKeysMixin[T], NumberEntityDescription, NumberKeysMixin ): """Describes UniFi Protect Number entity.""" diff --git a/homeassistant/components/unifiprotect/select.py b/homeassistant/components/unifiprotect/select.py index dd2e6051c2b..b7b53ff81c8 100644 --- a/homeassistant/components/unifiprotect/select.py +++ b/homeassistant/components/unifiprotect/select.py @@ -6,7 +6,7 @@ from dataclasses import dataclass from datetime import timedelta from enum import Enum import logging -from typing import Any, Final, Generic +from typing import Any, Final from pyunifiprotect.api import ProtectApiClient from pyunifiprotect.data import ( @@ -104,7 +104,7 @@ SET_DOORBELL_LCD_MESSAGE_SCHEMA = vol.Schema( @dataclass class ProtectSelectEntityDescription( - ProtectSetableKeysMixin, SelectEntityDescription, Generic[T] + ProtectSetableKeysMixin[T], SelectEntityDescription ): """Describes UniFi Protect Select entity.""" diff --git a/homeassistant/components/unifiprotect/sensor.py b/homeassistant/components/unifiprotect/sensor.py index 00ac1304d88..c3b49fbdf9d 100644 --- a/homeassistant/components/unifiprotect/sensor.py +++ b/homeassistant/components/unifiprotect/sensor.py @@ -4,7 +4,7 @@ from __future__ import annotations from dataclasses import dataclass from datetime import datetime import logging -from typing import Any, Generic +from typing import Any from pyunifiprotect.data import ( NVR, @@ -54,13 +54,13 @@ DEVICE_CLASS_DETECTION = "unifiprotect__detection" @dataclass class ProtectSensorEntityDescription( - ProtectRequiredKeysMixin, SensorEntityDescription, Generic[T] + ProtectRequiredKeysMixin[T], SensorEntityDescription ): """Describes UniFi Protect Sensor entity.""" precision: int | None = None - def get_ufp_value(self, obj: ProtectDeviceModel) -> Any: + def get_ufp_value(self, obj: T) -> Any: """Return value from UniFi Protect device.""" value = super().get_ufp_value(obj) diff --git a/homeassistant/components/unifiprotect/switch.py b/homeassistant/components/unifiprotect/switch.py index a3626c3082e..2257f399f75 100644 --- a/homeassistant/components/unifiprotect/switch.py +++ b/homeassistant/components/unifiprotect/switch.py @@ -3,7 +3,7 @@ from __future__ import annotations from dataclasses import dataclass import logging -from typing import Any, Generic +from typing import Any from pyunifiprotect.data import Camera, RecordingMode, VideoMode from pyunifiprotect.data.base import ProtectAdoptableDeviceModel @@ -24,7 +24,7 @@ _LOGGER = logging.getLogger(__name__) @dataclass class ProtectSwitchEntityDescription( - ProtectSetableKeysMixin, SwitchEntityDescription, Generic[T] + ProtectSetableKeysMixin[T], SwitchEntityDescription ): """Describes UniFi Protect Switch entity."""