Hello together,
to calculate the power of the room heating, I use PWM function. The function is called from heating rule every 10 seconds.
This is working fine. Only one thing is bothering me. OpenHAB prints out this warning message:
Function4 is a raw type. References to generic type Function4<P1, P2, P3, P4, Result> should be parameterized
The function looks like:
val org.eclipse.xtext.xbase.lib.Functions$Function4 calcPMW = [Number SV, Number AV, Number OffSet, Number Faktor|
....code......
var Number Set = .....
return Set
]
How can I define the result value to prevent this warning message.
Thanks for help in advance.
Sebastian
As you can see from my example just define the parameters and the return type in advance
val org.eclipse.xtext.xbase.lib.Functions$Function3<GroupItem, GroupItem, OnOffType, Void> updateDynamicSwitchGroup = [
GroupItem Source,
GroupItem Destination,
OnOffType TriggerState
|
// Remove all items from destination group
Destination?.members.forEach[item | Destination.removeMember(item)]
// Add all items from "Soruce" with state like "TriggerState" to "Destination"
Source?.members.filter(s | s.state == TriggerState).forEach[item | Destination.addMember(item)]
logInfo("rule.lambda.updateDynamicSwitchGroup", "Dynamic Group \"{}\" updated with {} members.", Destination.name, Destination.members.size)
return null
]
In your code the return type shoud not be void, it should be Number.