-
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
Part 1: feature/temperature measurement cluster #7026
Conversation
src/app/clusters/temperature-measurement-server/temperature-measurement-server.cpp
Outdated
Show resolved
Hide resolved
src/app/clusters/temperature-measurement-server/temperature-measurement-server.cpp
Outdated
Show resolved
Hide resolved
src/app/clusters/temperature-measurement-server/temperature-measurement-server.cpp
Outdated
Show resolved
Hide resolved
src/app/clusters/temperature-measurement-server/temperature-measurement-server.cpp
Outdated
Show resolved
Hide resolved
src/app/clusters/temperature-measurement-server/temperature-measurement-server.cpp
Outdated
Show resolved
Hide resolved
src/app/clusters/temperature-measurement-server/temperature-measurement-server.cpp
Outdated
Show resolved
Hide resolved
src/app/clusters/temperature-measurement-server/temperature-measurement-server.cpp
Outdated
Show resolved
Hide resolved
src/app/clusters/temperature-measurement-server/temperature-measurement-server.cpp
Outdated
Show resolved
Hide resolved
status = emberAfWriteAttribute(endpointId, ZCL_TEMP_MEASUREMENT_CLUSTER_ID, ZCL_CURRENT_TEMPERATURE_ATTRIBUTE_ID, | ||
CLUSTER_MASK_SERVER, (uint8_t *) &newValue, ZCL_INT16S_ATTRIBUTE_TYPE); | ||
if (status != EMBER_ZCL_STATUS_SUCCESS) | ||
EmberAfStatus status = emberAfWriteAttribute(endpoint, ZCL_TEMP_MEASUREMENT_CLUSTER_ID, ZCL_TEMP_MEASURED_VALUE_ATTRIBUTE_ID, |
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.
Should we check that value is between MinMeasureValue
and MaxMeasuredValue
or 0x8000
(unknown) ?
One way to get this feature without any efforts would be to update the EmberAfAttributeMetadata
of the attribute to points to the value of MinMeasureValue
and MaxMeasureValue
, based on the definition from the XML cluster definition, but I don't think this is supported at the moment.
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.
I think we should leverage the GENERATED_ATTRIBUTES
table which is generated in endpoints_config.h for the default min max values. And also add this checks as part of the general code in the attribute storage?
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.
I think we should leverage the
GENERATED_ATTRIBUTES
table which is generated in endpoints_config.h for the default min max values. And also add this checks as part of the general code in the attribute storage?
I do agree. But at the moment the min/max value from the attribute store only support absolute values, not values relative to others attributes.
src/app/clusters/temperature-measurement-server/temperature-measurement-server.cpp
Outdated
Show resolved
Hide resolved
src/app/clusters/temperature-measurement-server/temperature-measurement-server.cpp
Outdated
Show resolved
Hide resolved
src/app/clusters/temperature-measurement-server/temperature-measurement-server.cpp
Outdated
Show resolved
Hide resolved
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.
Approving for TE3.
Note that I think src/app/clusters/temperature-measurement-server
should be removed completely. It seems like the result of this PR is mostly to expose a set of accessors to facilitate the manipulation of the temperature measurement
cluster attributes.
It makes perfect sense to facilitate it imho, but I would rather prefer to autogenerate helpers code such as what is proposed in #7183, instead of having a lot of new clusters introduced into src/app/clusters
.
var endpointClusterWithInit = | ||
[ 'Basic', 'Identify', 'Groups', 'Scenes', 'Occupancy Sensing', 'On/off', 'Level Control', 'Color Control', 'IAS Zone' ]; | ||
var endpointClusterWithInit = [ | ||
'Basic', 'Temperature Measurement', 'Identify', 'Groups', 'Scenes', 'Occupancy Sensing', 'On/off', 'Level Control', |
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.
No need to add it here if there is not in fact an init callback.
# Conflicts: # src/app/zap-templates/templates/app/helper.js
use correct values when calling - emberAfTemperatureMeasurementClusterSetMaxMeasuredValueCallback - emberAfTemperatureMeasurementClusterSetMinMeasuredValueCallback
The default values are populated by the attribute storage.
Size increase report for "esp32-example-build" from b4d7048
Full report output
|
* format endpointClusterWithInit for easier pull requests * add support for emberAfTemperatureMeasurementClusterServerInitCallback # Conflicts: # src/app/zap-templates/templates/app/helper.js * update temperature-measurement-server impl. * fix temperature-measurement-server.cpp use correct values when calling - emberAfTemperatureMeasurementClusterSetMaxMeasuredValueCallback - emberAfTemperatureMeasurementClusterSetMinMeasuredValueCallback * fix temperature-measurement example app * Restyled by clang-format * apply fixes according to @vivien-apple * remove emberAfTemperatureMeasurementClusterServerInitCallback impl. The default values are populated by the attribute storage. * fix year in copyright * Regenerate generated files * Remove unnecessary init function for Temperature Measurement cluster Co-authored-by: Restyled.io <[email protected]> Co-authored-by: Boris Zbarsky <[email protected]>
Problem
Update the temperature measurement cluster implementation. It still used the old emberAfPlugin API.
Change overview
Testing
Tested on custom accessory with real temperature sensor. Test setup was similar to TE2.
HW Platform
Nordic nRF52840
Notes
Related PRs