mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-10-13 10:58:02 +00:00
Enable ruff check for ANN (#1139)
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
"""Base class for IOT module implementations."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import logging
|
||||
from typing import Any
|
||||
|
||||
from ..exceptions import KasaException
|
||||
from ..module import Module
|
||||
@@ -24,16 +27,16 @@ merge = _merge_dict
|
||||
class IotModule(Module):
|
||||
"""Base class implemention for all IOT modules."""
|
||||
|
||||
def call(self, method, params=None):
|
||||
async def call(self, method: str, params: dict | None = None) -> dict:
|
||||
"""Call the given method with the given parameters."""
|
||||
return self._device._query_helper(self._module, method, params)
|
||||
return await self._device._query_helper(self._module, method, params)
|
||||
|
||||
def query_for_command(self, query, params=None):
|
||||
def query_for_command(self, query: str, params: dict | None = None) -> dict:
|
||||
"""Create a request object for the given parameters."""
|
||||
return self._device._create_request(self._module, query, params)
|
||||
|
||||
@property
|
||||
def estimated_query_response_size(self):
|
||||
def estimated_query_response_size(self) -> int:
|
||||
"""Estimated maximum size of query response.
|
||||
|
||||
The inheriting modules implement this to estimate how large a query response
|
||||
@@ -42,7 +45,7 @@ class IotModule(Module):
|
||||
return 256 # Estimate for modules that don't specify
|
||||
|
||||
@property
|
||||
def data(self):
|
||||
def data(self) -> dict[str, Any]:
|
||||
"""Return the module specific raw data from the last update."""
|
||||
dev = self._device
|
||||
q = self.query()
|
||||
|
Reference in New Issue
Block a user