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

Roborock: various improvements to exposed sensors #1914

Merged
merged 7 commits into from
Mar 20, 2024

Conversation

SLaks
Copy link
Contributor

@SLaks SLaks commented Mar 17, 2024

  • Add clean_percent
  • Expose options, device_class, suggested_display_precision on specific sensors for better homeassistant integration
  • Also, add q revo to the list of devices that have a mop

Copy link

codecov bot commented Mar 17, 2024

Codecov Report

Attention: Patch coverage is 87.50000% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 81.41%. Comparing base (8230bd4) to head (c03410a).

Files Patch % Lines
...o/integrations/roborock/vacuum/vacuumcontainers.py 84.61% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1914      +/-   ##
==========================================
- Coverage   81.42%   81.41%   -0.01%     
==========================================
  Files         193      193              
  Lines       18628    18636       +8     
  Branches     4041     4045       +4     
==========================================
+ Hits        15167    15173       +6     
- Misses       3179     3180       +1     
- Partials      282      283       +1     

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

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.

LGTM, thanks for the PR, @SLaks! Did you mark this as a draft on purpose, or should this be merged right away?

@SLaks
Copy link
Contributor Author

SLaks commented Mar 18, 2024

I marked this as draft because I couldn't test it due to rytilahti/homeassistant-xiaomi-ng#1.

Feel free to merge it; I may send followup PRs after #1916 merges to fix other issues or add other features (eg, I plan to add a sensor for WiFi signal strength).

SLaks added 3 commits March 19, 2024 10:15
And make this declarative.
This avoids showing `%20` in UI.

Warning: I didn't verify that changing the map works, because it stopped showing me other choices after this.  Not sure why.
@SLaks SLaks changed the title Roborock: Mark Q Revo as having a mop. Roborock: Add additional features, mostly for Q Revo Mar 19, 2024
@SLaks
Copy link
Contributor Author

SLaks commented Mar 19, 2024

Update: I verified that the map dropdown works correctly. However, it resets to the first map in the list (which, incidentally, is the map the robot is physically in) after 10 seconds or so.

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.

Looks good to me, tested on gen1 vac. We can either merge this and continue on subsequent PRs, or leave this open for the time being, your call.

SLaks added 3 commits March 19, 2024 15:25
Based on the icons used by the HA native Roborock integration
Using enum with options shows a dropdown of available values when building conditions or triggers in HA.
Note: Only newer models have this (Q Revo is the only one I know of).  HA shows the sensor as `unknown` for other models; I don't know how to exclude it.
@SLaks
Copy link
Contributor Author

SLaks commented Mar 19, 2024

I pushed a WiFi strength sensor.

This is everything I wanted to add at the moment; I may send followups if I discover more issues

@SLaks SLaks marked this pull request as ready for review March 19, 2024 19:26
miio/device.py Outdated Show resolved Hide resolved
miio/integrations/roborock/vacuum/vacuum.py Outdated Show resolved Hide resolved
@rytilahti rytilahti changed the title Roborock: Add additional features, mostly for Q Revo Roborock: various improvements to exposed sensors Mar 20, 2024
@rytilahti
Copy link
Owner

Thanks! I updated the title & description to be a bit more descriptive for the git logs, I hope that's fine with you.

@rytilahti rytilahti merged commit 8643a57 into rytilahti:master Mar 20, 2024
23 of 24 checks passed
@SLaks
Copy link
Contributor Author

SLaks commented Mar 20, 2024 via email

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.

2 participants