Include support for a bad wind support mode mapping
Description of Change
There are some devices that claim to support the Wind feature, but whose WindSupport attribute is empty. This update will force a read of that attribute before profiling can occur in the case that the Wind feature is supported to ensure that at least one value is specified. If no value is specified, wind support is not included in the resulting profile.
There are a few paths this logic can follow, so here is the reasoning for each path:
do_configureruns first -> checks if battery is supported- if
battery is supported-> we read the PowerSource AttributeList. a. Inattribute_list_handler->match_profileruns with the specified battery type b. Inmatch_profile-> if the wind feature is not supported, a profile is chosen. c. Else -> the battery type specified is saved. we read FanControl WindSupport.match_profilereturns early- In
wind_support_handler-> we count the supported modes. a capability event is emitted.match_profileruns again. - In
match_profile-> a profile is chosen.
- In
- if
battery is not supported->match_profileruns directly fromdo_configure. a. Seeb. c. i. and ii.above for the following logic.
Re-formation of the previous PR 1577
Summary of Completed Tests
- Unit tests written to match the failing case, and previous tests were re-written to handle the new profiling system.
- Tested on-device with an empty WindSupport attribute, and it correctly profiled not to include it
Channel deleted.
Test Results
64 files ± 0 410 suites +1 0s ⏱️ ±0s 2 068 tests +36 2 051 ✅ +19 0 💤 ±0 14 ❌ +14 3 🔥 +3 3 547 runs +36 3 529 ✅ +18 0 💤 ±0 15 ❌ +15 3 🔥 +3
For more details on these failures and errors, see this check.
Results for commit e47e16f8. ± Comparison against base commit 78c235c4.
:recycle: This comment has been updated with latest results.
| File | Coverage | |
|---|---|---|
| All files | 72% |
:x: |
| /home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-thermostat/src/init.lua | 74% |
:x: |
| /home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-thermostat/src/embedded-cluster-utils.lua | 42% |
:x: |
Minimum allowed coverage is 90%
Generated by :monkey: cobertura-action against e47e16f810cd7e7d42b0e609853be463c40d9b30
These changes look pretty straightforward. I was trying to trace through the logic for the following sequence, does this look right to you? I think this matches scenario (2) you provided in the PR description
match_profilewill be called for the first time from eitherdo_configureor the power source attribute list handler, withWIND_MODE_COUNTnil for the first time- A read for
WindSupportis sent wind_support_handlerruns, sets theWIND_MODE_COUNTfield, and callsmatch_profilefor the second time- This time the
WIND_MODE_COUNTfield is populated, somatch_profileproceeds past the wind support stuff this time create_fan_profileis called, and now theWIND_MODE_COUNTfield is populated so it will update the profile name to include wind support if needed.
Will not fix: Closing this ticket