Closed SergeyGulik closed 2 years ago
Yes, it looks like you are correct that two consecutive Conditions were not being read correctly and it looks like the commit you added will fix this.
It looks like the Condition Levels read from XML are being added to the internal Values list as PascalCase (ex. Fault, Warning, Normal) but when they are read using the Conditions property in the DeviceStream/ComponentStream they are converted to the Enum which is uppercase. In this scenario, reading as a ConditionObservation, you get uppercase but reading as the abstract Observation using the Values property, you get Pascal Case. The below should fix this issue:
public ConditionLevel Level
{
get => GetValue(ValueKeys.Level).ConvertEnum<ConditionLevel>();
set => AddValue(ValueKeys.Level, value.ToString());
}
I also noticed some issues with the timestamps when looking at the Test you added. It looks like timestamps were being read from XML as Local time instead of UTC. The below code should fix this:
I will merge the commit you added as well as add the changes I listed here and create a new Release and update the Nuget package.
Hi Patrick, Found a problem with two consecutive conditions arriving as part of the stream document. Only the first was successfully parsed. Conditions as I see them now are by default empty nodes and thus no content parsing should be done. Could please pay attention to the test I've added? There is a value override that seems strange for me, maybe it is an earlier introduced bug.