mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-08-08 11:44:02 +00:00
Enable ruff check for ANN (#1139)
This commit is contained in:
@@ -12,7 +12,7 @@ class Fan(SmartModule, FanInterface):
|
||||
|
||||
REQUIRED_COMPONENT = "fan_control"
|
||||
|
||||
def _initialize_features(self):
|
||||
def _initialize_features(self) -> None:
|
||||
"""Initialize features after the initial update."""
|
||||
self._add_feature(
|
||||
Feature(
|
||||
@@ -50,7 +50,7 @@ class Fan(SmartModule, FanInterface):
|
||||
"""Return fan speed level."""
|
||||
return 0 if self.data["device_on"] is False else self.data["fan_speed_level"]
|
||||
|
||||
async def set_fan_speed_level(self, level: int):
|
||||
async def set_fan_speed_level(self, level: int) -> dict:
|
||||
"""Set fan speed level, 0 for off, 1-4 for on."""
|
||||
if level < 0 or level > 4:
|
||||
raise ValueError("Invalid level, should be in range 0-4.")
|
||||
@@ -65,10 +65,10 @@ class Fan(SmartModule, FanInterface):
|
||||
"""Return sleep mode status."""
|
||||
return self.data["fan_sleep_mode_on"]
|
||||
|
||||
async def set_sleep_mode(self, on: bool):
|
||||
async def set_sleep_mode(self, on: bool) -> dict:
|
||||
"""Set sleep mode."""
|
||||
return await self.call("set_device_info", {"fan_sleep_mode_on": on})
|
||||
|
||||
async def _check_supported(self):
|
||||
async def _check_supported(self) -> bool:
|
||||
"""Is the module available on this device."""
|
||||
return "fan_speed_level" in self.data
|
||||
|
Reference in New Issue
Block a user