Skip to content

Commit

Permalink
Merge branch 'development' into feature/spring.version
Browse files Browse the repository at this point in the history
  • Loading branch information
kroesctrl committed Jan 22, 2024
2 parents ea9499e + 730961c commit 5c0f70e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,30 @@
import java.util.List;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;

@Getter
@NoArgsConstructor
@Slf4j
public class ConfigLookupGroup {
protected String name;
protected String defaulttype;
protected List<ConfigLookupType> configlookuptypes;

public String getMatchingType(final String deviceModel) {
String matchingType = this.defaulttype;

String lastMatchingType = null;
for (final ConfigLookupType configLookupType : this.configlookuptypes) {
if (configLookupType.matches(deviceModel)) {
matchingType = configLookupType.type;
lastMatchingType = configLookupType.type;
}
}
if (lastMatchingType != null) {
return lastMatchingType;
}

return matchingType;
log.warn(
"Could not determine matching type for device model: {}. This model should be added to the configuration, to prevent inefficient communication with meter",
deviceModel);
return this.defaulttype;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -371,10 +371,11 @@ protected CosemObject handleValueBasedOnModel(
originalAttribute.copyWithNewValueAndType(value, ValueType.FIXED_IN_METER);
return cosemObject.copyWithNewAttribute(newAttribute);
} else {
// If no value was found for this device model, then set the value to Dynamic and log a
// warning. The command executor should get the value from the meter.
log.warn(
"Could not find value for devicemodel {} for {}",
// If no value was found for this device model, then set the value to Dynamic and log the
// message
// The command executor should get the value from the meter.
log.info(
"Could not find value for devicemodel {} for {}, set the value to Dynamic and get the value from the meter",
deviceModel,
originalAttribute.getValuebasedonmodel().getType());
final Attribute newAttribute =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,19 @@
]
},
{
"type": "unknown gas meter type",
"type": "value in meter is not like in specification",
"match": [
"elster-instromet",
"flonidan-gasmeter",
"G4SRT 1.2L"
]
}, {
"type": "unknown gas meter type",
"match": [
"elster-instromet",
"flonidan-gasmeter"
]
}
],
"defaulttype": "unknown gas meter type"
"defaulttype": "gas meter type could not be determined"
},
{
"name": "INSTANTANEOUS_VOLTAGE_DSMR4",
Expand Down

0 comments on commit 5c0f70e

Please sign in to comment.