-
Notifications
You must be signed in to change notification settings - Fork 464
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
Update matter-lock driver for U-tec #1812
base: main
Are you sure you want to change the base?
Conversation
Duplicate profile check: Passed - no duplicate profiles detected. |
Invitation URL: |
Signed-off-by: Hunsup Jung <[email protected]>
e386b18
to
3c60f45
Compare
Minimum allowed coverage is Generated by 🐒 cobertura-action against fa76eda |
Test Results 64 files 403 suites 0s ⏱️ Results for commit fa76eda. ♻️ This comment has been updated with latest results. |
After an initial review, the changes look good to me overall. I have two comments - (2) Would you be able to create a few test cases similar to what I have here? https://github.com/SmartThingsCommunity/SmartThingsEdgeDrivers/pull/1796/files#diff-188bbf519a245b9967a0a86552cf7b20bef0a2b5ce6598196cca7e6591acc56d (In order to show that the |
There may be other possible combinations. But I added lock-user-pin-batteryLevel, lock-user-pin-battery and lock-user-pin-scheduled-battery which are highly likely. For U-tec, the lock-user-pin-batteryLevel profile is enough.
Okay, I will update it. |
I think it's ok to include just the likely ones for now rather than every combination. |
Signed-off-by: Hunsup Jung <[email protected]>
2d7e508
to
aa47454
Compare
@@ -1685,7 +1752,10 @@ local new_matter_lock_handler = { | |||
capabilities.lock, | |||
capabilities.lockUsers, | |||
capabilities.lockCredentials, | |||
capabilities.lockSchedules | |||
capabilities.lockSchedules, | |||
capabilities.remoteControlStatus, |
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.
There is no handler for remoteControlStatus
, should there be or should this be removed?
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 don't think it's needed. I will remove it.
end | ||
test.set_test_init_function(test_init) | ||
|
||
test.register_coroutine_test( |
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.
Could you create a test case for the following cases also?
- battery percent remaining is available ✅
- battery charge level only is available ❌
- battery charge level and battery percent remaining are available ❌
You will just need to modify the attributes list in the AttributeList:build_test_report_data
function you are using to test these different combinations of attributes in the new test cases.
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 thought the second case was added, but it wasn't. I will modify it.
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.
For reference, it is impossible to support only Battery percent remaining
. Because if server supports BAT feature, Battery change level
is mandatory. I will create as follows.
- Attributes related to BAT feature is not available.
- battery charge level only is available.
- battery charge level and battery percent remaining are available.
local support_battery_percentage = false | ||
for _, attr in ipairs(ib.data.elements) do | ||
-- Re-profile the device if BatPercentRemaining (Attribute ID 0x0C) is present. | ||
if attr.value == 0x0C then |
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.
Can we add an explicit check for the BatChargeLevel
attribute here?
if attr.value == 0x0C then
support_battery_percentage = true
end
if attr.value == 0x0E then
support_battery_level = true
end
------then later add this :-----------
if support_battery_percentage then
profile_name = profile_name .. "-battery"
elseif support_battery_level
profile_name = profile_name .. "-batteryLevel"
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.
Okay, I will
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.
This looks pretty good to me! After adding the additional unit tests and making the small change in the handler, I think this will be good to go - thank you @HunsupJung !
Also, has this been regression tested with the other locks that use this driver?
I tested this PR with Aqara U200/U300 door lock - it was fine. Thank you. |
Signed-off-by: Hunsup Jung <[email protected]>
Signed-off-by: Hunsup Jung <[email protected]>
Check all that apply
Type of Change
Checklist
Description of Change
https://smartthings.atlassian.net/browse/IOTE-4705
Summary of Completed Tests