-
-
Notifications
You must be signed in to change notification settings - Fork 568
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
Support for Xiaomi Mijia G1 (mijia.vacuum.v2) #867
Conversation
forgot to commit that too
I've checked out this branch, did a
|
Your log was my starting point also ;) mirobo won't work because it doesn't know of "g1vacuum", could you please try it with: poetry run miiocli g1vacuum --token .... --ip 172.20.10.3 --debug status Since everything which I wanted works - like starting, stopping, pausing, return to home and status working in FHEM (via pythonbinding of miio) and homebridge/Siri , I really don't know if this code will evolve in the near future. |
I use home assistant as docker image. How can i test your code without installing standalone home assistant and manual update from your branch? |
Unfortunatlely I can't help here, because I have no knowledge about home assistant or its docker image, Maybe it is sufficient to just replace the init.py and insert the new file g1vacuum.py (but I don't know how to map these to the docker image) |
Thank you! Model: mijia.vacuum.v1 |
Sorry for the super late reply...but I can confirm that this appears to work with the Xiaomi Vacccum Mop Essential (afaik it's the same at the G1 but for Europe). This is the output from State: State.Charging
Error: Error.Everything_is_ok
Battery: 100%
Mode: VacuumMode.Global_clean
Mop State: MopState.On
Charge Status: ChargeState.Charging_competely
Fan speed: FanSpeed.Standard
Water level: WaterLevel.Level2
Filter Life Level: 95%
Brush Life Level: 97%
Side Brush Life Level: 94%
Clean Area: 0
Clean Time: None
Total Clean Count: 0 Output from Model: mijia.vacuum.v2
Hardware version: esp32
Firmware version: 2.0.8 It would be great to get this merged and into an upcoming Home Assistant release.. |
Resolved little conflict
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.
Hey @neturmel and thanks for the PR! I'm sorry, I somehow missed this PR earlier and just realized I haven't commented on it after receiving a notification on your recent change.
On the surface the PR looks good, but there are some changes that are easier to done now than later on, mostly related to consolidating the API among different vacuum implementations.
Just committed some changes. But keep in mind that Python is not my native language ;). |
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.
This looks good to be merged after fixing a few minor issues. Note that there will be an API break so some of the names and values will likely change when I'll consolidate all existing vacuum implementations to have a common (base) API to allow easier downstream integration.
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.
A final round of comments, thanks for your patience and work on this! :-) When those are done, let's merge this and fix any potential issues in future PRs.
Co-authored-by: Teemu R. <tpr@iki.fi>
Co-authored-by: Teemu R. <tpr@iki.fi>
Co-authored-by: Teemu R. <tpr@iki.fi>
Looks like black is still doing some changes.. The easiest way to fix this is to run |
no more reformatting by black on local run :) |
Here's the diff that I get after running black on a local checkout:
|
*sigh
now in vscode workflow
Codecov Report
@@ Coverage Diff @@
## master #867 +/- ##
==========================================
- Coverage 76.07% 74.87% -1.20%
==========================================
Files 75 76 +1
Lines 8722 8999 +277
Branches 747 767 +20
==========================================
+ Hits 6635 6738 +103
- Misses 1905 2077 +172
- Partials 182 184 +2
Continue to review full report at Codecov.
|
Do you mind adding some tests for this to avoid breaking it when the vacuum integrations get refactored? That would make the codecov checks also happy :-) |
No, I don't. But since this is entirely new to me, I expect further errors/warnings whatsoever. |
Great, thanks! Btw, you can run the whole linting process by calling |
prec-commit run -a on local checkout was successful. |
Test removed
Thanks again for the PR and your patience, @neturmel, let's merge it! |
just a quick and dirty hack based on airhumidifier_miot and dreame.vacuum.mc1808.
Only some commands are working. But you get some status report and starting and stopping ist possible.
Didn't bother to try it with the newer "get_properties_by_dataclass".