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

Initial support for Vacuum 1C STYTJ01ZHM (dreame.vacuum.mc1808) #952

Merged
merged 1 commit into from
Feb 24, 2021

Conversation

legacycode
Copy link
Contributor

@legacycode legacycode commented Feb 17, 2021

I own a Vacuum 1C STYTJ01ZHM and added support for it. This PR is based on the branch https://github.com/rytilahti/python-miio/tree/dreame_miot_mc1808

I tested every method with my own device and they all are working.

Usage: miiocli dreamevacuummiot [OPTIONS] COMMAND [ARGS]...

Options:
  --ip TEXT     [required]
  --token TEXT  [required]
  --help        Show this message and exit.

Commands:
  home                  Return to home.
  identify              Locate the device (i am here).
  info                  Get miIO protocol information from the device.
  raw_command           Send a raw command to the device.
  reset_filter_life     Reset filter life.
  reset_mainbrush_life  Reset main brush life.
  reset_sidebrush_life  Reset side brush life.
  start                 Start cleaning.
  status                State of the vacuum.
  stop                  Stop cleaning.
miiocli dreamevacuummiot --ip xxx --token xxx status

Battery level: 86
Brush life level: 100
Brush left time: 300
Charging state: not_charging
Cleaning mode: default
Device fault: no_faults
Device status: idle
Filter left level: 150
Filter life level: 100
Life brush main: 18000-18000
Life brush side: 12000-12000
Life sieve: 9000-9000
Map view: tmp
Operating mode: fixme14
Side cleaning brush left time: 200
Side cleaning brush life level: 100
Timer enabled: False
Timer start time: 22:00
Timer stop time: 8:00
Voice package: DE
Volume: 14

BTW: Where can i find the technical json file? I have seen that the previous file was generated?

Thanks for your suggestions and best regards.

@legacycode legacycode force-pushed the dreamevacuum branch 3 times, most recently from 26475e8 to ad58bee Compare February 20, 2021 11:55
@legacycode
Copy link
Contributor Author

@rytilahti i dont know why this build fails. Can you give me a hint?

@rytilahti
Copy link
Owner

Hey, it's coming from using model in SUPPORTED_MODELS.keys(): https://dev.azure.com/python-miio/python-miio/_build/results?buildId=901&view=logs&jobId=13848698-6df7-53ab-f6ce-57fb993c05be&j=13848698-6df7-53ab-f6ce-57fb993c05be&t=4316697d-697e-5b3b-d95b-644457d92942 - where model in SUPPORTED_MODELS is expected.

If you have installed pre-commit hooks, it will run automatically pre-commit, but you can also always run the tests run by the CI using pre-commit run -a in the source directory.

For the JSON file, check out devtools directory and its README :-)

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.

Thanks for the PR, some comments from a very brief initial review.

This will make #683 obsolete, right?

miio/dreamevacuum_miot.py Outdated Show resolved Hide resolved
miio/dreamevacuum_miot.py Outdated Show resolved Hide resolved
miio/dreamevacuum_miot.py Outdated Show resolved Hide resolved
miio/dreamevacuum_miot.py Outdated Show resolved Hide resolved
miio/dreamevacuum_miot.py Outdated Show resolved Hide resolved
miio/dreamevacuum_miot.py Outdated Show resolved Hide resolved
miio/dreamevacuum_miot.py Outdated Show resolved Hide resolved
@legacycode
Copy link
Contributor Author

Thanks for the PR, some comments from a very brief initial review.

This will make #683 obsolete, right?

Correct #683 can be closed and the branch can be deleted.

@legacycode
Copy link
Contributor Author

Hey, it's coming from using model in SUPPORTED_MODELS.keys(): https://dev.azure.com/python-miio/python-miio/_build/results?buildId=901&view=logs&jobId=13848698-6df7-53ab-f6ce-57fb993c05be&j=13848698-6df7-53ab-f6ce-57fb993c05be&t=4316697d-697e-5b3b-d95b-644457d92942 - where model in SUPPORTED_MODELS is expected.

If you have installed pre-commit hooks, it will run automatically pre-commit, but you can also always run the tests run by the CI using pre-commit run -a in the source directory.

For the JSON file, check out devtools directory and its README :-)

Thanks, but i did not change the heater.py file. On my machine there are no errors when running the pre-commit scripts:

docformatter.............................................................Passed
flake8...................................................................Passed
bandit...................................................................Passed

@legacycode legacycode requested a review from rytilahti February 24, 2021 14:24
@rytilahti
Copy link
Owner

rytilahti commented Feb 24, 2021

@legacycode the precommit output looks odd, considering that there are more checks since #915 and the current master was checked clean... Anyway, that's not your problem, but please add an entry to the README.md for this new supported device, then this is ready to be merged!

Note, that the API (including status enums) may be adapted in the future to allow common interface among different vacuum types to simplify using the library for downstream users (like homeassistant).

@legacycode
Copy link
Contributor Author

@rytilahti I added the device to the readme file.

@rytilahti
Copy link
Owner

Thanks again for the PR, @legacycode! 🥇

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