Skip to content

Commit

Permalink
Fix add link "compatible item" logic
Browse files Browse the repository at this point in the history
The checks on which item types are allowed to be linked introduced with
#1106 & #1043 have a serious issue that prevents the items of the actual
type of the channel to be linked individually.

Fixes #1204.
Fixes openhab/openhab-core#2568.

Signed-off-by: Yannick Schaus <github@schaus.net>
  • Loading branch information
ghys committed Dec 15, 2021
1 parent c5c912f commit 376b193
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,8 @@ export default {
getCompatibleItemTypes () {
let compatibleItemTypes = []
if (this.channel.itemType) {
this.channel.itemType.split(':', 1)
compatibleItemTypes.push(this.channel.itemType)
if (this.channel.itemType.indexOf('Number:') === 0) { compatibleItemTypes.push('Number') }
if (this.channel.itemType === 'Color') { compatibleItemTypes.push('Switch', 'Dimmer') }
if (this.channel.itemType === 'Dimmer') { compatibleItemTypes.push('Switch') }
}
Expand Down

0 comments on commit 376b193

Please sign in to comment.