-
-
Notifications
You must be signed in to change notification settings - Fork 563
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 mop dryer add-on of the S7 MaxV Ultra station #1621
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1621 +/- ##
==========================================
+ Coverage 80.26% 80.35% +0.08%
==========================================
Files 161 161
Lines 15907 15983 +76
Branches 3577 3552 -25
==========================================
+ Hits 12768 12843 +75
- Misses 2876 2884 +8
+ Partials 263 256 -7
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
3134f5a
to
affc463
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be great to get it also tested on a real device, but looks good on the surface to me, thanks for the PR @jpbede!
@@ -443,10 +444,63 @@ def test_cleaning_brush_cleaned_count(self): | |||
"""Test getting cleaning brush cleaned count.""" | |||
assert self.device.consumable_status().cleaning_brush_cleaned_count == 44 | |||
|
|||
def test_mop_dryer_model_check(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about simplifying this using pytest.mark.parametrize?
Something like this (untested):
@pytest.mark.parametrize("method_name,params", [("mop_dryer_settings", None), ("set_mop_drier_enabled", {"enabled": True}), ...])
def test_mop_drier_raises_unsupported(method_name, params):
with pytest.raises(UnsupportedFeatureException):
method = getattr(self.device, method_name)
if params is not None:
method(**params)
else:
method()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIK @pytest.mark.parametrize
is not usable when using TestCase
because the reference to self
is missing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ohh, okay. I think this is fine and can be reconsidered when the tests get cleaned up to avoid inheriting from TestCase, thanks for the PR and for giving it a go against a real device! 👍
I've tested it now with a real device. Unfortunately the add-on is not reporting Starting, stopping and setting the dry time is working. |
1ee2ebc
to
32f820d
Compare
There was a problem hiding this 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 @jpbede!
This does not currently modify the status()
logic to allow exposing them directly to homeassistant, but that requires some internal changes on how the embedding is done so I think this is ready to be merged now.
@@ -443,10 +444,63 @@ def test_cleaning_brush_cleaned_count(self): | |||
"""Test getting cleaning brush cleaned count.""" | |||
assert self.device.consumable_status().cleaning_brush_cleaned_count == 44 | |||
|
|||
def test_mop_dryer_model_check(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ohh, okay. I think this is fine and can be reconsidered when the tests get cleaned up to avoid inheriting from TestCase, thanks for the PR and for giving it a go against a real device! 👍
The S7 MaxV Ultra station (and AFAIK also the S7 Ultra station) has an optional mop dryer add-on. Based on reverse engineering of the Mi Home app plugin code, I added support for this.
Currently this code is partially untested as I am waiting for my add-on to be delivered. Delivery is expected around 12/19.
But I appreciate code review and feedback already :)