Skip to content

Zwave Lock: Support SLGA Migration#2944

Open
hcarter-775 wants to merge 7 commits intomainfrom
re-structure/feature/chad-16364-zwave
Open

Zwave Lock: Support SLGA Migration#2944
hcarter-775 wants to merge 7 commits intomainfrom
re-structure/feature/chad-16364-zwave

Conversation

@hcarter-775
Copy link
Copy Markdown
Contributor

@hcarter-775 hcarter-775 commented May 4, 2026

Description of Change

Follow-up to #2937, where I've responded to some comments that myself and others have left in order to clarify certain functionality.

Note on structure: The legacy-handlers subdriver is nearly untouched from before- the only real difference is that the key-we logic was lifted out from there since it is so close in from to the "new", now default key-we overriden behavior.

The other primary thing that was removed from the now-legacy-handlers subdriver is the old added handler, for the following 2 reasons. 1. Generally, devices should not be added to this driver any longer, and 2. We now use the added main driver implementation to initially set the migrated keyword to true.

I find the fact that the entire migrated state depends on a keyword set only once in added to be a little precarious, but nothing stands out to me initially at this not working.

Summary of Completed Tests

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026

Duplicate profile check: Passed - no duplicate profiles detected.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026

Test Results

   72 files    513 suites   0s ⏱️
2 846 tests 2 846 ✅ 0 💤 0 ❌
4 724 runs  4 724 ✅ 0 💤 0 ❌

Results for commit f24f62f.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026

File Coverage
All files 89%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-lock/src/zwave-alarm-v1-lock/init.lua 80%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-lock/src/apiv6_bugfix/can_handle.lua 66%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-lock/src/init.lua 88%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-lock/src/zwave_lock_utils.lua 85%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-lock/src/lazy_load_subdriver.lua 57%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-lock/src/samsung-lock/init.lua 94%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-lock/src/schlage-lock/init.lua 95%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-lock/src/legacy-handlers/samsung-lock/init.lua 94%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-lock/src/legacy-handlers/schlage-lock/init.lua 95%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-lock/src/legacy-handlers/zwave-alarm-v1-lock/init.lua 89%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-lock/src/keywe-lock/init.lua 80%

Minimum allowed coverage is 90%

Generated by 🐒 cobertura-action against f24f62f

@hcarter-775 hcarter-775 requested a review from tpmanley May 4, 2026 14:30
@nickolas-deboom
Copy link
Copy Markdown
Contributor

For some reason my comment is failing to save when i try to add an in line comment, but I was wondering if in addition to the lockCodes.migrated attribute should we also set a persisted flag to indicated the migrated state? Just since otherwise it would fallback to the legacy handling if the state cache is cleared

@cjswedes
Copy link
Copy Markdown
Contributor

cjswedes commented May 6, 2026

For some reason my comment is failing to save when i try to add an in line comment, but I was wondering if in addition to the lockCodes.migrated attribute should we also set a persisted flag to indicated the migrated state? Just since otherwise it would fallback to the legacy handling if the state cache is cleared

I agree with this: we should use the datastore. The state should always be available now that we are using the hubs state store to back the driver state_cache, but we have not always had this guarantee, and the pattern of expecting cached state to be present is not good IMO. Should we disable that for this driver, or make a change to how the hub handles state, it could have unintended consequences here.

@hcarter-775
Copy link
Copy Markdown
Contributor Author

@cjswedes @nickolas-deboom
Agreed, makes sense to me.

If we're wondering about the state cache, I wonder how secure lockUsers and lockCredentials are as storage places for all this data. Should we be storing that information via the datastore as well?

@hcarter-775 hcarter-775 force-pushed the re-structure/feature/chad-16364-zwave branch from f5ab265 to f24f62f Compare May 8, 2026 15:47
version: 1
- id: lockCodes
version: 1
- id: lockCredentials
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What if an existing device on one of these profiles that would not be migrated doesn't support these capabilities? I'm just wondering if new profiles should be created instead

zwave_handlers = {
[cc.TIME] = {
[Time.GET] = time_get_handler -- used by DanaLock
[0x01] = time_get_handler -- used by DanaLock
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just curious but why did Time.GET change to a hardcoded value?

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.

4 participants