-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Thermostat Cluster Init Function Enabled #12863
Thermostat Cluster Init Function Enabled #12863
Conversation
PR #12863: Size comparison from 55b7aba to 38d3567 Increases above 0.2%:
Increases (5 builds for esp32, linux, mbed, p6)
Decreases (2 builds for mbed, p6)
Full report (32 builds for efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
|
5a5aa51
to
d1f98d3
Compare
PR #12863: Size comparison from de0af9a to d1f98d3 Increases (4 builds for esp32, linux, p6)
Full report (32 builds for efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
|
emberAfThermostatClusterServerInitCallback via helper.js Eliminated #ifdefs FeatureMap new accessors Feature map in functions to allow for more than one thermostat endpoint within a device.
d1f98d3
to
3188509
Compare
PR #12863: Size comparison from d3322e3 to 3188509 Increases (5 builds for esp32, linux, mbed, p6)
Full report (32 builds for efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
|
Fast tracking given this has been in review for > 3 days. |
|
||
if (FeatureMap & 1 << 5) // Bit 5 is Auto Mode supported | ||
{ | ||
if (OurFeatureMap & 1 << 5) // Bit 5 is Auto Mode supported |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should have constants for these. Would be much easier to read:
constexpr uint16_t kFeatureMap_AutoModeBit = 1 << 5;
// ....
const bool AutoSupported = (OurFeatureMap & kFeatureMap_AutoModeBit) != 0;
CoolSupported = true; | ||
|
||
if (FeatureMap & 1 << 2) | ||
OccupancySupported = true; | ||
if (OurFeatureMap & 1 << 2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previous code I could read "OccupancySupported = true;" to figure out what this bit 2 is.
new code is totally opaque. At least a comment should be here or ideally constants that are readable.
Problem:
emberAfThermostatClusterServerInitCallback was not enabled in the helper.js file for code gen.
FeatureMap usage involves Conditional compiles and repeated code
Changes:
Enabled Init for thermostat
Eliminated #ifndefs
Used Feature Map accessor function now available in SDK, in place of deprecated read.
Tested:
Manual testing with thermostat-app (Linux) and chip-tool