Improve typing [util.decorator] (#67087)

This commit is contained in:
Marc Mueller 2022-02-23 20:58:42 +01:00 committed by GitHub
parent 46c2bd0eb0
commit ec980a574b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 59 additions and 38 deletions

View file

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