From 6047ecd55d17dc36912ca0531dec21057f82cf17 Mon Sep 17 00:00:00 2001 From: Jimmy Tanagra Date: Sun, 22 Dec 2024 09:56:54 +1000 Subject: [PATCH] Fix profile selection when linking a channel to an item Signed-off-by: Jimmy Tanagra --- .../web/src/pages/settings/things/link/link-add.vue | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/bundles/org.openhab.ui/web/src/pages/settings/things/link/link-add.vue b/bundles/org.openhab.ui/web/src/pages/settings/things/link/link-add.vue index c19e523509..4326ca1129 100644 --- a/bundles/org.openhab.ui/web/src/pages/settings/things/link/link-add.vue +++ b/bundles/org.openhab.ui/web/src/pages/settings/things/link/link-add.vue @@ -182,9 +182,12 @@ export default { }, compatibleProfileTypes () { let currentItemType = this.currentItem && this.currentItem.type ? this.currentItem.type : '' - return this.profileTypes - .filter(p => !p.supportedItemTypes.length || p.supportedItemTypes.includes(currentItemType.split(':', 1)[0])) - .filter(p => this.isNumberChannelButNoNumberItem && (p.uid !== 'system:default' && p.uid !== 'system:follow')) + + if (this.isNumberChannelButNoNumberItem) { + return this.profileTypes.filter(p => p.uid !== 'system:default' && p.uid !== 'system:follow') + } + + return this.profileTypes.filter(p => !p.supportedItemTypes.length || p.supportedItemTypes.includes(currentItemType.split(':', 1)[0])) }, isNumberChannelButNoNumberItem () { if (!this.channel || !this.channel.itemType) return false