from collections.abc import Iterable
from dataclasses import dataclass
from types import NoneType
-from typing import Any, Self
+from typing import Any
from mashumaro import DataClassDictMixin
@classmethod
def parse(
- cls: Self,
+ cls,
config_entries: Iterable[ConfigEntry],
raw: dict[str, Any],
- ) -> Self:
+ ) -> Config:
"""Parse Config from the raw values (as stored in persistent storage)."""
conf = cls.from_dict({**raw, "values": {}})
for entry in config_entries:
from __future__ import annotations
from enum import Enum
-from typing import Any, Self, TypeVar
+from typing import Any, TypeVar
# pylint:disable=ungrouped-imports
try:
@classmethod
@property
- def ALL(cls: Self) -> tuple[MediaType, ...]: # noqa: N802
+ def ALL(cls) -> tuple[MediaType, ...]: # noqa: N802
"""Return all (default) MediaTypes as tuple."""
return (
MediaType.ARTIST,
from collections.abc import Mapping
from dataclasses import dataclass, field, fields
from time import time
-from typing import Any, Self
+from typing import Any
from mashumaro import DataClassDictMixin
total: int | None = None
@classmethod
- def parse(cls: Self, raw: dict[str, Any], item_type: type) -> PagedItems:
+ def parse(cls, raw: dict[str, Any], item_type: type) -> PagedItems:
"""Parse PagedItems object including correct item type."""
return PagedItems(
items=[item_type.from_dict(x) for x in raw["items"]],