Skip to content

Move lockAlarm configuration to do_configure#2763

Open
HunsupJung wants to merge 1 commit intomainfrom
fix/move-lockalarm-setting
Open

Move lockAlarm configuration to do_configure#2763
HunsupJung wants to merge 1 commit intomainfrom
fix/move-lockalarm-setting

Conversation

@HunsupJung
Copy link
Collaborator

@HunsupJung HunsupJung commented Feb 6, 2026

Type of Change

  • WWST Certification Request
    • If this is your first time contributing code:
      • I have reviewed the README.md file
      • I have reviewed the CODE_OF_CONDUCT.md file
      • I have signed the CLA
    • I plan on entering a WWST Certification Request or have entered a request through the WWST Certification console at developer.smartthings.com
  • Bug fix
  • New feature
  • Refactor

Checklist

  • I have performed a self-review of my code
  • I have commented my code in hard-to-understand areas
  • I have verified my changes by testing with a device or have communicated a plan for testing
  • I am adding new behavior, such as adding a sub-driver, and have added and run new unit tests to cover the new behavior

Description of Change

Summary of Completed Tests

Signed-off-by: HunsupJung <hunsup.jung@samsung.com>
@github-actions
Copy link

github-actions bot commented Feb 6, 2026

@github-actions
Copy link

github-actions bot commented Feb 6, 2026

Test Results

   71 files    485 suites   0s ⏱️
2 518 tests 2 516 ✅ 0 💤 2 ❌
4 332 runs  4 330 ✅ 0 💤 2 ❌

For more details on these failures, see this check.

Results for commit c5127c3.

@github-actions
Copy link

github-actions bot commented Feb 6, 2026

File Coverage
All files 72%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-lock/src/lock_utils.lua 98%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-lock/src/init.lua 91%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-lock/src/new-matter-lock/init.lua 65%

Minimum allowed coverage is 90%

Generated by 🐒 cobertura-action against c5127c3

end
end
device:subscribe()
device:emit_event(capabilities.lockAlarm.alarm.clear({state_change = true}))
Copy link
Contributor

@hcarter-775 hcarter-775 Feb 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should leave this here, since the call_with_delay may have some unforeseen race-y conditions.

To avoid double emitting events, we could add an

if device:get_latest_state("main", capabilities.lockAlarm.ID, capabilities.lockAlarm.supportedAlarmValues.NAME) == nil then

check to ensure the same call wasn't done earlier? However, double calling these events in this context doesn't seem like a big issue to me

Comment on lines +340 to +343
device.thread:call_with_delay(5, function()
device:emit_event(capabilities.lockAlarm.alarm.clear({state_change = true}))
device:emit_event(capabilities.lockAlarm.supportedAlarmValues({"unableToLockTheDoor"}, {visibility = {displayed = false}})) -- lockJammed is mandatory
end)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the call_with_delay should be required here. We could put an if device:supports_capability(capabilities.lockAlarm) then gate if we are trying to ensure the device has this before emitting an event.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants