| 658 | } |
| 659 | |
| 660 | bool AmsDataStorage::isMonthHappy(time_t now) { |
| 661 | if(tz == NULL) { |
| 662 | return false; |
| 663 | } |
| 664 | |
| 665 | if(now < FirmwareVersion::BuildEpoch) return false; |
| 666 | |
| 667 | if(now < month.lastMeterReadTime) { |
| 668 | return false; |
| 669 | } |
| 670 | |
| 671 | // 25 hours, because of DST |
| 672 | if(now-month.lastMeterReadTime > 90000) { |
| 673 | return false; |
| 674 | } |
| 675 | |
| 676 | tmElements_t tm, last; |
| 677 | breakTime(tz->toLocal(now), tm); |
| 678 | breakTime(tz->toLocal(month.lastMeterReadTime), last); |
| 679 | if(tm.Day != last.Day) { |
| 680 | return false; |
| 681 | } |
| 682 | |
| 683 | return true; |
| 684 | } |
| 685 | |
| 686 | double AmsDataStorage::getEstimatedImportCounter() { |
| 687 | if(day.lastMeterReadTime == 0) return 0; |
nothing calls this directly
no outgoing calls
no test coverage detected