mirror of
https://github.com/python-kasa/python-kasa.git
synced 2024-12-23 03:33:35 +00:00
Merge branch 'master' into feat/light_module_feats
This commit is contained in:
commit
157eb24a2e
@ -56,7 +56,7 @@ FixtureResult = namedtuple("FixtureResult", "filename, folder, data")
|
|||||||
SMART_FOLDER = "tests/fixtures/smart/"
|
SMART_FOLDER = "tests/fixtures/smart/"
|
||||||
SMARTCAMERA_FOLDER = "tests/fixtures/smartcamera/"
|
SMARTCAMERA_FOLDER = "tests/fixtures/smartcamera/"
|
||||||
SMART_CHILD_FOLDER = "tests/fixtures/smart/child/"
|
SMART_CHILD_FOLDER = "tests/fixtures/smart/child/"
|
||||||
IOT_FOLDER = "tests/fixtures/"
|
IOT_FOLDER = "tests/fixtures/iot/"
|
||||||
|
|
||||||
ENCRYPT_TYPES = [encrypt_type.value for encrypt_type in DeviceEncryptionType]
|
ENCRYPT_TYPES = [encrypt_type.value for encrypt_type in DeviceEncryptionType]
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ DEVICE_TYPE_TO_PRODUCT_GROUP = {
|
|||||||
SUPPORTED_FILENAME = "SUPPORTED.md"
|
SUPPORTED_FILENAME = "SUPPORTED.md"
|
||||||
README_FILENAME = "README.md"
|
README_FILENAME = "README.md"
|
||||||
|
|
||||||
IOT_FOLDER = "tests/fixtures/"
|
IOT_FOLDER = "tests/fixtures/iot/"
|
||||||
SMART_FOLDER = "tests/fixtures/smart/"
|
SMART_FOLDER = "tests/fixtures/smart/"
|
||||||
SMART_CHILD_FOLDER = "tests/fixtures/smart/child"
|
SMART_CHILD_FOLDER = "tests/fixtures/smart/child"
|
||||||
SMARTCAMERA_FOLDER = "tests/fixtures/smartcamera/"
|
SMARTCAMERA_FOLDER = "tests/fixtures/smartcamera/"
|
||||||
|
@ -3,8 +3,9 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from abc import ABC, abstractmethod
|
from abc import ABC, abstractmethod
|
||||||
|
from typing import Annotated
|
||||||
|
|
||||||
from ..module import Module
|
from ..module import FeatureAttribute, Module
|
||||||
|
|
||||||
|
|
||||||
class Fan(Module, ABC):
|
class Fan(Module, ABC):
|
||||||
@ -12,9 +13,11 @@ class Fan(Module, ABC):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def fan_speed_level(self) -> int:
|
def fan_speed_level(self) -> Annotated[int, FeatureAttribute()]:
|
||||||
"""Return fan speed level."""
|
"""Return fan speed level."""
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
async def set_fan_speed_level(self, level: int) -> dict:
|
async def set_fan_speed_level(
|
||||||
|
self, level: int
|
||||||
|
) -> Annotated[dict, FeatureAttribute()]:
|
||||||
"""Set fan speed level."""
|
"""Set fan speed level."""
|
||||||
|
@ -35,7 +35,7 @@ FixtureInfo.__eq__ = lambda x, y: hash(x) == hash(y) # type: ignore[method-assi
|
|||||||
SUPPORTED_IOT_DEVICES = [
|
SUPPORTED_IOT_DEVICES = [
|
||||||
(device, "IOT")
|
(device, "IOT")
|
||||||
for device in glob.glob(
|
for device in glob.glob(
|
||||||
os.path.dirname(os.path.abspath(__file__)) + "/fixtures/*.json"
|
os.path.dirname(os.path.abspath(__file__)) + "/fixtures/iot/*.json"
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user