Class PersistenceThresholdFilter
java.lang.Object
org.openhab.core.persistence.filter.PersistenceFilter
org.openhab.core.persistence.filter.PersistenceThresholdFilter
The
PersistenceThresholdFilter is a filter to prevent persistence based on a threshold.
The filter returns false if the new value deviates by less than value. If unit is "%" is
true, the filter returns false if the relative deviation is less than value.- Author:
- Jan N. Klug - Initial contribution
-
Constructor Summary
ConstructorsConstructorDescriptionPersistenceThresholdFilter(String name, BigDecimal value, @Nullable String unit, @Nullable Boolean relative) -
Method Summary
Methods inherited from class org.openhab.core.persistence.filter.PersistenceFilter
equals, getName, hashCode
-
Constructor Details
-
PersistenceThresholdFilter
public PersistenceThresholdFilter(String name, BigDecimal value, @Nullable String unit, @Nullable Boolean relative)
-
-
Method Details
-
getValue
-
getUnit
-
isRelative
public boolean isRelative() -
apply
Description copied from class:PersistenceFilterApply this filter to an item- Specified by:
applyin classPersistenceFilter- Parameters:
item- the item to check- Returns:
- true if the filter allows persisting this value
-
persisted
Description copied from class:PersistenceFilterNotify filter that item was persisted- Specified by:
persistedin classPersistenceFilter- Parameters:
item- the persisted item
-
toString
- Overrides:
toStringin classPersistenceFilter
-