Matter Switch: Use Total Wh for PCR if delta < 0.0#2993
Conversation
|
Invitation URL: |
Test Results 72 files 511 suites 0s ⏱️ Results for commit cfdc32f. |
|
Minimum allowed coverage is Generated by 🐒 cobertura-action against cfdc32f |
I thought the purpose was to avoid losing ST energy data for the interval (e.g. 15 minutes) when a reset happens. Emitting the total Wh when assuming a reset happened prevents losing the part of the energy post-reset. However, the part before the reset in that interval would be lost. Maybe the pre-reset part can be restored so the energy reportings for ST Energy are completely reset-proof. Would need to store the maximum energy received in a field and, when the reset is detected, calculate the delta before the reset and add it to the total Wh so the delta of that interval is accurate. Matter does not have standard commands to reset the meter anyway so probably not worth it complicating it at the moment. |
Description of Change
Use total Wh instead of a negative value for the delta of the powerConsumptionReport. This should only ever be negative in the case that the device has had its energy meter reset, so we should avoid spiking the energy report for ST energy in a case like this.
Summary of Completed Tests
Unit tests updated.