Type hint improvements (#32905)

* Complete helpers.entity_component type hints

* Add discovery info type
This commit is contained in:
Ville Skyttä authored and GitHub committed 2020-03-18 19:27:25 +02:00
1 parent 7c79adad8f
commit 05abf37046
13 files changed
+120 -76

No files matched your search

+4 -2
View File
@@ -5,7 +5,7 @@ There are two different types of discoveries that can be fired/listened for.
- listen_platform/discover_platform is for platforms. These are used by
components to allow discovery of their platforms.
"""
from typing import Callable, Collection, Union
from typing import Any, Callable, Collection, Dict, Optional, Union
from homeassistant import core, setup
from homeassistant.const import ATTR_DISCOVERED, ATTR_SERVICE, EVENT_PLATFORM_DISCOVERED
@@ -90,7 +90,9 @@ def listen_platform(
@bind_hass
def async_listen_platform(
hass: core.HomeAssistant, component: str, callback: Callable
hass: core.HomeAssistant,
component: str,
callback: Callable[[str, Optional[Dict[str, Any]]], Any],
) -> None:
"""Register a platform loader listener.