Skip to content

Add support for Xiaomi Smart Pet Care Air Purifier (xiaomi.airp.cpa5)#2087

Open
Pocke01 wants to merge 2 commits into
rytilahti:masterfrom
Pocke01:cpa5-support-upstream
Open

Add support for Xiaomi Smart Pet Care Air Purifier (xiaomi.airp.cpa5)#2087
Pocke01 wants to merge 2 commits into
rytilahti:masterfrom
Pocke01:cpa5-support-upstream

Conversation

@Pocke01

@Pocke01 Pocke01 commented Jul 23, 2026

Copy link
Copy Markdown

Summary

Adds the MIoT mapping for the Xiaomi Smart Pet Care Air Purifier (xiaomi.airp.cpa5), based on https://home.miot-spec.com/spec/xiaomi.airp.cpa5.

All properties in the mapping have been verified against a real device: power, mode, aqi, filter life/hours/time, led_brightness, buzzer, child_lock, favorite_level, motor_speed.

This model's LED brightness enum is reversed on the device side (Off/Dim/Bright in that literal order, instead of the Bright/Dim/Off order used by most other models), same as va2/mb5/vb4/rmb1, so it's added to the existing REVERSED_LED_BRIGHTNESS list.

Test plan

  • Added TestAirPurifierCPA5 (status + led brightness round-trip) to the existing test module, all passing
  • Verified against real hardware: power on/off, mode (auto/manual), aqi, favorite_level, buzzer, child_lock, led_brightness (all three states), filter/firmware info retrieval

Adds the MIoT property mapping for this model, sourced from the
authoritative spec at home.miot-spec.com. The model needs to be
included in REVERSED_LED_BRIGHTNESS since its led_brightness value
order (Off=0, Dim=1, Bright=2) is reversed relative to the common
(Bright=0, Dim=1, Off=2) order.

Verified against physical hardware: status reading, led_brightness
(all three states), buzzer, child_lock (confirmed it actually locks
the physical buttons without affecting the buzzer), favorite_level
and mode.
@codecov

codecov Bot commented Jul 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.38%. Comparing base (34dd0e9) to head (e2346a3).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2087      +/-   ##
==========================================
+ Coverage   84.35%   84.38%   +0.03%     
==========================================
  Files         201      201              
  Lines       20377    20417      +40     
  Branches     1079     1079              
==========================================
+ Hits        17188    17228      +40     
  Misses       2999     2999              
  Partials      190      190              

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

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.

1 participant