From b30c794160e7bad9533afcd08911a6d45fd98278 Mon Sep 17 00:00:00 2001 From: Florian Hotze Date: Fri, 22 Dec 2023 23:28:28 +0100 Subject: [PATCH] [items] Fix posting/commanding Item with `undefined` An error was thrown when undefined was sent to an Item, due to missing handling of it. Signed-off-by: Florian Hotze --- items/items.js | 1 + 1 file changed, 1 insertion(+) diff --git a/items/items.js b/items/items.js index 41ff33fb..2ace8f19 100644 --- a/items/items.js +++ b/items/items.js @@ -63,6 +63,7 @@ const DYNAMIC_ITEM_TAG = '_DYNAMIC_'; */ function _toOpenhabString (value) { if (value === null) return 'NULL'; + if (value === undefined) return 'UNDEF'; if (typeof value === 'number' || typeof value === 'string') { return value; } else if (typeof value.toOpenHabString === 'function') {