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:
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

View File

@ -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