Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new asset type for heat meters #1

Open
wants to merge 1 commit into
base: development
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
package org.openremote.model.asset.impl;

import jakarta.persistence.Entity;
import org.openremote.model.Constants;
import org.openremote.model.asset.Asset;
import org.openremote.model.asset.AssetDescriptor;
import org.openremote.model.attribute.MetaItem;
import org.openremote.model.value.AttributeDescriptor;
import org.openremote.model.value.MetaItemType;
import org.openremote.model.value.ValueFormat;
import org.openremote.model.value.ValueType;

import static org.openremote.model.Constants.*;

@Entity
public class HeatMeterAsset extends Asset<HeatMeterAsset> {

public static final AttributeDescriptor<String> METER_POINT_ADMINISTRATION_NUMBER = new AttributeDescriptor<>("meterPointAdministrationNumber", ValueType.TEXT,
new MetaItem<>(MetaItemType.LABEL, "Meter Point Administration Number"),
new MetaItem<>(MetaItemType.READ_ONLY));

public static final AttributeDescriptor<Double> HEAT_METER_READING = new AttributeDescriptor<>("heatMeterReading", ValueType.NUMBER,
new MetaItem<>(MetaItemType.LABEL, "Heat Meter Reading"),
new MetaItem<>(MetaItemType.READ_ONLY),
new MetaItem<>(MetaItemType.UNITS, Constants.units(UNITS_KILO, UNITS_WATT, UNITS_HOUR)))
.withFormat(ValueFormat.NUMBER_3_DP_MAX());

public static final AttributeDescriptor<Double> FLOW_TEMPERATURE = new AttributeDescriptor<>("flowTemperature", ValueType.NUMBER,
new MetaItem<>(MetaItemType.LABEL, "Flow Temperature"),
new MetaItem<>(MetaItemType.UNITS, Constants.units(UNITS_CELSIUS)),
new MetaItem<>(MetaItemType.READ_ONLY))
.withFormat(ValueFormat.NUMBER_3_DP_MAX());

public static final AttributeDescriptor<Double> RETURN_TEMPERATURE = new AttributeDescriptor<>("returnTemperature", ValueType.NUMBER,
new MetaItem<>(MetaItemType.LABEL, "Return Temperature"),
new MetaItem<>(MetaItemType.UNITS, Constants.units(UNITS_CELSIUS)),
new MetaItem<>(MetaItemType.READ_ONLY))
.withFormat(ValueFormat.NUMBER_3_DP_MAX());

public static final AttributeDescriptor<Double> POWER = new AttributeDescriptor<>("power", ValueType.NUMBER,
new MetaItem<>(MetaItemType.LABEL, "Power"),
new MetaItem<>(MetaItemType.UNITS, Constants.units(UNITS_WATT)),
new MetaItem<>(MetaItemType.READ_ONLY))
.withFormat(ValueFormat.NUMBER_3_DP_MAX());

public static final AttributeDescriptor<Double> VOLUME_FLOW = new AttributeDescriptor<>("volumeFlow", ValueType.NUMBER,
new MetaItem<>(MetaItemType.LABEL, "Volume Flow"),
new MetaItem<>(MetaItemType.UNITS, Constants.units(UNITS_LITRE, UNITS_PER, UNITS_HOUR)),
new MetaItem<>(MetaItemType.READ_ONLY))
.withFormat(ValueFormat.NUMBER_3_DP_MAX());

public static final AssetDescriptor<HeatMeterAsset> DESCRIPTOR = new AssetDescriptor<>("counter", "8A293D", HeatMeterAsset.class);

/**
* For use by hydrators (i.e. JPA/Jackson)
*/
protected HeatMeterAsset() {
}

public HeatMeterAsset(String name) {
super(name);
}
}