100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps
Java asset-managementbuildingdashboarddataplatformdevice-managementedge-computingenergyenergy-managementenergy-monitorfleet-managementfleet-telematicsiotiot-applicationiot-platformmodbusmqttmqtt-brokerota-updaterules-enginesmartcity
Use ThingsAsset in Agent to check for configurationAttributes. (#1507)
Michael Rademaker6814df2fc6a4
diff --git a/model/src/main/java/org/openremote/model/asset/agent/Agent.java b/model/src/main/java/org/openremote/model/asset/agent/Agent.javaindex 304251436..9fa930caa 100644--- a/model/src/main/java/org/openremote/model/asset/agent/Agent.java+++ b/model/src/main/java/org/openremote/model/asset/agent/Agent.java@@ -20,6 +20,7 @@package org.openremote.model.asset.agent;import org.openremote.model.asset.Asset;+import org.openremote.model.asset.impl.ThingAsset;import org.openremote.model.attribute.MetaItem;import org.openremote.model.auth.OAuthGrant;import org.openremote.model.auth.UsernamePassword;@@ -272,15 +273,14 @@ public abstract class Agent<T extends Agent<T, U, V>, U extends Protocol<T>, V e* {@link Agent#STATUS}. Agent's can override this behaviour as required.*/public boolean isConfigurationAttribute(String attributeName) {-// This is an event for an agent so is it for an attribute that has a descriptor which is defined in an agent class// and it's not the status attribute (or we'll end up in a loop)return !attributeName.equals(Agent.STATUS.getName())&& ValueUtil.getAssetInfo(getType()).map(info -> info.getAttributeDescriptors().containsKey(attributeName)).orElse(false)- // Exclude attributes that have a descriptor from the base Asset class- && ValueUtil.getAssetInfo(Asset.class)+ // Exclude attributes that have a descriptor from the base ThingAsset class+ && ValueUtil.getAssetInfo(ThingAsset.class).map(typeInfo -> !typeInfo.getAttributeDescriptors().containsKey(attributeName)).orElse(false);}