-
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
Add new-matter-lock driver #1624
Conversation
Duplicate profile check: Passed - no duplicate profiles detected. |
Channel deleted. |
Test Results 64 files 397 suites 0s ⏱️ Results for commit 37709e8. ♻️ This comment has been updated with latest results. |
Minimum allowed coverage is Generated by 🐒 cobertura-action against 37709e8 |
Signed-off-by: Hunsup Jung <[email protected]>
f428f81
to
b6c9c65
Compare
Signed-off-by: Hunsup Jung <[email protected]>
c38540b
to
41bc486
Compare
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'm still working my way through testing this. Can you add unit tests as well?
Signed-off-by: Hunsup Jung <[email protected]>
Signed-off-by: Hunsup Jung <[email protected]>
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.
Hello @HunsupJung before merging this code , please provide tested results as communicated via slack.
Signed-off-by: Hunsup Jung <[email protected]>
53e6f2b
to
ef622e0
Compare
Signed-off-by: Hunsup Jung <[email protected]>
21dfec8
to
45e3606
Compare
Signed-off-by: Hunsup Jung <[email protected]>
42fa87c
to
1b19d30
Compare
@lelandblue @ctowns |
Signed-off-by: Hunsup Jung <[email protected]>
@HunsupJung could you add more unit tests for the new-matter-lock driver? Currently the code coverage for this driver is very low, so we should add additional test cases to increase the code coverage. You should be able to copy the test cases from the |
Signed-off-by: Hunsup Jung <[email protected]>
Signed-off-by: Hunsup Jung <[email protected]>
8b33ca1
to
65d52f9
Compare
@ctowns |
Signed-off-by: Hunsup Jung <[email protected]>
404cddc
to
17d8148
Compare
Signed-off-by: Hunsup Jung <[email protected]>
a7a6dca
to
3035dbc
Compare
@lelandblue I think I added the testing you requested that's blocking the merge. Was there anything else you needed for this? |
end | ||
|
||
if device:get_field(lock_utils.SET_CREDENTIAL) ~= nil then | ||
device.log.debug("delaying setting COTA credential since a credential is currently being set") |
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.
When I test with a lock that uses COTA and the initial attempt to set the COTA PIN fails with a "duplicate" error, then it gets stuck in a loop logging this message and failing to ever retry setting the COTA PIN.
end | ||
|
||
-- Save values to field | ||
device:set_field(lock_utils.COMMAND_NAME, cmdName, {persist = true}) |
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.
@HunsupJung I understand how you are using these fields to save information to be used in a different function, but could you help me understand why we need to do it this way? Do the commands themselves not have the relevant information that we can use in the handler? It seems this is the case for things like the ClearUser command, but do we really need to save all of this information or can be pull some of it from the command args and ib elements?
Also, it seems like there could be issues if two commands that rely on a field like USER_INDEX
are processed at the same time. For example, if one command sets USER_INDEX
to 1 and then before we handle that response, another command sets USER_INDEX
to 2 , the original value would be overwritten and could cause problems in handling the first command that expected USER_INDEX
to be 1. Are there cases where this could happen?
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.
Also, it seems like there could be issues if two commands that rely on a field like USER_INDEX are processed at the same time. For example, if one command sets USER_INDEX to 1 and then before we handle that response, another command sets USER_INDEX to 2 , the original value would be overwritten and could cause problems in handling the first command that expected USER_INDEX to be 1. Are there cases where this could happen?
Therefore, I used busy_state so that only one command is proceed at a time.
Signed-off-by: Hunsup Jung <[email protected]>
Signed-off-by: Hunsup Jung <[email protected]>
[DoorLock.types.DlStatus.OCCUPIED] = "occupied", | ||
[DoorLock.types.DlStatus.INVALID_FIELD] = "invalidCommand", | ||
[DoorLock.types.DlStatus.RESOURCE_EXHAUSTED] = "resourceExhausted", | ||
[DoorLock.types.DlStatus.NOT_FOUND] = "failure" |
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.
Should this be "notFound" instead of "failure"?
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 guess not because "notFound" is not a valid value for the statusCode
property in the capability
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.
Yes, there's no notFound
value for capability
Signed-off-by: Hunsup Jung <[email protected]>
Thank you for writing the new unit tests @HunsupJung ! I think this looks like it is ready to go. One last thing - were you able to run the regression tests listed here with the new code changes? I know you have been doing a lot of testing over the past few days, so I think many of these cases have been covered but I just want to make sure the testing is good to go. Otherwise, I think this PR is ready to go. Thank you for your hard work on this 💪 ! |
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.
Thank you for your hard work on this @HunsupJung !
Testing results provided, team should continue to review results.
Check all that apply
Type of Change
Checklist
Description of Change
Adds a new sub-driver with updates to the door lock functionality. Leverages new capabilities and some new design architecture for the Aqara door locks.
Summary of Completed Tests
Completed Testing 9/27
Completed Testing 10/18