SmartThingsCommunity / SmartThingsEdgeDrivers

Apache License 2.0
268 stars 452 forks source link

Prevent multiple reads of MinSetpointDeadBand #1686

Closed nickolas-deboom closed 2 weeks ago

nickolas-deboom commented 2 weeks ago

Type of Change

Checklist

Description of Change

CHAD-14135

The driver currently attempts to only read MinSetpointDeadBand once during the first time device_init is called, but the MIN_SETPOINT_DEADBAND_CHECKED field is not persisted, so the read request is sent during each device init. This is contributing to a spike in InteractionQueueFull exceptions. This change ensures that the field is persisted so that the read request is only sent once.

Summary of Completed Tests

Added unit test to verify that the MIN_SETPOINT_DEADBAND_CHECKED flag is set after the MinSetpointDeadBand attribute is received to ensure that this value is only read one time.

Tested with a VDA bridge consisting of 20 thermostats and 20 color temperature lights to ensure that no regressions were introduced. Note that the issue is still present when dealing with a large number of bridged devices because the queue can still reach capacity even with this change. This is meant to help alleviate the issue rather than provide a full solution, which would require optimizations to the read request logic in the firmware.

github-actions[bot] commented 2 weeks ago

Channel deleted.

github-actions[bot] commented 2 weeks ago

Test Results

   64 files    396 suites   0s :stopwatch: 1 938 tests 1 938 :white_check_mark: 0 :zzz: 0 :x: 3 362 runs  3 362 :white_check_mark: 0 :zzz: 0 :x:

Results for commit 4a756889.

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

github-actions[bot] commented 2 weeks ago

File Coverage
All files 82% :x:
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-thermostat/src/embedded-cluster-utils.lua 42% :x:
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-thermostat/src/init.lua 85% :x:

Minimum allowed coverage is 90%

Generated by :monkey: cobertura-action against 4a75688963782aa151a8df644b4904dcfa619d84