SmartThingsEdgeDrivers icon indicating copy to clipboard operation
SmartThingsEdgeDrivers copied to clipboard

Matter-Window-Covering: Fix refresh bug

Open nickolas-deboom opened this issue 1 year ago • 7 comments

When the device card for a window covering device is refreshed, the shade level displays as 0%. This is due to the CurrentLevel attribute, which is not a required cluster for the window covering device type, overwriting the windowShadeLevel capability after it is set by CurrentPositionLiftPercent100ths. This change removes the CurrentLevel attribute from the matter-window-covering driver.

These changes were tested using the VDA Window Covering virtual device by verifying that all capabilities display correctly, all commands function correctly, and that upon a refresh the shadeLevel is not reset back to 0%.

MTR-715

nickolas-deboom avatar Jun 18 '24 20:06 nickolas-deboom

Channel deleted.

github-actions[bot] avatar Jun 18 '24 20:06 github-actions[bot]

Test Results

   64 files  ±0    396 suites  ±0   0s :stopwatch: ±0s 1 937 tests  - 1  1 937 :white_check_mark:  - 1  0 :zzz: ±0  0 :x: ±0  3 361 runs   - 1  3 361 :white_check_mark:  - 1  0 :zzz: ±0  0 :x: ±0 

Results for commit 333380cd. ± Comparison against base commit 534b87c7.

This pull request removes 1 test.
LevelControl CurrentLevel handler

:recycle: This comment has been updated with latest results.

github-actions[bot] avatar Jun 18 '24 20:06 github-actions[bot]

File Coverage
All files 95% :white_check_mark:
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-window-covering/src/init.lua 95% :white_check_mark:

Minimum allowed coverage is 90%

Generated by :monkey: cobertura-action against 333380cdcf4daefc3f2869fb96ee013173a6a35b

github-actions[bot] avatar Jun 18 '24 20:06 github-actions[bot]

What testing have you done to make sure that things are still working correctly?

hcarter-775 avatar Jun 19 '24 16:06 hcarter-775

What testing have you done to make sure that things are still working correctly?

Hey Harrison, I realized that I never responded to your comment, but I updated the description of this PR with some info on how this was tested!

nickolas-deboom avatar Jul 18 '24 15:07 nickolas-deboom

This changes makes sense to me, as the WindowCovering device type does not specify a requirement for the LevelControl cluster, and the CurrentPositionLiftPercent100ths attribute should be used to handle the window "level" setting. So I think this change makes sense.

However, did this originate just from VDA testing or do you know if this has been seen on devices? I just want to make sure this is safe to remove and no devices are actually using levelControl. Based on a quick git blame, it looks like the LevelControl cluster handler has been in the driver since it was originally released, so it seems to me it is just an artifact of an early implementation of the driver/device type that is no longer needed.

ctowns avatar Aug 19 '24 21:08 ctowns

This changes makes sense to me, as the WindowCovering device type does not specify a requirement for the LevelControl cluster, and the CurrentPositionLiftPercent100ths attribute should be used to handle the window "level" setting. So I think this change makes sense.

However, did this originate just from VDA testing or do you know if this has been seen on devices? I just want to make sure this is safe to remove and no devices are actually using levelControl. Based on a quick git blame, it looks like the LevelControl cluster handler has been in the driver since it was originally released, so it seems to me it is just an artifact of an early implementation of the driver/device type that is no longer needed.

This originated from the VDA, which sends the CurrentLevel attribute, always with a value of 0. This would override the value of CurrentPositionLiftPercent100ths after a refresh. This has only been tested with the VDA - do you know of anyone with a physical window covering device that we could test this with? (The one I have is an Eve device but it doesn't work)

nickolas-deboom avatar Aug 26 '24 16:08 nickolas-deboom

After some consideration, this PR will be closed in favor of updating the VDA Window Covering device type to not send the CurrentLevel attribute. Implementing this driver change would be a risk because there is a possibility that there is a device out there that uses this attribute. Unless we see a report of a real device with this issue, we shouldn't make this driver change.

nickolas-deboom avatar Oct 15 '24 19:10 nickolas-deboom