Aqara FP400: Support MCD and Re-profiling - #3118
Conversation
|
Duplicate profile check: Passed - no duplicate profiles detected. |
|
Invitation URL: |
Test Results 73 files 541 suites 0s ⏱️ For more details on these errors, see this check. Results for commit 85d0a2d. ♻️ This comment has been updated with latest results. |
|
Minimum allowed coverage is Generated by 🐒 cobertura-action against 30a04ff |
| end | ||
| end | ||
|
|
||
| --- Deeply compare two values. |
There was a problem hiding this comment.
since this is now being used in 2 subdrivers, I just moved this to the main utils file
30a04ff to
0b2b178
Compare
|
Profile category check: ✅ Passed - all profiles have a category defined. |
|
matter-sensor_coverage.xml
Minimum allowed coverage is Generated by 🐒 cobertura-action against 85d0a2d |
52a629d to
b1b778a
Compare
|
@hdlee27 Could you share your test result? |
| "Test profile change on endpoints increment in infoChanged for FP400", | ||
| function() | ||
| local current_profile_id = mock_device.profile.id | ||
| local incremented_matter_endpoints = matter_endpoints |
There was a problem hiding this comment.
| local incremented_matter_endpoints = matter_endpoints | |
| local incremented_matter_endpoints = utils.deep_copy(matter_endpoints) |
This is modifying the table that is used in the mock_device table itself. It is also modifying it for subsequent tests.
There was a problem hiding this comment.
haha, I actually did that semi on purpose for the subsequent tests. You're right that that's pretty contrived though
There was a problem hiding this comment.
I looked into altering this- it gets a little messy due to how the current update() function in our integration tests works within generate_info_changed. Effectively, the update fn is unable to actually remove endpoints right now. Per AI (double checked by me): "The utils.update function merges tables recursively by key. Since Lua arrays use numeric keys (1, 2, 3, ...), when you pass a shorter array (4 elements) to update a longer one (5 elements), it updates keys 1–4 but leaves the 5th element from the original array intact. So endpoint 5 from the original device remains, plus your new endpoint 5 is now at position 4 — resulting in a duplicate."
So I actually think that the current version of this is the cleanest method of testing at the moment. Would you want to try and update this really quick before merging the PR? I kinda think that might be adding some tension where there is none.
Edit: I do not think we should change the current update implementation in the integration test logic, so this is the best way to do it, I think.
7a1775b to
85d0a2d
Compare
Description of Change
Support MCD profile and endpoint-comparison re-profiling for the FP400.
The endpoint data model re-interview logic will be included in 0.62+. For hubs below this version, the infoChanged trigger will never occur, unless perhaps a software version update occurs.
Summary of Completed Tests
On-device testing completed.
Adding/removing endpoints via the Aqara app updates the FP400's endpoint model, which in turn updates the device profile. All endpoint attribute updates are properly mapped to the appropriate component.