Fix unifiprotect TypeVar inheritance (#70782)
This commit is contained in:
parent
abdf5bb86a
commit
a5fa40180c
5 changed files with 9 additions and 10 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue