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