mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 10:17:09 +00:00
Mark logbook.EventAsRow with @final (#142058)
This commit is contained in:
parent
dfd86d56ec
commit
8200c234dd
@ -4,7 +4,7 @@ from __future__ import annotations
|
|||||||
|
|
||||||
from collections.abc import Callable, Mapping
|
from collections.abc import Callable, Mapping
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from typing import TYPE_CHECKING, Any, Final, NamedTuple, cast
|
from typing import TYPE_CHECKING, Any, Final, NamedTuple, cast, final
|
||||||
|
|
||||||
from propcache.api import cached_property
|
from propcache.api import cached_property
|
||||||
from sqlalchemy.engine.row import Row
|
from sqlalchemy.engine.row import Row
|
||||||
@ -114,6 +114,7 @@ DATA_POS: Final = 11
|
|||||||
CONTEXT_POS: Final = 12
|
CONTEXT_POS: Final = 12
|
||||||
|
|
||||||
|
|
||||||
|
@final # Final to allow direct checking of the type instead of using isinstance
|
||||||
class EventAsRow(NamedTuple):
|
class EventAsRow(NamedTuple):
|
||||||
"""Convert an event to a row.
|
"""Convert an event to a row.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user