Improve typing [util.decorator] (#67087)
This commit is contained in:
parent
46c2bd0eb0
commit
ec980a574b
23 changed files with 59 additions and 38 deletions
|
@ -1,6 +1,9 @@
|
|||
"""Handle MySensors messages."""
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Callable, Coroutine
|
||||
from typing import Any
|
||||
|
||||
from mysensors import Message
|
||||
|
||||
from homeassistant.const import Platform
|
||||
|
@ -12,7 +15,9 @@ from .const import CHILD_CALLBACK, NODE_CALLBACK, DevId, GatewayId
|
|||
from .device import get_mysensors_devices
|
||||
from .helpers import discover_mysensors_platform, validate_set_msg
|
||||
|
||||
HANDLERS = decorator.Registry()
|
||||
HANDLERS: decorator.Registry[
|
||||
str, Callable[[HomeAssistant, GatewayId, Message], Coroutine[Any, Any, None]]
|
||||
] = decorator.Registry()
|
||||
|
||||
|
||||
@HANDLERS.register("set")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue