diff --git a/homeassistant/components/rfxtrx/__init__.py b/homeassistant/components/rfxtrx/__init__.py index 9c5ffa586cd..3ce45e5610e 100644 --- a/homeassistant/components/rfxtrx/__init__.py +++ b/homeassistant/components/rfxtrx/__init__.py @@ -6,7 +6,7 @@ import binascii from collections.abc import Callable, Mapping import copy import logging -from typing import Any, NamedTuple, cast +from typing import Any, NamedTuple, TypeVarTuple, cast import RFXtrx as rfxtrxmod import voluptuous as vol @@ -50,6 +50,8 @@ DEFAULT_OFF_DELAY = 2.0 SIGNAL_EVENT = f"{DOMAIN}_event" +_Ts = TypeVarTuple("_Ts") + _LOGGER = logging.getLogger(__name__) @@ -559,6 +561,8 @@ class RfxtrxCommandEntity(RfxtrxEntity): """Initialzie a switch or light device.""" super().__init__(device, device_id, event=event) - async def _async_send(self, fun: Callable[..., None], *args: Any) -> None: - rfx_object = self.hass.data[DOMAIN][DATA_RFXOBJECT] + async def _async_send( + self, fun: Callable[[rfxtrxmod.PySerialTransport, *_Ts], None], *args: *_Ts + ) -> None: + rfx_object: rfxtrxmod.Connect = self.hass.data[DOMAIN][DATA_RFXOBJECT] await self.hass.async_add_executor_job(fun, rfx_object.transport, *args)