Change DeviceAutomationDetails to use a dataclass for py3.11 (#88087)

A NamedTuple can no longer be an enum value in py3.11
pull/88107/head
J. Nick Koston 2023-02-14 09:22:57 -06:00 committed by GitHub
parent e96210fced
commit d8ee60ee44
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -3,11 +3,12 @@ from __future__ import annotations
import asyncio
from collections.abc import Awaitable, Callable, Coroutine, Iterable, Mapping
from dataclasses import dataclass
from enum import Enum
from functools import wraps
import logging
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_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."""
section: str