Update Union typing (6) [Py310] (#86454)
This commit is contained in:
parent
68dd2802a1
commit
6f94e47270
4 changed files with 7 additions and 7 deletions
|
@ -3,7 +3,7 @@ from __future__ import annotations
|
|||
|
||||
from collections.abc import Mapping
|
||||
from datetime import timedelta
|
||||
from typing import Any, Union
|
||||
from typing import Any
|
||||
|
||||
from homeassistant.components.sensor import (
|
||||
RestoreSensor,
|
||||
|
@ -104,7 +104,7 @@ async def async_setup_entry(
|
|||
|
||||
class HERETravelTimeSensor(
|
||||
CoordinatorEntity[
|
||||
Union[HERERoutingDataUpdateCoordinator, HERETransitDataUpdateCoordinator]
|
||||
HERERoutingDataUpdateCoordinator | HERETransitDataUpdateCoordinator
|
||||
],
|
||||
RestoreSensor,
|
||||
):
|
||||
|
|
|
@ -85,7 +85,7 @@ _LOGGER = logging.getLogger(__name__)
|
|||
DISCOVERY_COOLDOWN = 2
|
||||
TIMEOUT_ACK = 10
|
||||
|
||||
SubscribePayloadType = Union[str, bytes] # Only bytes if encoding is None
|
||||
SubscribePayloadType = str | bytes # Only bytes if encoding is None
|
||||
|
||||
|
||||
def publish(
|
||||
|
|
|
@ -3,7 +3,7 @@ from __future__ import annotations
|
|||
|
||||
from collections.abc import Mapping
|
||||
from dataclasses import dataclass
|
||||
from typing import Union
|
||||
from typing import TypeAlias
|
||||
|
||||
from homeassistant.components.sensor import (
|
||||
SensorDeviceClass,
|
||||
|
@ -38,7 +38,7 @@ from .const import (
|
|||
)
|
||||
from .coordinator import ZamgDataUpdateCoordinator
|
||||
|
||||
_DType = Union[type[int], type[float], type[str]]
|
||||
_DType: TypeAlias = "type[int] | type[float] | type[str]"
|
||||
|
||||
|
||||
@dataclass
|
||||
|
|
|
@ -10,7 +10,7 @@ import functools as ft
|
|||
import logging
|
||||
from random import randint
|
||||
import time
|
||||
from typing import Any, Concatenate, ParamSpec, Union, cast
|
||||
from typing import Any, Concatenate, ParamSpec, cast
|
||||
|
||||
import attr
|
||||
|
||||
|
@ -1128,7 +1128,7 @@ class TrackTemplateResultInfo:
|
|||
|
||||
TrackTemplateResultListener = Callable[
|
||||
[
|
||||
Union[Event, None],
|
||||
Event | None,
|
||||
list[TrackTemplateResult],
|
||||
],
|
||||
None,
|
||||
|
|
Loading…
Add table
Reference in a new issue