python-kasa/kasa/smart/modules/devicemodule.py
Teemu R cbf82c9498
Support for on_off_gradually v2+ (#793)
Previously, only v1 of on_off_gradually is supported, and the newer versions are not backwards compatible.
This PR adds support for the newer versions of the component, and implements `number` type for `Feature` to expose the transition time selection.
This also adds a new `supported_version` property to the main module API.
2024-02-24 02:16:43 +01:00

22 lines
540 B
Python

"""Implementation of device module."""
from typing import Dict
from ..smartmodule import SmartModule
class DeviceModule(SmartModule):
"""Implementation of device module."""
REQUIRED_COMPONENT = "device"
def query(self) -> Dict:
"""Query to execute during the update cycle."""
query = {
"get_device_info": None,
}
# Device usage is not available on older firmware versions
if self.supported_version >= 2:
query["get_device_usage"] = None
return query