I found the reason why the shift is happening. We have a maximum number of cycles in the storage. So if we already have the maximum number of cycles stored, then when adding a new one, one is deleted. If we return everything after this, then one of the cycles has already been deleted, so new average values are recalculated. And since the average values have changed, the forecast has changed.
I solved this problem like this.
I increased the maximum number of stored cycles to 8.
Now the average is calculated only from those cycles that are displayed in the application (6 of them). Therefore, 2 more will be spare, we do not take them into account in the calculations, but they are stored for these cases as in these bug.
I also found another bug. My peri.json file has more than 7 cycles stored, I fixed it. I didn't before slice the cycles that we send to storage.
Closed #258
I found the reason why the shift is happening. We have a maximum number of cycles in the storage. So if we already have the maximum number of cycles stored, then when adding a new one, one is deleted. If we return everything after this, then one of the cycles has already been deleted, so new average values are recalculated. And since the average values have changed, the forecast has changed.
I solved this problem like this.
I also found another bug. My
peri.json
file has more than 7 cycles stored, I fixed it. I didn't before slice the cycles that we send to storage.