mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-08-09 20:24:02 +00:00
Initial support for vacuums (clean module) (#944)
Adds support for clean module: - Show current vacuum state - Start cleaning (all rooms) - Return to dock - Pausing & unpausing - Controlling the fan speed --------- Co-authored-by: Steven B <51370195+sdb9696@users.noreply.github.com>
This commit is contained in:
@@ -39,6 +39,7 @@ DEVICE_TYPE_TO_PRODUCT_GROUP = {
|
||||
DeviceType.Hub: "Hubs",
|
||||
DeviceType.Sensor: "Hub-Connected Devices",
|
||||
DeviceType.Thermostat: "Hub-Connected Devices",
|
||||
DeviceType.Vacuum: "Vacuums",
|
||||
}
|
||||
|
||||
|
||||
|
@@ -118,6 +118,16 @@ class SmartRequest:
|
||||
enable: bool
|
||||
id: str | None = None
|
||||
|
||||
@dataclass
|
||||
class GetCleanAttrParams(SmartRequestParams):
|
||||
"""CleanAttr params.
|
||||
|
||||
Decides which cleaning settings are requested
|
||||
"""
|
||||
|
||||
#: type can be global or pose
|
||||
type: str = "global"
|
||||
|
||||
@staticmethod
|
||||
def get_raw_request(
|
||||
method: str, params: SmartRequestParams | None = None
|
||||
@@ -429,6 +439,8 @@ COMPONENT_REQUESTS = {
|
||||
"clean": [
|
||||
SmartRequest.get_raw_request("getCleanRecords"),
|
||||
SmartRequest.get_raw_request("getVacStatus"),
|
||||
SmartRequest.get_raw_request("getCleanStatus"),
|
||||
SmartRequest("getCleanAttr", SmartRequest.GetCleanAttrParams()),
|
||||
],
|
||||
"battery": [SmartRequest.get_raw_request("getBatteryInfo")],
|
||||
"consumables": [SmartRequest.get_raw_request("getConsumablesInfo")],
|
||||
|
Reference in New Issue
Block a user