Skip to content

Commit

Permalink
[blockly] Fix event block code generation (openhab#2587)
Browse files Browse the repository at this point in the history
Fixes openhab#2586.

Moves the bracket to the correct position.

Signed-off-by: Christian Kittel <[email protected]>
  • Loading branch information
EvilPingu authored May 26, 2024
1 parent fabafbf commit 21b669e
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ export default function defineOHBlocks_Scripts (f7, isGraalJs, scripts) {
if (type === 'asNumber') {
return [`event.${contextInfo} !== undefined ? parseFloat(event.${contextInfo}.toString()) : undefined`, javascriptGenerator.ORDER_ATOMIC]
} else if (type === 'asQuantity') {
return [`event.${contextInfo} !== undefined ? Quantity(event.${contextInfo}.toString() : undefined)`, javascriptGenerator.ORDER_ATOMIC]
return [`event.${contextInfo} !== undefined ? Quantity(event.${contextInfo}.toString()) : undefined`, javascriptGenerator.ORDER_ATOMIC]
} else {
return [`event.${contextInfo}?.toString()`, javascriptGenerator.ORDER_ATOMIC]
}
Expand Down

0 comments on commit 21b669e

Please sign in to comment.