Hi.
How is this supposed to work. I currently have two “errors”, not sure if those are bugs or mis-use.
First:
var Number CurrentValue = (Bad_temp.state as QuantityType<Temperature>).doubleValue()
shows as Temperature cannot be resolved to a type.
in Visual Studio Code, but works. I assume something is missing in ESH, because QuantityType<Density>
can be resolved.
Second:
if ((Aussen_hum_abs.state instanceof QuantityType<Density>) && (Bad_hum_abs.state instanceof QuantityType<Density>)) {
[...]
}
shows no error in Visual Studio, but the log shows
12:07:25.753 [INFO ] [del.core.internal.ModelRepositoryImpl] - Validation issues found in configuration model 'bad.rules', using it anyway:
Cannot perform instanceof check against parameterized type QuantityType<Density>
Cannot perform instanceof check against parameterized type QuantityType<Density>
If I change to generic type
if ((Aussen_hum_abs.state instanceof QuantityType) && (Bad_hum_abs.state instanceof QuantityType)) {
[...]
}
the log switches to
12:08:53.376 [INFO ] [del.core.internal.ModelRepositoryImpl] - Validation issues found in configuration model 'bad.rules', using it anyway:
QuantityType is a raw type. References to generic type QuantityType<T> should be parameterized
QuantityType is a raw type. References to generic type QuantityType<T> should be parameterized
So what is the correct way to check if that item state is of QuantityType?
Regards,
Jan