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, |
| 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 |
|
@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.
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.
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