Update Optional typing (2) [Py310] (#86419)

This commit is contained in:
Marc Mueller
2023-01-23 09:10:05 +01:00
committed by GitHub
parent 40be2324cc
commit da35097803
21 changed files with 26 additions and 92 deletions

View File

@@ -1,7 +1,7 @@
"""Typing Helpers for Home Assistant."""
from collections.abc import Mapping
from enum import Enum
from typing import Any, Optional, Union
from typing import Any
import homeassistant.core
@@ -11,8 +11,8 @@ ContextType = homeassistant.core.Context
DiscoveryInfoType = dict[str, Any]
EventType = homeassistant.core.Event
ServiceDataType = dict[str, Any]
StateType = Union[None, str, int, float]
TemplateVarsType = Optional[Mapping[str, Any]]
StateType = str | int | float | None
TemplateVarsType = Mapping[str, Any] | None
# Custom type for recorder Queries
QueryType = Any