Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

Minor EnergyOptimisationAsset model update

Rich Turnere8d2166e7123
diff --git a/model/src/main/java/org/openremote/model/asset/impl/EnergyOptimisationAsset.java b/model/src/main/java/org/openremote/model/asset/impl/EnergyOptimisationAsset.java
index eadf16e45..cfa4a8895 100644
--- a/model/src/main/java/org/openremote/model/asset/impl/EnergyOptimisationAsset.java
+++ b/model/src/main/java/org/openremote/model/asset/impl/EnergyOptimisationAsset.java
@@ -21,6 +21,7 @@ package org.openremote.model.asset.impl;
import org.openremote.model.asset.Asset;
import org.openremote.model.asset.AssetDescriptor;
+import org.openremote.model.attribute.MetaItem;
import org.openremote.model.value.*;
import javax.persistence.Entity;
@@ -28,6 +29,7 @@ import javax.persistence.Entity;
import java.util.Optional;
import static org.openremote.model.Constants.UNITS_PERCENTAGE;
+import static org.openremote.model.value.MetaItemType.READ_ONLY;
import static org.openremote.model.value.ValueType.BOOLEAN;
import static org.openremote.model.value.ValueType.POSITIVE_NUMBER;
@@ -35,10 +37,9 @@ import static org.openremote.model.value.ValueType.POSITIVE_NUMBER;
public class EnergyOptimisationAsset extends Asset<EnergyOptimisationAsset> {
public static final AttributeDescriptor<Integer> FINANCIAL_WEIGHTING = new AttributeDescriptor<>("financialWeighting", ValueType.POSITIVE_INTEGER)
- .withUnits(UNITS_PERCENTAGE).withConstraints(new ValueConstraint.Min(0), new ValueConstraint.Max(100))
- .withOptional(false);
+ .withUnits(UNITS_PERCENTAGE).withConstraints(new ValueConstraint.Min(0), new ValueConstraint.Max(100));
public static final AttributeDescriptor<Double> INTERVAL_SIZE = new AttributeDescriptor<>("intervalSize", POSITIVE_NUMBER);
- public static final AttributeDescriptor<Boolean> OPTIMISATION_DISABLED = new AttributeDescriptor<>("optimisationDisabled", BOOLEAN);
+ public static final AttributeDescriptor<Boolean> OPTIMISATION_DISABLED = new AttributeDescriptor<>("optimisationDisabled", BOOLEAN, new MetaItem<>(READ_ONLY));
public static final AssetDescriptor<EnergyOptimisationAsset> DESCRIPTOR = new AssetDescriptor<>("flash", "C4DB0D", EnergyOptimisationAsset.class);