Skip to content

Commit

Permalink
[items] Convert Item channel link configuration to JS object
Browse files Browse the repository at this point in the history
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
  • Loading branch information
florian-h05 committed Dec 29, 2022
1 parent 468bcab commit 5c098d5
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions items/metadata/itemchannellink.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/

const osgi = require('../../osgi');
const utils = require('../../utils');
const log = require('../../log')('itemchannellink');

const ItemChannelLink = Java.type('org.openhab.core.thing.link.ItemChannelLink');
Expand Down Expand Up @@ -47,7 +48,7 @@ const getItemChannelLink = function (itemName, channelUID) {
return {
itemName: itemChannelLink.getItemName().toString(),
channelUID: itemChannelLink.getLinkedUID().toString(),
configuration: itemChannelLink.getConfiguration()
configuration: utils.javaMapToJsObj(itemChannelLink.getConfiguration())
};
};

Expand All @@ -67,7 +68,7 @@ const _addItemChannelLink = function (itemName, channelUID, conf) {
return {
itemName: itemChannelLink.getItemName().toString(),
channelUID: itemChannelLink.getLinkedUID().toString(),
configuration: itemChannelLink.getConfiguration()
configuration: utils.javaMapToJsObj(itemChannelLink.getConfiguration())
};
};

Expand All @@ -88,7 +89,7 @@ const _updateItemChannelLink = function (itemName, channelUID, conf) {
return {
itemName: itemChannelLink.getItemName().toString(),
channelUID: itemChannelLink.getLinkedUID().toString(),
configuration: itemChannelLink.getConfiguration()
configuration: utils.javaMapToJsObj(itemChannelLink.getConfiguration())
};
};

Expand Down Expand Up @@ -127,7 +128,7 @@ const removeItemChannelLink = function (itemName, channelUID) {
return {
itemName: itemChannelLink.getItemName().toString(),
channelUID: itemChannelLink.getLinkedUID().toString(),
configuration: itemChannelLink.getConfiguration()
configuration: utils.javaMapToJsObj(itemChannelLink.getConfiguration())
};
};

Expand Down

0 comments on commit 5c098d5

Please sign in to comment.