mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +00:00
Change DeviceAutomationDetails to use a dataclass for py3.11 (#88087)
A NamedTuple can no longer be an enum value in py3.11
This commit is contained in:
parent
e96210fced
commit
d8ee60ee44
@ -3,11 +3,12 @@ from __future__ import annotations
|
|||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
from collections.abc import Awaitable, Callable, Coroutine, Iterable, Mapping
|
from collections.abc import Awaitable, Callable, Coroutine, Iterable, Mapping
|
||||||
|
from dataclasses import dataclass
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
from functools import wraps
|
from functools import wraps
|
||||||
import logging
|
import logging
|
||||||
from types import ModuleType
|
from types import ModuleType
|
||||||
from typing import TYPE_CHECKING, Any, Literal, NamedTuple, TypeAlias, overload
|
from typing import TYPE_CHECKING, Any, Literal, TypeAlias, overload
|
||||||
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
import voluptuous_serialize
|
import voluptuous_serialize
|
||||||
@ -63,7 +64,8 @@ DEVICE_TRIGGER_BASE_SCHEMA: vol.Schema = cv.TRIGGER_BASE_SCHEMA.extend(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class DeviceAutomationDetails(NamedTuple):
|
@dataclass
|
||||||
|
class DeviceAutomationDetails:
|
||||||
"""Details for device automation."""
|
"""Details for device automation."""
|
||||||
|
|
||||||
section: str
|
section: str
|
||||||
|
Loading…
x
Reference in New Issue
Block a user