python-kasa/kasa/fan.py
Steven B 16f17a7729
Add Fan interface for SMART devices (#873)
Enables the Fan interface for devices supporting that component.
Currently the only device with a fan is the ks240 which implements it as
a child device. This PR adds a method `get_module` to search the child
device for modules if it is a WallSwitch device type.
2024-04-30 17:42:53 +01:00

24 lines
489 B
Python

"""Module for Fan Interface."""
from __future__ import annotations
from abc import ABC, abstractmethod
class Fan(ABC):
"""Interface for a Fan."""
@property
@abstractmethod
def is_fan(self) -> bool:
"""Return True if the device is a fan."""
@property
@abstractmethod
def fan_speed_level(self) -> int:
"""Return fan speed level."""
@abstractmethod
async def set_fan_speed_level(self, level: int):
"""Set fan speed level."""