diff --git a/homeassistant/util/decorator.py b/homeassistant/util/decorator.py index 83c63711c7d..d2943d39979 100644 --- a/homeassistant/util/decorator.py +++ b/homeassistant/util/decorator.py @@ -1,4 +1,5 @@ """Decorator utility functions.""" +from collections.abc import Hashable from typing import Callable, TypeVar CALLABLE_T = TypeVar("CALLABLE_T", bound=Callable) # pylint: disable=invalid-name @@ -7,7 +8,7 @@ CALLABLE_T = TypeVar("CALLABLE_T", bound=Callable) # pylint: disable=invalid-na class Registry(dict): """Registry of items.""" - def register(self, name: str) -> Callable[[CALLABLE_T], CALLABLE_T]: + def register(self, name: Hashable) -> Callable[[CALLABLE_T], CALLABLE_T]: """Return decorator to register item with a specific name.""" def decorator(func: CALLABLE_T) -> CALLABLE_T: