Fix unifiprotect TypeVar inheritance (#70782)

This commit is contained in:
Marc Mueller 2022-04-26 19:15:47 +02:00 committed by GitHub
parent abdf5bb86a
commit a5fa40180c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 9 additions and 10 deletions

View file

@ -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)