mirror of
https://github.com/home-assistant/core.git
synced 2025-08-01 03:35:09 +02:00
State and service related type hint improvements (#38956)
* Improve type hint of service_func to register * Add named type for state values * Narrow some unnecessarily broad state type hints
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
"""Typing Helpers for Home Assistant."""
|
||||
from typing import Any, Dict, Optional, Tuple
|
||||
from typing import Any, Dict, Optional, Tuple, Union
|
||||
|
||||
import homeassistant.core
|
||||
|
||||
@@ -13,6 +13,7 @@ EventType = homeassistant.core.Event
|
||||
HomeAssistantType = homeassistant.core.HomeAssistant
|
||||
ServiceCallType = homeassistant.core.ServiceCall
|
||||
ServiceDataType = Dict[str, Any]
|
||||
StateType = Union[None, str, int, float]
|
||||
TemplateVarsType = Optional[Dict[str, Any]]
|
||||
|
||||
# Custom type for recorder Queries
|
||||
|
Reference in New Issue
Block a user