openhab / openhab-vscode

VS Code extension for openHAB configuration files
https://marketplace.visualstudio.com/items?itemName=openhab.openhab
Eclipse Public License 2.0
159 stars 47 forks source link

QuantityType parsing #255

Open mstormi opened 3 years ago

mstormi commented 3 years ago

I came across the fact that VSC does not parse UoM QuantityTypes well, a line like var t = new QuantityType<DateTime>("1 h") works to compile but VSC does not like the "DateTime".

PS: on a sidenote, it should be "Time" rather than "DateTime" according to UoM docs but that rules DSL does not like... strange but possibly a DSL bug.

BigGeorgeTx commented 2 years ago

I encountered an issue related to this, discussed in the Community https://community.openhab.org/t/add-uom-to-rules-calculated-variable-solved/126290. Rule runs OK, but VSC gave this warning: "Bounds mismatch: The type argument is not a valid substitute for the bounded type parameter <T extends Quantity> of the constructor QuantityType(String) "