mirror of
https://github.com/python-kasa/python-kasa.git
synced 2024-12-22 19:23:34 +00:00
Update DiscoveryResult to use mashu Annotated Alias (#1279)
This commit is contained in:
parent
e1e6d72222
commit
2683623997
@ -92,18 +92,19 @@ import struct
|
|||||||
from asyncio import timeout as asyncio_timeout
|
from asyncio import timeout as asyncio_timeout
|
||||||
from asyncio.transports import DatagramTransport
|
from asyncio.transports import DatagramTransport
|
||||||
from collections.abc import Callable, Coroutine
|
from collections.abc import Callable, Coroutine
|
||||||
from dataclasses import dataclass, field
|
from dataclasses import dataclass
|
||||||
from pprint import pformat as pf
|
from pprint import pformat as pf
|
||||||
from typing import (
|
from typing import (
|
||||||
TYPE_CHECKING,
|
TYPE_CHECKING,
|
||||||
|
Annotated,
|
||||||
Any,
|
Any,
|
||||||
NamedTuple,
|
NamedTuple,
|
||||||
cast,
|
cast,
|
||||||
)
|
)
|
||||||
|
|
||||||
from aiohttp import ClientSession
|
from aiohttp import ClientSession
|
||||||
from mashumaro import field_options
|
|
||||||
from mashumaro.config import BaseConfig
|
from mashumaro.config import BaseConfig
|
||||||
|
from mashumaro.types import Alias
|
||||||
|
|
||||||
from kasa import Device
|
from kasa import Device
|
||||||
from kasa.credentials import Credentials
|
from kasa.credentials import Credentials
|
||||||
@ -851,9 +852,7 @@ class DiscoveryResult(_DiscoveryBaseMixin):
|
|||||||
encrypt_info: EncryptionInfo | None = None
|
encrypt_info: EncryptionInfo | None = None
|
||||||
encrypt_type: list[str] | None = None
|
encrypt_type: list[str] | None = None
|
||||||
decrypted_data: dict | None = None
|
decrypted_data: dict | None = None
|
||||||
is_reset_wifi: bool | None = field(
|
is_reset_wifi: Annotated[bool | None, Alias("isResetWiFi")] = None
|
||||||
metadata=field_options(alias="isResetWiFi"), default=None
|
|
||||||
)
|
|
||||||
|
|
||||||
firmware_version: str | None = None
|
firmware_version: str | None = None
|
||||||
hardware_version: str | None = None
|
hardware_version: str | None = None
|
||||||
|
Loading…
Reference in New Issue
Block a user