-
Notifications
You must be signed in to change notification settings - Fork 466
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
Matter Bridge Aqara Cube Support with Custom Capability #1622
Conversation
Duplicate profile check: Passed - no duplicate profiles detected. |
Test Results 63 files 396 suites 0s ⏱️ Results for commit 54c2681. ♻️ This comment has been updated with latest results. |
Minimum allowed coverage is Generated by 🐒 cobertura-action against 54c2681 |
Hi @DongHoon-Ryu I went over the changes and left some comments. Outside of that, the changes look good to me! |
Channel deleted. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have those two last newline nits for keeping with our general standards, but otherwise it lgtm 👍 thank you!
Currently, the Generic EdgeDriver applied to the Matter Bridge Aqara Cube is implemented by mapping six faces into individual components, making it difficult to check the event occurrence of individual faces on one screen. This commit wants to improve the problem by mapping the event from Matter Bridge with Aqara Cube Custom Capability developed by Zigbee driver. This means that there is a limitation that the Action Event of the Cube that the Matter Bridge does not give can not be processed. REQ-15926, REQ-16285, IOTE-4217, IOTE-4266 Signed-off-by: donghoon-ryu <[email protected]>
local function info_changed(driver, device, event, args) | ||
if device.profile.id ~= args.old_st_store.profile.id | ||
and device:get_field(DEFERRED_CONFIGURE) | ||
and device.network_type ~= device_lib.NETWORK_TYPE_CHILD then | ||
|
||
-- At the time of device_added, there is an error that the corresponding capability cannot be found | ||
-- because the profile has not been changed from the generic profile of fingerprint to the Aqara Cube. | ||
reset_thread(device) | ||
device:emit_event(cubeFace.cubeFace("face1Up")) | ||
|
||
device:set_field(DEFERRED_CONFIGURE, nil) | ||
|
||
-- In the current test framework, the values of device.profile.id and args.old_st_store.profile.id are always the same, | ||
-- so the test coverage cannot be increased. This is why I added DOING_CONFIGURE flag. | ||
device:set_field(DOING_CONFIGURE, true) | ||
end | ||
|
||
if device:get_field(DOING_CONFIGURE) then | ||
-- profile has changed, and we deferred setting up our buttons, so do that now | ||
configure_buttons(device) | ||
device:set_field(DOING_CONFIGURE, nil) | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
local function info_changed(driver, device, event, args) | |
if device.profile.id ~= args.old_st_store.profile.id | |
and device:get_field(DEFERRED_CONFIGURE) | |
and device.network_type ~= device_lib.NETWORK_TYPE_CHILD then | |
-- At the time of device_added, there is an error that the corresponding capability cannot be found | |
-- because the profile has not been changed from the generic profile of fingerprint to the Aqara Cube. | |
reset_thread(device) | |
device:emit_event(cubeFace.cubeFace("face1Up")) | |
device:set_field(DEFERRED_CONFIGURE, nil) | |
-- In the current test framework, the values of device.profile.id and args.old_st_store.profile.id are always the same, | |
-- so the test coverage cannot be increased. This is why I added DOING_CONFIGURE flag. | |
device:set_field(DOING_CONFIGURE, true) | |
end | |
if device:get_field(DOING_CONFIGURE) then | |
-- profile has changed, and we deferred setting up our buttons, so do that now | |
configure_buttons(device) | |
device:set_field(DOING_CONFIGURE, nil) | |
end | |
end | |
-- used in unit testing, since device.profile.id and args.old_st_store.profile.id are always the same | |
local TEST_CONFIGURE = "__test_configure" | |
... | |
local function info_changed(driver, device, event, args) | |
if (device.profile.id ~= args.old_st_store.profile.id or device:get_field(TEST_CONFIGURE)) | |
and device:get_field(DEFERRED_CONFIGURE) | |
and device.network_type ~= device_lib.NETWORK_TYPE_CHILD then | |
-- At the time of device_added, there is an error that the corresponding capability cannot be found | |
-- because the profile has not been changed from the generic profile of fingerprint to the Aqara Cube. | |
reset_thread(device) | |
device:emit_event(cubeFace.cubeFace("face1Up")) | |
-- profile has changed, and we deferred setting up our buttons, so do that now | |
configure_buttons(device) | |
device:set_field(DEFERRED_CONFIGURE, nil) | |
end | |
end |
This may add a little bit more clarity to what is going on, without the need for as much explanation.
Just a reminder @DongHoon-Ryu, please squash your commits before merging into main. Thank you very much. |
Currently, the Generic EdgeDriver applied to the Matter Bridge Aqara Cube is implemented by mapping six faces into individual components, making it difficult to check the event occurrence of individual faces on one screen.
This commit wants to improve the problem by mapping the event from Matter Bridge with Aqara Cube Custom Capability developed by Zigbee driver. This means that there is a limitation that the Action Event of the Cube that the Matter Bridge does not give can not be processed.
REQ-15926, REQ-16285, IOTE-4217, IOTE-4266
Check all that apply
Type of Change
Checklist
Description of Change
This commit wants to improve the problem by mapping the event from Matter Bridge with Aqara Cube Custom Capability developed by Zigbee driver. This means that there is a limitation that the Action Event of the Cube that the Matter Bridge does not give can not be processed.
Summary of Completed Tests