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

Update dreamevacuum_miot.py with Xaiomi X10 #1924

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

MaciekIzdebski
Copy link

Added support for Xaiomi/dreame Vaccum X10/X10+

Copy link

codecov bot commented Apr 2, 2024

Codecov Report

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

Project coverage is 81.34%. Comparing base (8643a57) to head (486e929).

Files Patch % Lines
...io/integrations/dreame/vacuum/dreamevacuum_miot.py 57.62% 23 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1924      +/-   ##
==========================================
- Coverage   81.41%   81.34%   -0.07%     
==========================================
  Files         193      193              
  Lines       18636    18691      +55     
  Branches     4045     4056      +11     
==========================================
+ Hits        15173    15205      +32     
- Misses       3180     3201      +21     
- Partials      283      285       +2     

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

Hi and thanks for the PR @MaciekIzdebski! A couple of quick comments, btw, if you didn't already notice, most of the miot devices like this are also controllable directly using the genericmiot integration, i.e., miiocli genericmiot --ip <x> --token <x> status etc.

Comment on lines 311 to 313
class DustAutoCollect(FormattableEnum):
Off = 0
On = 1
Copy link
Owner

Choose a reason for hiding this comment

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

Use boolean instead.

@@ -480,6 +592,8 @@ class DreameVacuum(MiotDevice):
"Device status: {result.device_status}\n"
"Filter left level: {result.filter_left_time}\n"
"Filter life level: {result.filter_life_level}\n"
"Sensor left level: {result.sensor_left_time}\n"
Copy link
Owner

Choose a reason for hiding this comment

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

Please add descriptors to the status class(es) (@sensor, @setting, @action) so we can get rid of the manual output formatting altogether, and use the standardized interface for controls (i.e., miiocli commands like status, actions, settings, call and set).

This makes them visible for the cli and the future homeassistant integration (https://github.com/rytilahti/homeassistant-xiaomi-ng) when it's all done across the library.

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