[persistence] Fix varianceSince and deviationSince (#2036)
Signed-off-by: Mark Hilbush <mark@hilbush.com>pull/2180/head
parent
1cadfcfb9f
commit
321c443aa3
|
@ -397,6 +397,7 @@ public class PersistenceExtensions {
|
|||
BigDecimal average = averageSince.toBigDecimal(), sum = BigDecimal.ZERO;
|
||||
int count = 0;
|
||||
|
||||
it = result.iterator();
|
||||
while (it.hasNext()) {
|
||||
HistoricItem historicItem = it.next();
|
||||
DecimalType value = historicItem.getState().as(DecimalType.class);
|
||||
|
|
|
@ -236,6 +236,7 @@ public class PersistenceExtensionsTest {
|
|||
assertEquals(OnOffType.ON, historicItem.getState());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testVarianceSince() {
|
||||
numberItem.setState(new DecimalType(3025));
|
||||
|
||||
|
@ -262,6 +263,7 @@ public class PersistenceExtensionsTest {
|
|||
assertNull(variance);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDeviationSince() {
|
||||
numberItem.setState(new DecimalType(3025));
|
||||
|
||||
|
|
Loading…
Reference in New Issue