I am thinking about testing out OpenHab 2, but I wanted to check all my rules for errors under the new framework first. So I setup the latest Eclipse SmartHome Designer and viewed all of my rules. There are a few errors in particular that I want to ask about. I have not tested any of my rules in the new runtime yet. I am just asking about the errors found in the Designer.
The first error has to deal with creating a State variable. In my old rule I referred to “org.openhab.core.types.State” but I updated the class to the new location “org.eclipse.smarthome.core.types.State”. However, the line:
var State state = null
Yields the warning:
Access restriction: The type State is not accessible due to restriction on required project config
The next error has to do with using lambdas. For the statement:
val report = Battery.allMembers.filter([state instanceof DecimalType]).sortBy([state]).map[
name + “: " + state.format(”%d%%“)
].join(”\n")
I get the error:
Bounds mismatch: The type arguments <Item, State> are not a valid
substitute for the bounded type parameters <T, C extends Comparable<?
super C>> of the method sortBy(Iterable, Function1<? super
T, C>)
The final error I see is when I use sendMail:
sendMail(“xxxx@gmail.com”, “Dryer finished!”, message)
Error:
The method sendMail(String, String, String) is undefined
Any help with any of these errors would be great. Thanks!