Add support for Xiaomi Smart Pet Care Air Purifier (xiaomi.airp.cpa5)#2087
Open
Pocke01 wants to merge 2 commits into
Open
Add support for Xiaomi Smart Pet Care Air Purifier (xiaomi.airp.cpa5)#2087Pocke01 wants to merge 2 commits into
Pocke01 wants to merge 2 commits into
Conversation
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.
Open
1 task
Codecov Report✅ All modified and coverable lines are covered by tests. 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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/Brightin that literal order, instead of theBright/Dim/Offorder used by most other models), same asva2/mb5/vb4/rmb1, so it's added to the existingREVERSED_LED_BRIGHTNESSlist.Test plan
TestAirPurifierCPA5(status + led brightness round-trip) to the existing test module, all passing