Skip to content

Update matter window covering edge driver - #3052

Merged
hcarter-775 merged 1 commit into
SmartThingsCommunity:mainfrom
hongye-samsung:matter_blind
Jul 22, 2026
Merged

Update matter window covering edge driver#3052
hcarter-775 merged 1 commit into
SmartThingsCommunity:mainfrom
hongye-samsung:matter_blind

Conversation

@hongye-samsung

@hongye-samsung hongye-samsung commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Check all that apply

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

Co-Authored-By: Cline SR (50%)
CGAI & AI Review

@hongye-samsung
hongye-samsung marked this pull request as draft June 26, 2026 02:08
@hongye-samsung
hongye-samsung force-pushed the matter_blind branch 3 times, most recently from 571f3d8 to efdf5b3 Compare June 26, 2026 08:35
@hongye-samsung
hongye-samsung marked this pull request as ready for review June 29, 2026 04:56
@vangoran

Copy link
Copy Markdown

Edge driver development for R2 new feature (https://smartthings.atlassian.net/browse/CHAD-18661)

@hongye-samsung
hongye-samsung force-pushed the matter_blind branch 2 times, most recently from c659987 to f5b95e2 Compare June 29, 2026 10:45
@hongye-samsung

Copy link
Copy Markdown
Contributor Author

@hcarter-775 hcarter-775 left a comment

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.

Seems like the new fields may be unnecessary, and may be adding some unnecessary complexity

Comment thread drivers/SmartThings/matter-window-covering/src/init.lua Outdated
Comment thread drivers/SmartThings/matter-window-covering/src/init.lua Outdated
Comment thread drivers/SmartThings/matter-window-covering/src/init.lua Outdated
Comment thread drivers/SmartThings/matter-window-covering/src/init.lua Outdated
Comment thread drivers/SmartThings/matter-window-covering/src/init.lua Outdated
Comment thread drivers/SmartThings/matter-window-covering/src/init.lua Outdated
Comment thread drivers/SmartThings/matter-window-covering/src/init.lua
Comment thread drivers/SmartThings/matter-window-covering/src/init.lua
Comment thread drivers/SmartThings/matter-window-covering/src/init.lua
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

Duplicate profile check: Warning - duplicate profiles detected.
window-covering-battery.yml == window-covering-profile.yml

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

Channel deleted.

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

Test Results

   73 files  ±0    536 suites  ±0   0s ⏱️ ±0s
3 209 tests +6  3 207 ✅ +4  0 💤 ±0  0 ❌ ±0  2 🔥 +2 
5 198 runs  +6  5 196 ✅ +4  0 💤 ±0  0 ❌ ±0  2 🔥 +2 

For more details on these errors, see this check.

Results for commit 0b239eb. ± Comparison against base commit 60a0ce7.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

File Coverage
All files 85%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-window-covering/src/sub_drivers/closure/closure_utils/utils.lua 91%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-window-covering/src/sub_drivers/closure/closure_utils/embedded_cluster_utils.lua 43%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-window-covering/src/lazy_load_subdriver.lua 57%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-window-covering/src/init.lua 90%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-window-covering/src/sub_drivers/matter-window-covering-position-updates-while-moving/can_handle.lua 70%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-window-covering/src/sub_drivers/closure/closure_handlers/capability_handlers.lua 73%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-window-covering/src/sub_drivers/closure/closure_handlers/attribute_handlers.lua 86%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-window-covering/src/sub_drivers/closure/init.lua 78%

Minimum allowed coverage is 90%

Generated by 🐒 cobertura-action against 0b239eb

@hcarter-775

Copy link
Copy Markdown
Contributor

Hi, I just had the workflows run and there are some warnings showing up. Can you fix these warnings as well? Thanks!

hcarter-775
hcarter-775 previously approved these changes Jul 10, 2026
Comment thread drivers/SmartThings/matter-window-covering/src/init.lua Outdated
Comment thread drivers/SmartThings/matter-window-covering/src/init.lua Outdated
Comment thread drivers/SmartThings/matter-window-covering/src/init.lua Outdated
Comment thread drivers/SmartThings/matter-window-covering/src/init.lua Outdated
Comment thread drivers/SmartThings/matter-window-covering/src/init.lua
Comment thread drivers/SmartThings/matter-window-covering/src/init.lua Outdated
Comment thread drivers/SmartThings/matter-window-covering/src/init.lua Outdated
Comment thread drivers/SmartThings/matter-window-covering/src/init.lua Outdated
Comment thread drivers/SmartThings/matter-window-covering/src/init.lua Outdated
@hcarter-775
hcarter-775 self-requested a review July 10, 2026 22:43
@hcarter-775
hcarter-775 dismissed their stale review July 10, 2026 22:44

accidental approval, unit tests and comments must still be addressed

Comment thread drivers/SmartThings/matter-window-covering/src/init.lua Outdated
@zhangshen001

Copy link
Copy Markdown
Contributor

The statelessWindowShadeLevelStep capability is newly introduced in version 62 (dev), so the driver tests on versions 59 to 61 have failed.

Comment thread drivers/SmartThings/matter-window-covering/src/init.lua Outdated
Comment thread drivers/SmartThings/matter-window-covering/src/test/test_matter_closure.lua Outdated
@partner-hub-chenxuelong

Copy link
Copy Markdown

TC has been updated. Please recalculate the coverage

Comment thread drivers/SmartThings/matter-window-covering/src/test/test_matter_closure.lua Outdated
Comment on lines +831 to +848
test.register_coroutine_test(
"windowShade setShadeLevel with reverse polarity inverts level", function()
update_profile()
test.wait_for_events()
-- Set REVERSE_POLARITY field directly
local fields = require "sub_drivers.closure.closure_utils.fields"
mock_device:set_field(fields.REVERSE_POLARITY, true, {persist = true})
test.socket.capability:__queue_receive({
mock_device.id,
{capability = "windowShadeLevel", component = "windowShade1", command = "setShadeLevel", args = {75}},
})
-- With reverse=true, 75 should be inverted to 25
test.socket.matter:__expect_send({
mock_device.id,
clusters.ClosureDimension.server.commands.SetTarget(mock_device, 11, 25 * 100)
})
end
)

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.

Let's add a test for this without reverse polarity.

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.

I see that this has not been taken care of. I think a test or two should be added in a follow-up PR for closures @hongye-samsung. Thanks

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The test for setShadeLevel without reverse polarity already exists (line 485-498 in test_matter_closure.lua). If you feel that test is not sufficient, we can add more in a follow-up PR.

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.

Ah, I see. Apologies, I think there was a miscommunication. I think we need some unit tests for stepShadeLevel for closures.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

we will add it in a follow-up PR.

Comment thread drivers/SmartThings/matter-window-covering/src/init.lua Outdated
Signed-off-by: Hong Ye/MDE Lab /SRC-Nanjing/Staff Engineer/Samsung Electronics <hong.ye@samsung.com>
@hongye-samsung

Copy link
Copy Markdown
Contributor Author

We've fixed the issue and re-pushed the code. Please approve the check workflow.

@hcarter-775 hcarter-775 left a comment

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.

LGTM.

@hcarter-775

Copy link
Copy Markdown
Contributor

There are 2 failing tests here, un-related to this PR. I cannot rebase this PR over the outside fix, so I will merge this as-is, as the fix will be applied in the main branch.

@hcarter-775
hcarter-775 merged commit bf4fd79 into SmartThingsCommunity:main Jul 22, 2026
14 of 21 checks passed
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.

6 participants