Fix broker historic manager

This commit is contained in:
2019-04-29 21:04:26 +02:00
parent b225953dbe
commit d932207db0

View File

@@ -57,20 +57,23 @@ namespace PlantBox.Broker
if (_minutesHistoric.Count % 12 == 0)
{
_hoursHistoric.Add(new CaptorsValue(GetAverage(_minutesHistoric.TakeFromEnd(12))));
}
if (_hoursHistoric.Count % 24 == 0)
{
_daysHistoric.Add(new CaptorsValue(GetAverage(_hoursHistoric.TakeFromEnd(24))));
}
if (_daysHistoric.Count % 7 == 0)
{
_weeksHistoric.Add(new CaptorsValue(GetAverage(_daysHistoric.TakeFromEnd(7))));
}
if (_daysHistoric.Count % 31 == 0)
{
_monthsHistoric.Add(new CaptorsValue(GetAverage(_daysHistoric.TakeFromEnd(31))));
}
}
}
}
}
public void Clear()
{