MCPcopy Create free account
hub / github.com/UtilitechAS/amsreader-firmware / setMonthAccuracy

Method setMonthAccuracy

lib/AmsDataStorage/src/AmsDataStorage.cpp:621–631  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

619}
620
621void AmsDataStorage::setMonthAccuracy(uint8_t accuracy) {
622 if(month.accuracy != accuracy) {
623 double multiplier = pow(10, month.accuracy)/pow(10, accuracy);
624 for(uint8_t i = 0; i < 31; i++) {
625 month.dImport[i] = month.dImport[i] * multiplier;
626 month.dExport[i] = month.dExport[i] * multiplier;
627 }
628 month.accuracy = accuracy;
629 }
630 month.accuracy = accuracy;
631}
632
633bool AmsDataStorage::isHappy(time_t now) {
634 return isDayHappy(now) && isMonthHappy(now);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected