Use PEP 695 for decorator typing (3) (#117640)

This commit is contained in:
Marc Mueller 2024-05-17 16:27:32 +02:00 committed by GitHub
parent 34bd291615
commit 25d1ca747b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 31 additions and 76 deletions

View file

@ -4,7 +4,7 @@ from __future__ import annotations
from collections.abc import Awaitable, Callable, Coroutine
from functools import wraps
from typing import Any, Concatenate, ParamSpec, TypeVar
from typing import Any, Concatenate
from aiovlc.client import Client
from aiovlc.exceptions import AuthError, CommandError, ConnectError
@ -30,9 +30,6 @@ from .const import DEFAULT_NAME, DOMAIN, LOGGER
MAX_VOLUME = 500
_VlcDeviceT = TypeVar("_VlcDeviceT", bound="VlcDevice")
_P = ParamSpec("_P")
async def async_setup_entry(
hass: HomeAssistant, entry: VlcConfigEntry, async_add_entities: AddEntitiesCallback
@ -46,7 +43,7 @@ async def async_setup_entry(
async_add_entities([VlcDevice(entry, vlc, name, available)], True)
def catch_vlc_errors(
def catch_vlc_errors[_VlcDeviceT: VlcDevice, **_P](
func: Callable[Concatenate[_VlcDeviceT, _P], Awaitable[None]],
) -> Callable[Concatenate[_VlcDeviceT, _P], Coroutine[Any, Any, None]]:
"""Catch VLC errors."""