Skip to content

Matter Window Covering: Update shade status via latest shade level when movement halts#3132

Open
hcarter-775 wants to merge 1 commit into
mainfrom
bugfix/handle-0-operational-state
Open

Matter Window Covering: Update shade status via latest shade level when movement halts#3132
hcarter-775 wants to merge 1 commit into
mainfrom
bugfix/handle-0-operational-state

Conversation

@hcarter-775

Copy link
Copy Markdown
Contributor

Description of Change

If an operational status of 0 is received (not moving), we should emit an event setting the windowShadeLevel operational status (open, closed, etc). This is to ensure that a final status is handled in the case that a device sends any kind of "movement" operational status after the last current position is sent.

This is a follow-up to this PR that also attempts to resolve: #3043, without adding a timer to the handling. This timer is less ideal, since responsiveness is slow by definition of the timer with little value (as there is another route), reads do fail at times, and read timers adds extra time state to keep in mind, which can complicate the handlers.

Tag-along updates:

Several fields are not needed, so I have removed them to add greater clarity to the updated handling.

  • CURRENT_LIFT/CURRENT_TILT are fields that store some latest attribute states during runtime. A field is not required for this.
  • REVERSE_POLARITY stored the state of device.preferences.reverse, which is already stored in the data model. Therefore this is not needed. As it is persisted, it needs to be made nil to remove.
  • PRESET_LEVEL_KEY is only ever used (get_field) when the capability state is nil, and is therefore nil in that context as well. So we don't need this.

In info_changed, we should not try to update the device profile on any non-profile update, as the inventories can be synced for many reasons. In fact, the only case this would be required for is a software update, so I have altered the logic to explicitly check for that- this has been validated with identical handling in Matter Switch, and a unit test has been updated to validate this as well.

Summary of Completed Tests

Unit tests updated.

@hcarter-775
hcarter-775 force-pushed the bugfix/handle-0-operational-state branch from 59036d0 to e364737 Compare July 17, 2026 20:05
@github-actions

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown

File Coverage
All files 85%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-window-covering/src/sub_drivers/closure/init.lua 78%
/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/closure_handlers/capability_handlers.lua 73%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-window-covering/src/init.lua 91%
/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/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_utils/embedded_cluster_utils.lua 43%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-window-covering/src/sub_drivers/closure/closure_utils/utils.lua 91%

Minimum allowed coverage is 90%

Generated by 🐒 cobertura-action against e364737

@github-actions

Copy link
Copy Markdown

Test Results

   73 files    536 suites   0s ⏱️
3 191 tests 3 191 ✅ 0 💤 0 ❌
5 180 runs  5 180 ✅ 0 💤 0 ❌

Results for commit e364737.

@hcarter-775 hcarter-775 changed the title Directly use latest shade level state if not running Matter Window Covering: Update shade status with shade level when movement halts Jul 17, 2026
@hcarter-775 hcarter-775 changed the title Matter Window Covering: Update shade status with shade level when movement halts Matter Window Covering: Update shade status via latest shade level when movement halts Jul 17, 2026
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.

Matter Window Covering: final open/closed state may not be resolved when OperationalStatus returns to 0

1 participant