-
Notifications
You must be signed in to change notification settings - Fork 524
Support DPS feature #2750
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
base: main
Are you sure you want to change the base?
Support DPS feature #2750
Conversation
Signed-off-by: Hunsup Jung <hunsup.jung@samsung.com>
|
Duplicate profile check: Warning - duplicate profiles detected. |
|
Invitation URL: |
Test Results 71 files 483 suites 0s ⏱️ For more details on these failures, see this check. Results for commit 6d1d895. ♻️ This comment has been updated with latest results. |
|
Minimum allowed coverage is Generated by 🐒 cobertura-action against 6d1d895 |
| local DOOR_STATE_MAP = { | ||
| [DoorStateEnum.DOOR_OPEN] = doorState.open, | ||
| [DoorStateEnum.DOOR_CLOSED] = doorState.closed, | ||
| [DoorStateEnum.DOOR_JAMMED] = doorState.jameed, |
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.
doorState.jameed -> doorState.jammed
| if clus_has_feature(DoorLock.types.Feature.DOOR_POSITION_SENSOR) then | ||
| table.insert(main_component_capabilities, capabilities.doorState.ID) | ||
| device.thread:call_with_delay(5, function(t) | ||
| device:emit_event(capabilities.doorState.supportedDoorStates({"open", "closed"}, {visibility = {displayed = false}})) -- open and closed are madatory |
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.
nit: madatory -> mandatory
|
@HunsupJung can you look at the unit test failure and also add new unit tests for the DPS functionality? |
| [DoorStateEnum.DOOR_UNSPECIFIED_ERROR] = doorState.unspecifiedError, | ||
| [DoorStateEnum.DOOR_AJAR] = doorState.ajar | ||
| } | ||
| device:emit_event(DOOR_STATE_MAP[ib.data.value]()) |
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.
DoorState is a nullable attribute so you should check for nil here
| local clus_has_feature = function(feature_bitmap) | ||
| return DoorLock.are_features_supported(feature_bitmap, ep_cluster.feature_map) | ||
| end | ||
| if clus_has_feature(DoorLock.types.Feature.DOOR_POSITION_SENSOR) 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.
I know that at least some locks will set the DOOR_POSITION_SENSOR feature flag by default even if a door sensor is not configured. They will report NULL for the DoorState attribute until one has been configured. So I think we should check DoorState and the DPS flag and if they are non-NULL and the flag is set then we can say doorState is supported on this lock.
Type of Change
Checklist
Description of Change
Summary of Completed Tests