Skip to content

Commit bde2e81

Browse files
authored
Only skip due to fluctuation if total cycles>=10, to let initial data collection pass
1 parent 0d2cf7b commit bde2e81

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

apps/smartbatt/module.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@
6464
let currentDrainage = battChange / deltaHours;
6565
let drainageChange=data.avgBattDrainage-currentDrainage;
6666
//check if drainage rate has fluctuated quite a bit
67-
68-
if(Math.abs(drainageChange)>currentDrainage*0.7&&data.fluctuationEvent==0){
67+
//If fluctuation event is 0, first time fluctuating like this, cycles > 10 so as not to interfere with initial data collection.
68+
if(Math.abs(drainageChange)>currentDrainage*0.7&&data.fluctuationEvent==0&&data.totalCycles>=10){
6969
//has fluctuated, first time doing so
7070
reason="Skipped: Extreme fluctuation";
7171
//set fluctuationevent so it knows what was the first time.

0 commit comments

Comments
 (0)