From a47835933f3815a3a848f82294d5ea44152812c4 Mon Sep 17 00:00:00 2001 From: stefan-hoehn Date: Mon, 29 May 2023 14:21:02 +0200 Subject: [PATCH] [blockly] Fix UoM variable support (#1911) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes variable support for the blockly unit of measurement blocks which did not work at all -> var defaults to item object. Blockly cannot detect the type that is contained in a variable so we expect an Item object. This allows to iterate over a group of Item members which returns a list of Item objects Signed-off-by: Stefan Höhn --- .../web/src/assets/definitions/blockly/blocks-uom.js | 1 + 1 file changed, 1 insertion(+) diff --git a/bundles/org.openhab.ui/web/src/assets/definitions/blockly/blocks-uom.js b/bundles/org.openhab.ui/web/src/assets/definitions/blockly/blocks-uom.js index d2c596e86c..464cadd7d0 100644 --- a/bundles/org.openhab.ui/web/src/assets/definitions/blockly/blocks-uom.js +++ b/bundles/org.openhab.ui/web/src/assets/definitions/blockly/blocks-uom.js @@ -195,6 +195,7 @@ function generateQuantityCode (block, inputName) { code = `Quantity(${input})` break case 'oh_itemtype': + case '': // vars are expected to contain an item object code = `${input}.quantityState` break case 'oh_item':