Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Electrical power measurement to energy management app (#31616)
* Hoist shared enums and bitmaps into detail namespace * Regenerate * Add electrical measurement clusters * Add NumberOfMeasurements attribute * Bump to latest spec * Bump ZAP version * Remove Electrical Measurement cluster * Add initial Electrical Power Measurement cluster implementation * Revert "Remove Electrical Measurement cluster" This reverts commit 47f5298. * Fix incorrect min/max values on energy attributes * Formatting electrical-power-measurement-server * Regen after restoring deprecated electrical measurement cluster * Re-add inexplicably important blank line to zap_execution.py * De-alphabetize list of files to avoid breaking GH action * Semi-realphabetize? * Added EPM cluster to Energy Management App * Restore strangely dropped events * Better BitMask handling * Change min/max on electrical measurements to be decimal instead of hex * Rename meas-and-sense to measurement-and-sensing.xml * Remove seemingly superfluous attribute requirements on Descriptor cluster on Electrical Measurement * Updates to electrical-power-measurement-server based on comments * Take all-clusters-zap from upstream-master. * Added side=server into electrical-power and electrical-energy clusters XML so events can be enabled in ZAP * Updated all-clusters.zap and reran autogen. Added EPM cluster to energy-management-app.zap * Added initial version of EPM delegate and instance to energy-management-app * Enabled Electrical Energy Measurement in example-energy-management-app ZAP and regen all. * Added ElectricalEnergyMeasurement to chip-repl __init__.py * Restyled by isort * Changed feature map to indicate CUME and IMP support only * Adding into __all__ some missing clusters which are causing flake8 issues. * Removed out of date comment * Added a test event trigger to fake energy reporting readings into the EEM cluster (hooks ready for EPM cluster) * Added new Energy Reporting TE Trigger delegate * Updated random calculation and scaled into mWh (divide by 3600) * Restyled by whitespace * Restyled by gn * Removed accidental launch.json inclusion * Fix for ARM linux etc builds due to gn dependency check error * Added code review suggestions. * More code review suggestions fixed. * Hoist shared enums and bitmaps into detail namespace * Regenerate * Add electrical measurement clusters * Add NumberOfMeasurements attribute * Bump to latest spec * Bump ZAP version * Remove Electrical Measurement cluster * Add initial Electrical Power Measurement cluster implementation * Revert "Remove Electrical Measurement cluster" This reverts commit 47f5298. * Fix incorrect min/max values on energy attributes * Formatting electrical-power-measurement-server * Regen after restoring deprecated electrical measurement cluster * Re-add inexplicably important blank line to zap_execution.py * De-alphabetize list of files to avoid breaking GH action * Semi-realphabetize? * Restore strangely dropped events * Better BitMask handling * Change min/max on electrical measurements to be decimal instead of hex * Rename meas-and-sense to measurement-and-sensing.xml * Remove seemingly superfluous attribute requirements on Descriptor cluster on Electrical Measurement * Updates to electrical-power-measurement-server based on comments * Remove defaults from MeasurementAccuracyRangeStruct to match spec update * Restore side="server" to events * Move common enums and bitmaps to detail:: instead of detail::Enums and detail::Bitmaps; remove superfluous using statement * Assign ID to Electrical Sensor device type * Removed EPM and EEM from Root Node Device * Restyled formatting is different than clang-format * Re-add FeatureMap to attributeAccessInterfaceAttributes for EEM and EPM * Regen after merge * Added electrical-energy-measurement-server to CMakelist to fix linker issue. * Lock client on Electrical Sensor device type * Remove unneeded using statement now that Enums are in detail:: * Check for null iterators and error * Switch to ResourceExhausted from CHIP_ERROR_INTERNAL * Re-enabled EEM in energy management app and regen all after previous merge * Some refactoring to add EPM Instance into the EVSEManufacturer class to clean up containment. Added ability to fake voltage, power and current to the TE triggers. * Missed one file. * Fixed crash due to unassigned dg pointer. Power/Voltage/Current faking working too. * Touch file since restyled crashed * Restyled by gn * Restyled by isort * Add stub for EPM cluster * Reverted whitespace change * Did regen_all after merge from master to resolve conflicts. * Put back line of clusters which somehow got deleted accidentally. * Remerged ZAP file and regen all after resolving conflicts. * Fixes for Python tests * Correct name for Ember init callback * Formatting * Sync optional attributes list with .zap file for EPM * Add missing features to EPM stub * Revert FeatureMap in attributeAccessInterfaceAttributes * Allow FeatureMap in EEM constructor; add all-clusters-app EEM stub * Forgot zcl-with-test-extensions * Unregister EEM attribute access in destructor * Remove redundant returns to keep clang-tidy happy * Fix for issue mentioned in code review on EEM cluster limiting the number of endpoints it allows. * Refactoring to have a common EvseMain across all platforms to avoid making changes in multiple places * Added electrical-power-measurement-server to ESP32 CMakeLists.txt * Updated Matter device types to add EVSE * Open and saved energy-management-app.zap and regen_all * Removed duplicate ElectricalEnergyMeasurment class which was accidentally merged in. Fixed issue raised about ElectricalEnergyMeasurement array size not working on bridges. * Added support for test event triggers and handling of reading events into matter_testing_support. * Made TC_EEVSE_Utils.py use the matter_testing_support instead of its own local copy. * Restyled by isort * Cherry pick from Tweaks to EVSE Test plans (Issue #31460) * Changed the random value generation to make the values +/- and handle sign conversion to avoid compile warnings * Enabled cumulativeEnergyExported in Energy-management-app. * Added initial electrical power measurement 2.2 test case * Changed copyright date * Code review comment fixes. * Changed to c++ style cast * Fixed trailing whitepace * Added support for testing read of EEM attributes and change of values * Corrected EPM references in TC_EEM_2_2. Added TC_EEM_2_3 * Added periodic energy reporting, and new cumulativeEnergyReset attribute into energy-management-app.zap * Added periodic energy reading support and TC_EEM_2_3 to 2_5. * Python removed unused logging and EventChangeCallback * Updates to align to test plan PR #3949 * Added initial EEM_2_1 test script. * Added example of setting EEM Accuracy and EEM CumulativeEnergyReset structure - TC_EEM_2_1 now passes * Restyled by whitespace * Restyled * Removed extra spaces in TC_EEM_2_1.py * Removed unused EnergyManagementManager.cpp/.h * Fixed PowerMode = kAc * Initial TC_EPM_2_1.py script * Restyled by isort * Merged TC_EEVSE tests back in * Initialized NumberOfMeasurementTypes * Added EEM 2.1,2.2,2.3,2.4,2.5 and EPM 2.1,2.2 into CI workflow tests.yaml * Interim state - partially refactored how Measurement Structs are encoded similar to how ModeBase clusters are implemented. Needs tidy up. Will break all-clusters for now * Removed SetNumberOfMeasurementTypes since this can be derived from the ArraySize(kMeasurementAccuracies). Added more stringent checking in test script of measurementTypes and ranges. * Completed TC_EPM_2_1.py script * Corrected test plan spec reference. * Test EPM_2_1 now runs and passes. Allows checking that attributes are supported, and skips test if not. Validation of values ignores Nulls (which are allowed). Turned on Ranges attribute. * Revert unintended change to tests.yaml * Python test case code-review updates * Removed old range iterator. * Fixed lint issues and adjusted timings to match the test plan pr. * Fixed all-clusters electrical-power-measurement cluster by using the energy-management-app/common Delegate * Implemented HarmonicCurrents and HarmonicStructs (to return empty list for now) * Changed the API to ensure that a delegate doesn't change the data mid-way through a read, so the cluster server signals with a StartxxxRead and EndxxxRead call * Applying suggested changes * Incorporated feedback from review to simplify the code * Removed comment per code review --------- Co-authored-by: Hasty Granbery <[email protected]> Co-authored-by: Restyled.io <[email protected]>
- Loading branch information