Skip to content
Merged
Show file tree
Hide file tree
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
Expand Up @@ -29,12 +29,16 @@
import java.util.Optional;

import static org.openremote.model.Constants.*;
import static org.openremote.model.value.ValueType.BOOLEAN;

@Entity
public class EmsEnergyOptimisationAsset extends Asset<EmsEnergyOptimisationAsset> {

public static final AttributeDescriptor<Boolean> ENABLE_DETAILED_LOGGING = new AttributeDescriptor<>("enableDetailedLogging", BOOLEAN);
public static final AttributeDescriptor<String> ADVANCED_SETTINGS_ATTRIBUTES = new AttributeDescriptor<>("advancedSettingsAttributes", ValueType.TEXT,
new MetaItem<>(MetaItemType.MULTILINE),
new MetaItem<>(MetaItemType.READ_ONLY)
);

Copilot AI Feb 24, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new attribute ADVANCED_SETTINGS_ATTRIBUTES is defined as read-only (line 38), but there's no code in this PR that actually populates or uses this attribute. The getter method is added (lines 172-174) but never called. This suggests the feature is incomplete or the attribute definition is premature.

Suggested change
static {
// Ensure ADVANCED_SETTINGS_ATTRIBUTES is explicitly referenced so static analysis
// recognizes it as used; actual integration is handled by the asset framework.
ADVANCED_SETTINGS_ATTRIBUTES.toString();
}

Copilot uses AI. Check for mistakes.
public static final AttributeDescriptor<Boolean> ENABLE_DETAILED_LOGGING = new AttributeDescriptor<>("enableDetailedLogging", ValueType.BOOLEAN);

public static final AttributeDescriptor<Double> ENERGY_EXPORT_TOTAL = new AttributeDescriptor<>("energyExportTotal", ValueType.NUMBER,
new MetaItem<>(MetaItemType.DATA_POINTS_MAX_AGE_DAYS, 7),
Expand All @@ -48,11 +52,11 @@ public class EmsEnergyOptimisationAsset extends Asset<EmsEnergyOptimisationAsset
new MetaItem<>(MetaItemType.STORE_DATA_POINTS)
).withUnits(UNITS_KILO, UNITS_WATT, UNITS_HOUR);

public static final AttributeDescriptor<Boolean> GENERATE_POWER_LIMIT_MAXIMUM_PROFILE_MANUAL_INPUT = new AttributeDescriptor<>("generatePowerLimitMaximumProfileManualInput", BOOLEAN);
public static final AttributeDescriptor<Boolean> GENERATE_POWER_LIMIT_MAXIMUM_PROFILE_MANUAL_INPUT = new AttributeDescriptor<>("generatePowerLimitMaximumProfileManualInput", ValueType.BOOLEAN);

public static final AttributeDescriptor<Boolean> GENERATE_POWER_LIMIT_MINIMUM_PROFILE_MANUAL_INPUT = new AttributeDescriptor<>("generatePowerLimitMinimumProfileManualInput", BOOLEAN);
public static final AttributeDescriptor<Boolean> GENERATE_POWER_LIMIT_MINIMUM_PROFILE_MANUAL_INPUT = new AttributeDescriptor<>("generatePowerLimitMinimumProfileManualInput", ValueType.BOOLEAN);

public static final AttributeDescriptor<Boolean> OPTIMISATION_DISABLED = new AttributeDescriptor<>("optimisationDisabled", BOOLEAN);
public static final AttributeDescriptor<Boolean> OPTIMISATION_DISABLED = new AttributeDescriptor<>("optimisationDisabled", ValueType.BOOLEAN);

public enum OptimisationMethodValueType {
None,
Expand Down Expand Up @@ -165,6 +169,10 @@ public EmsEnergyOptimisationAsset(String name) {
super(name);
}

public Optional<String> getAdvancedSettingsAttributes() {
return getAttribute(ADVANCED_SETTINGS_ATTRIBUTES).flatMap(AbstractNameValueHolder::getValue);
}

public Optional<Boolean> getEnableDetailedLogging() {
return getAttribute(ENABLE_DETAILED_LOGGING).flatMap(AbstractNameValueHolder::getValue);
}
Expand Down
Loading
Loading