Skip to content

Add Xiaomi Smart Air Purifier 6 Plus support - #2098

Open
Aulos wants to merge 2 commits into
rytilahti:masterfrom
Aulos:add-xiaomi-airp-mc6
Open

Aulos wants to merge 2 commits into
rytilahti:masterfrom
Aulos:add-xiaomi-airp-mc6

Conversation

@Aulos

@Aulos Aulos commented Nov 3, 2026

Copy link
Copy Markdown

Summary

Add local support for xiaomi.airp.mc6 through a separate AirPurifierMC6 implementation. The MC6 uses Auto=0, Sleep=3 and Favorite=5 and different property IDs from the existing purifier models.

DeviceFactory(xiaomi.airp.mc6) -> AirPurifierMC6
status -> batches of up to five get_properties reads
controls -> validated set_properties values and matching acknowledgements

Includes power, modes, Favorite/fan levels, screen/brightness, buzzer, child lock, ionizer, UV, environmental/filter readings and target/actual motor speed. Exports the class and exposes it through miiocli airpurifiermc6 with status descriptors. Unknown modes and failed optional properties remain unavailable; failed power reads raise DeviceException.

Fixes #2097.

Evidence

  • Before: the model is not registered with DeviceFactory.
  • After: factory and CLI discovery succeed. pytest -q miio reports 1550 passed, 7 skipped, 1 xfailed and 43 subtests passed. All pre-commit checks pass, including mypy.
  • The fixture contains sanitized local readings from an EU MC6 running firmware 1.0.5. Tests cover the property IDs, five-property batches, failed reads, mode/range validation, exact write payloads and rejected acknowledgements.
  • This new class was tested directly with a read-only status() call on the device: all 21 mapped properties returned values.
  • Separate prior device tests verified screen switching and mode/Favorite-level writes at all ten levels, with original settings restored afterward. Other new-class write methods have automated protocol tests but have not all been physically verified.

Specification: https://miot-spec.org/miot-spec-v2/instance?type=urn:miot-spec-v2:device:air-purifier:0000A007:xiaomi-mc6:1:0000D050

Merge Danger

Door: Two-way.

Blast Radius: MC6 only. Existing purifier implementations and dependencies are unchanged. Polling is read-only. Undocumented units, debug writes and action buttons are omitted from this initial support; measured RPMs are not hardcoded as universal per-level settings.

Prepared with AI assistance and device-owner testing. No credentials, device IDs or private addresses are included.

@codecov

codecov Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.52%. Comparing base (9a00e08) to head (d71f307).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2098      +/-   ##
==========================================
+ Coverage   84.31%   84.52%   +0.20%     
==========================================
  Files         201      204       +3     
  Lines       20656    20915     +259     
  Branches     1121     1134      +13     
==========================================
+ Hits        17417    17678     +261     
+ Misses       3047     3045       -2     
  Partials      192      192              

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

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Mijia Smart Air Purifier 6 Plus (xiaomi.airp.mc6) support

1 participant