mirror of
https://github.com/home-assistant/core.git
synced 2026-02-21 10:27:52 +00:00
30 lines
756 B
Python
30 lines
756 B
Python
"""Typing Helpers for Home Assistant."""
|
|
|
|
from collections.abc import Mapping
|
|
from enum import Enum
|
|
from typing import Any, Never
|
|
|
|
import voluptuous as vol
|
|
|
|
type GPSType = tuple[float, float]
|
|
type ConfigType = dict[str, Any]
|
|
type DiscoveryInfoType = dict[str, Any]
|
|
type ServiceDataType = dict[str, Any]
|
|
type StateType = str | int | float | None
|
|
type TemplateVarsType = Mapping[str, Any] | None
|
|
type NoEventData = Mapping[str, Never]
|
|
type VolSchemaType = vol.Schema | vol.All | vol.Any
|
|
type VolDictType = dict[str | vol.Marker, Any]
|
|
|
|
# Custom type for recorder Queries
|
|
type QueryType = Any
|
|
|
|
|
|
class UndefinedType(Enum):
|
|
"""Singleton type for use with not set sentinel values."""
|
|
|
|
_singleton = 0
|
|
|
|
|
|
UNDEFINED = UndefinedType._singleton # noqa: SLF001
|