mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-08-09 20:24:02 +00:00
Enable ruff check for ANN (#1139)
This commit is contained in:
@@ -11,7 +11,7 @@ _LOGGER = logging.getLogger(__name__)
|
||||
class AmbientLight(IotModule):
|
||||
"""Implements ambient light controls for the motion sensor."""
|
||||
|
||||
def _initialize_features(self):
|
||||
def _initialize_features(self) -> None:
|
||||
"""Initialize features after the initial update."""
|
||||
self._add_feature(
|
||||
Feature(
|
||||
@@ -40,7 +40,7 @@ class AmbientLight(IotModule):
|
||||
)
|
||||
)
|
||||
|
||||
def query(self):
|
||||
def query(self) -> dict:
|
||||
"""Request configuration."""
|
||||
req = merge(
|
||||
self.query_for_command("get_config"),
|
||||
@@ -74,18 +74,18 @@ class AmbientLight(IotModule):
|
||||
"""Return True if the module is enabled."""
|
||||
return int(self.data["get_current_brt"]["value"])
|
||||
|
||||
async def set_enabled(self, state: bool):
|
||||
async def set_enabled(self, state: bool) -> dict:
|
||||
"""Enable/disable LAS."""
|
||||
return await self.call("set_enable", {"enable": int(state)})
|
||||
|
||||
async def current_brightness(self) -> int:
|
||||
async def current_brightness(self) -> dict:
|
||||
"""Return current brightness.
|
||||
|
||||
Return value units.
|
||||
"""
|
||||
return await self.call("get_current_brt")
|
||||
|
||||
async def set_brightness_limit(self, value: int):
|
||||
async def set_brightness_limit(self, value: int) -> dict:
|
||||
"""Set the limit when the motion sensor is inactive.
|
||||
|
||||
See `presets` for preset values. Custom values are also likely allowed.
|
||||
|
Reference in New Issue
Block a user