Skip to content

armgit / core

Public Imported from GitHub
0

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

Added POWER_FORECAST to ElectricityProducerAsset Added WIND_SPEED_MAX to ElectricityProducerWindAsset

Michael Rademakerebd5f3f0a020
diff --git a/model/src/main/java/org/openremote/model/asset/impl/ElectricityProducerAsset.java b/model/src/main/java/org/openremote/model/asset/impl/ElectricityProducerAsset.java
index 9501f3d6a..99fddd1d1 100644
--- a/model/src/main/java/org/openremote/model/asset/impl/ElectricityProducerAsset.java
+++ b/model/src/main/java/org/openremote/model/asset/impl/ElectricityProducerAsset.java
@@ -21,9 +21,12 @@ package org.openremote.model.asset.impl;
import org.openremote.model.asset.AssetDescriptor;
import org.openremote.model.value.AttributeDescriptor;
+import org.openremote.model.value.ValueType;
import javax.persistence.Entity;
+import static org.openremote.model.Constants.*;
+
@Entity
public class ElectricityProducerAsset extends ElectricityAsset<ElectricityProducerAsset> {
@@ -38,6 +41,9 @@ public class ElectricityProducerAsset extends ElectricityAsset<ElectricityProduc
public static final AttributeDescriptor<Double> TARIFF_EXPORT = ElectricitySupplierAsset.TARIFF_EXPORT.withOptional(true);
public static final AttributeDescriptor<Double> CARBON_IMPORT = ElectricitySupplierAsset.CARBON_IMPORT.withOptional(true);
+ public static final AttributeDescriptor<Double> POWER_FORECAST = new AttributeDescriptor<>("powerForecast", ValueType.NUMBER
+ ).withUnits(UNITS_KILO, UNITS_WATT);
+
public static final AssetDescriptor<ElectricityProducerAsset> DESCRIPTOR = new AssetDescriptor<>("flash", "EABB4D", ElectricityProducerAsset.class);
/**
diff --git a/model/src/main/java/org/openremote/model/asset/impl/ElectricityProducerSolarAsset.java b/model/src/main/java/org/openremote/model/asset/impl/ElectricityProducerSolarAsset.java
index 68b50018a..caa5a6956 100644
--- a/model/src/main/java/org/openremote/model/asset/impl/ElectricityProducerSolarAsset.java
+++ b/model/src/main/java/org/openremote/model/asset/impl/ElectricityProducerSolarAsset.java
@@ -50,6 +50,8 @@ public class ElectricityProducerSolarAsset extends ElectricityProducerAsset {
public static final AttributeDescriptor<Integer> PANEL_PITCH = new AttributeDescriptor<>("panelPitch", ValueType.POSITIVE_INTEGER
).withUnits(UNITS_DEGREE);
+ public static final AttributeDescriptor<Double> POWER_FORECAST = ElectricityProducerAsset.POWER_FORECAST.withOptional(true);
+
public static final AssetDescriptor<ElectricityProducerSolarAsset> DESCRIPTOR = new AssetDescriptor<>("white-balance-sunny", "EABB4D", ElectricityProducerSolarAsset.class);
/**
diff --git a/model/src/main/java/org/openremote/model/asset/impl/ElectricityProducerWindAsset.java b/model/src/main/java/org/openremote/model/asset/impl/ElectricityProducerWindAsset.java
index 0970660ec..3e0a8c247 100644
--- a/model/src/main/java/org/openremote/model/asset/impl/ElectricityProducerWindAsset.java
+++ b/model/src/main/java/org/openremote/model/asset/impl/ElectricityProducerWindAsset.java
@@ -40,6 +40,10 @@ public class ElectricityProducerWindAsset extends ElectricityProducerAsset {
).withUnits(UNITS_METRE, UNITS_PER, UNITS_SECOND);
public static final AttributeDescriptor<Double> WIND_SPEED_MIN = new AttributeDescriptor<>("windSpeedMin", ValueType.POSITIVE_NUMBER
).withUnits(UNITS_METRE, UNITS_PER, UNITS_SECOND);
+ public static final AttributeDescriptor<Double> WIND_SPEED_MAX = new AttributeDescriptor<>("windSpeedMax", ValueType.POSITIVE_NUMBER
+ ).withUnits(UNITS_METRE, UNITS_PER, UNITS_SECOND);
+
+ public static final AttributeDescriptor<Double> POWER_FORECAST = ElectricityProducerAsset.POWER_FORECAST.withOptional(true);
public static final AssetDescriptor<ElectricityProducerWindAsset> DESCRIPTOR = new AssetDescriptor<>("wind-turbine", "4B87EA", ElectricityProducerWindAsset.class);
@@ -222,4 +226,19 @@ public class ElectricityProducerWindAsset extends ElectricityProducerAsset {
super.setModel(model);
return this;
}
+
+ public ElectricityProducerWindAsset setWindSpeedMin(double value) {
+ getAttributes().getOrCreate(WIND_SPEED_MIN).setValue(value);
+ return this;
+ }
+
+ public ElectricityProducerWindAsset setWindSpeedMax(double value) {
+ getAttributes().getOrCreate(WIND_SPEED_MAX).setValue(value);
+ return this;
+ }
+
+ public ElectricityProducerWindAsset setWindSpeedReference(double value) {
+ getAttributes().getOrCreate(WIND_SPEED_REFERENCE).setValue(value);
+ return this;
+ }
}