From 2683623997c9c5948253f267a5fc8c76dbea97e6 Mon Sep 17 00:00:00 2001 From: "Steven B." <51370195+sdb9696@users.noreply.github.com> Date: Tue, 19 Nov 2024 19:09:50 +0000 Subject: [PATCH] Update DiscoveryResult to use mashu Annotated Alias (#1279) --- kasa/discover.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/kasa/discover.py b/kasa/discover.py index b20b9ec3..74b663e8 100755 --- a/kasa/discover.py +++ b/kasa/discover.py @@ -92,18 +92,19 @@ import struct from asyncio import timeout as asyncio_timeout from asyncio.transports import DatagramTransport from collections.abc import Callable, Coroutine -from dataclasses import dataclass, field +from dataclasses import dataclass from pprint import pformat as pf from typing import ( TYPE_CHECKING, + Annotated, Any, NamedTuple, cast, ) from aiohttp import ClientSession -from mashumaro import field_options from mashumaro.config import BaseConfig +from mashumaro.types import Alias from kasa import Device from kasa.credentials import Credentials @@ -851,9 +852,7 @@ class DiscoveryResult(_DiscoveryBaseMixin): encrypt_info: EncryptionInfo | None = None encrypt_type: list[str] | None = None decrypted_data: dict | None = None - is_reset_wifi: bool | None = field( - metadata=field_options(alias="isResetWiFi"), default=None - ) + is_reset_wifi: Annotated[bool | None, Alias("isResetWiFi")] = None firmware_version: str | None = None hardware_version: str | None = None