Thing Actions, QuantityTypes, and rules (DSL and nextgen)

Let’s say my binding defines a thing action that takes QuantityType<Temperature> as its arguments. For example:

setHold(QuantityType<Temperature> coolSetPoint, QuantityType<Temperature> heatSetPoint)

In a rule, when I try to define a variable as a QuantityType, LSP flags Temperature as an error because its type is unknown. I suppose this is because javax.measure.quantity.Temperature is not injected into the rules engine. And, since I can’t import javax.measure.quantity.Temperature in my rule, I see no way to resolve the error.

qantitytype
Also, when saving the rule, it complains in the log file.

The method setHold(ThingActions, QuantityType<Object>, QuantityType<Object>) from the type EcobeeActions refers to the missing type Object

Despite all of this, the call to setHold seems to work. :smiley:

I’m assuming the issue won’t be fixed in the DSL rules engine, as that rule engine will be deprecated in OH3.

@5iver Do you know how the above will behave in NGRE?

The old rule engine will be removed completely. What we do with the rules DSL is TBD, but it would be best to remove it too (along with LSP).

QuantityType is in the default script scope in scripted automation, so this should work fine.