FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix mop set_waterlevel sending setCleanAttr without type field by davidefiocco · Pull Request #1667 · python-kasa/python-kasa · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (2) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
7 changes: 4 additions & 3 deletions kasa/smart/modules/mop.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ async def set_waterlevel(self, mode: str) -> Annotated[dict, FeatureAttribute()]
if mode not in name_to_value:
raise ValueError("Invalid waterlevel %s, available %s", mode, name_to_value)

settings = self._settings.copy()

davidefiocco Mar 1, 2026 •
edited
Loading

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I verified on a real RV30 that setCleanAttr treats the payload as a partial update. Sending only {"cistern": 3, "type": "global"} changes the water level without affecting suction or clean_number, so there's no need to include all params.

settings["cistern"] = name_to_value[mode]
return await self.call("setCleanAttr", settings)
return await self.call(
"setCleanAttr",
{"cistern": name_to_value[mode], "type": "global"},
)
7 changes: 3 additions & 4 deletions tests/smart/modules/test_mop.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,9 @@ async def test_mop_waterlevel(dev: SmartDevice, mocker: MockerFixture):
new_level = Waterlevel.High
await mop_module.set_waterlevel(new_level.name)

params = mop_module._settings.copy()
params["cistern"] = new_level.value

call.assert_called_with("setCleanAttr", params)
call.assert_called_with(
"setCleanAttr", {"cistern": new_level.value, "type": "global"}
)

await dev.update()

Expand Down

Back | FazBrowse Home | New Git URL