diff --git a/libraries/MTConnect.NET-Common/Agents/MTConnectAgent.cs b/libraries/MTConnect.NET-Common/Agents/MTConnectAgent.cs index 9aca869a..7907ffa2 100644 --- a/libraries/MTConnect.NET-Common/Agents/MTConnectAgent.cs +++ b/libraries/MTConnect.NET-Common/Agents/MTConnectAgent.cs @@ -753,11 +753,11 @@ protected bool UpdateCurrentCondition(string deviceUuid, IDataItem dataItem, IOb { existingHash = StringFunctions.ToMD5HashBytes(existingObservations.Select(o => o.ChangeId).ToArray()); - var conditionLevel = observation.GetValue(ValueKeys.Level); + var conditionLevelValue = observation.GetValue(ValueKeys.Level); + var conditionLevel = conditionLevelValue.ConvertEnum(); var nativeCode = observation.GetValue(ValueKeys.NativeCode); - if (!(conditionLevel == ConditionLevel.NORMAL.ToString() && string.IsNullOrEmpty(nativeCode)) && - conditionLevel != ConditionLevel.UNAVAILABLE.ToString()) + if (!(conditionLevel == ConditionLevel.NORMAL && string.IsNullOrEmpty(nativeCode)) && conditionLevel != ConditionLevel.UNAVAILABLE) { var i = 0; foreach (var existingObservation in existingObservations)