Skip to content

Fix mop set_waterlevel sending setCleanAttr without type field#1667

Merged
rytilahti merged 1 commit intopython-kasa:masterfrom
davidefiocco:fix/mop-set-waterlevel
Mar 1, 2026
Merged

Fix mop set_waterlevel sending setCleanAttr without type field#1667
rytilahti merged 1 commit intopython-kasa:masterfrom
davidefiocco:fix/mop-set-waterlevel

Conversation

@davidefiocco
Copy link
Copy Markdown
Contributor

@davidefiocco davidefiocco commented Mar 1, 2026

Fixes #1666 by having set_waterlevel support an amended payload, and updating the test.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.22%. Comparing base (c9c8061) to head (8e1b95d).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1667      +/-   ##
==========================================
- Coverage   93.22%   93.22%   -0.01%     
==========================================
  Files         157      157              
  Lines        9817     9815       -2     
  Branches     1003     1003              
==========================================
- Hits         9152     9150       -2     
  Misses        472      472              
  Partials      193      193              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@davidefiocco
Copy link
Copy Markdown
Contributor Author

Read the docs failed but may succeed on retriggering? Not sure what happened

if mode not in name_to_value:
raise ValueError("Invalid waterlevel %s, available %s", mode, name_to_value)

settings = self._settings.copy()
Copy link
Copy Markdown
Contributor Author

@davidefiocco davidefiocco Mar 1, 2026

Choose a reason for hiding this comment

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

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.

@rytilahti rytilahti added the bug Something isn't working label Mar 1, 2026
Copy link
Copy Markdown
Member

@rytilahti rytilahti left a comment

Choose a reason for hiding this comment

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

IIRC, I tested that this works as it is right now, but the behavior may have changed in the newer firmwares. I cannot test this myself right now, but accepting partial updates agrees with my mental model of how these devices commony work, so let's merge it.

Thanks @davidefiocco, if you do not mind contributing a fixture file for your device & firmware combination, please consider checking out https://python-kasa.readthedocs.io/en/stable/contribute.html#contributing-fixture-files for another PR!

@davidefiocco
Copy link
Copy Markdown
Contributor Author

Thanks @davidefiocco, if you do not mind contributing a fixture file for your device & firmware combination, please consider checking out https://python-kasa.readthedocs.io/en/stable/contribute.html#contributing-fixture-files for another PR!

Hey @rytilahti thanks! Hopefully I addressed it OK in #1665 !

@rytilahti
Copy link
Copy Markdown
Member

Great, thanks! The doc update is irrelevant for this change (it's about the codecov badge), so I will just merge this.

@rytilahti rytilahti merged commit be5ce08 into python-kasa:master Mar 1, 2026
17 of 18 checks passed
@davidefiocco davidefiocco deleted the fix/mop-set-waterlevel branch March 1, 2026 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mop.set_waterlevel() fails with UNSPECIFIC_ERROR on RV30 robot vacuum

2 participants