I get the following ‘problems’ in vscode and I wonder how to fix the warning messages (code runs ok).
val findSetpoint= [ GenericItem s |
val parts = s.name.split("_")
val setpoint_name = String.format("%s_%s_SetPoint", parts.get(0), parts.get(1))
Evo_SetPoint.members.findFirst[name.equals(setpoint_name)] as NumberItem
]
rule "SomeRule"
when
....
then
....
var setpoint = findSetpoint.apply(setpoint_status)
....
end
I tried to do the following, but Item is not a type. Do I need to import something?
I can, of course, cast to a GenericItem, but that feels like a workaround.
Depends on the item type you pass as the argument (setpoint_status). Either cast that to GenericItem when calling or use a specific item type such as Number, String or whatever it is.