Skip to content
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 new-matter-lock driver #1911

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

HunsupJung
Copy link
Collaborator

@HunsupJung HunsupJung commented Feb 5, 2025

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

  1. Issue
    User is allowed to lock or unlock from the device card if door lock status is unlatched, but user is not allowed to do the same from Plugin.

  2. Solution
    Add Visible Condition to the profiles that have unlatched status

  3. Changes
    Add Visible Condition to the profiles that have unlatched status
    Add some profiles for unlatch feature

Summary of Completed Tests

Copy link

github-actions bot commented Feb 5, 2025

Duplicate profile check: Passed - no duplicate profiles detected.

Copy link

github-actions bot commented Feb 5, 2025

Copy link

github-actions bot commented Feb 5, 2025

Test Results

   64 files  ± 0    410 suites  ±0   0s ⏱️ ±0s
2 065 tests  -  2  2 065 ✅  -  2  0 💤 ±0  0 ❌ ±0 
3 536 runs   - 10  3 536 ✅  - 10  0 💤 ±0  0 ❌ ±0 

Results for commit ac1c841. ± Comparison against base commit d649f75.

This pull request removes 2 tests.
Handle Unlatch Operation event from Matter device.
Handle Unlatch command received from SmartThings.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Feb 5, 2025

File Coverage
All files 89%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-lock/src/new-matter-lock/init.lua 88%
/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%

Minimum allowed coverage is 90%

Generated by 🐒 cobertura-action against ac1c841

@HunsupJung HunsupJung force-pushed the fix/unmatching-visible-status-in-matter-lock branch from ad6655a to 6ebe1a5 Compare February 5, 2025 09:49
@hcarter-775
Copy link
Contributor

Can you add a unit test to ensure the battery profiling works as expected for these new profiles?

@hcarter-775
Copy link
Contributor

@HunsupJung
Copy link
Collaborator Author

@hcarter-775
Yes, I will close this PR.
#1880

@HunsupJung HunsupJung force-pushed the fix/unmatching-visible-status-in-matter-lock branch from 6ebe1a5 to 4a8a036 Compare February 25, 2025 11:05
- Add Visible Condition to some profiles that have unlatched
- Add some profiles for unlatch feature

Signed-off-by: Hunsup Jung <[email protected]>
@HunsupJung HunsupJung force-pushed the fix/unmatching-visible-status-in-matter-lock branch from 4a8a036 to ac1c841 Compare February 25, 2025 11:35
@HunsupJung
Copy link
Collaborator Author

@hcarter-775
When I check the result of "Run driver tests", the error occurs as like below

    lua: .../Project/hub-core/lib/scripting-engine/lua_libs/yaml.lua:287: expected comma
    stack traceback:
    	[C]: in function 'error'
    	.../Project/hub-core/lib/scripting-engine/lua_libs/yaml.lua:287: in method 'expect'
    	.../Project/hub-core/lib/scripting-engine/lua_libs/yaml.lua:537: in method 'parseInlineHash'
    	.../Project/hub-core/lib/scripting-engine/lua_libs/yaml.lua:347: in method 'parse'
    	.../Project/hub-core/lib/scripting-engine/lua_libs/yaml.lua:516: in method 'parseHash'
    	.../Project/hub-core/lib/scripting-engine/lua_libs/yaml.lua:351: in method 'parse'
    	.../Project/hub-core/lib/scripting-engine/lua_libs/yaml.lua:560: in method 'parseList'
    	.../Project/hub-core/lib/scripting-engine/lua_libs/yaml.lua:345: in method 'parse'
    	.../Project/hub-core/lib/scripting-engine/lua_libs/yaml.lua:516: in method 'parseHash'
    	.../Project/hub-core/lib/scripting-engine/lua_libs/yaml.lua:351: in method 'parse'
    	.../Project/hub-core/lib/scripting-engine/lua_libs/yaml.lua:516: in method 'parseHash'
    	.../Project/hub-core/lib/scripting-engine/lua_libs/yaml.lua:351: in method 'parse'
    	.../Project/hub-core/lib/scripting-engine/lua_libs/yaml.lua:516: in method 'parseHash'
    	.../Project/hub-core/lib/scripting-engine/lua_libs/yaml.lua:351: in function <.../Project/hub-core/lib/scripting-engine/lua_libs/yaml.lua:320>
    	(...tail calls...)
    	...lib/scripting-engine/lua_libs/integration_test/utils.lua:111: in function 'integration_test.utils.get_profile_definition'
    	...atter-lock/src/test/test_matter_lock_unlatch_battery.lua:72: in main chunk
    	[C]: in ?

As above error log, There's a problem that lua_libs doesn't support deviceConfig in profile files. We need to update lua_libs to solve this issue.
In my opinion, It would be better that we merge this PR first without additional unit test and then update unit test file after updating lua_libs.

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