Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add features for newer vacuums (eg Roborock S7) #1039

Merged
merged 14 commits into from
May 11, 2021

Conversation

fettlaus
Copy link
Contributor

@fettlaus fettlaus commented May 8, 2021

I added the following features to the vacuums. Support for them may vary depending on the model of the vacuum. All of these at least work for the Roborock S7

  • mopping mode/route can be changed (does multiple passes on deep clean)
  • can detect if the mop is attached (as opposed to detection of attached water box)
  • fanspeeds for Roborock S7 added
  • child lock can be switched on and off
  • water shortage on the water box can be queried if the vacuum has a sensor for this
  • carpet cleaning mode/avoidance can be changed (see Add setting for carpet avoidance to vacuums #1040)

Closes #1040

miio/vacuum.py Outdated Show resolved Hide resolved
miio/vacuum.py Show resolved Hide resolved
miio/vacuumcontainers.py Outdated Show resolved Hide resolved
miio/vacuumcontainers.py Outdated Show resolved Hide resolved
Copy link
Owner

@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.

A couple of more comments, but otherwise this looks good to go. I'm unsure if the best action for unsupported actions is to raise an exception or simply to log it, but let's go for logging for now to make it simpler for downstreams.

The vacuum class (when the API gets consolidated) should get a supported_features() property at some point to allow introspecting which commands and features are available for the given model. Until then, I think it's better to (non-silently) signal for invalid usage instead of raising an exception.

miio/vacuum.py Show resolved Hide resolved
miio/vacuumcontainers.py Outdated Show resolved Hide resolved
miio/vacuum_cli.py Outdated Show resolved Hide resolved
miio/vacuum_cli.py Outdated Show resolved Hide resolved
miio/vacuum.py Show resolved Hide resolved
miio/vacuum.py Outdated Show resolved Hide resolved
fettlaus and others added 2 commits May 11, 2021 22:33
Co-authored-by: Teemu R. <tpr@iki.fi>
Copy link
Owner

@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.

Let's merge it, thanks again for the PR and your patience! 🥇

@rytilahti rytilahti merged commit e29b933 into rytilahti:master May 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add setting for carpet avoidance to vacuums
2 participants