Skip to content

Commit

Permalink
Add link: add semantic tags from channel/channel type
Browse files Browse the repository at this point in the history
Fixes openhab#1130.

Signed-off-by: Yannick Schaus <[email protected]>
  • Loading branch information
ghys committed Dec 15, 2021
1 parent c5c912f commit a1bd96b
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -196,13 +196,14 @@ export default {
let newItemName = diacritic.clean(this.thing.label).replace(/[^0-9a-z]/gi, '')
newItemName += '_'
newItemName += (this.channel.label) ? diacritic.clean(this.channel.label).replace(/[^0-9a-z]/gi, '') : diacritic.clean(this.channelType.label).replace(/[^0-9a-z]/gi, '')
const defaultTags = (this.channel.defaultTags.length > 0) ? this.channel.defaultTags : this.channelType.tags
this.$set(this, 'newItem', {
name: newItemName,
label: this.channel.label || this.channelType.label,
category: (this.channelType) ? this.channelType.category : '',
groupNames: [],
type: this.channel.itemType || 'Switch',
tags: ['Point']
tags: (defaultTags.find((t) => SemanticClasses.Points.indexOf(t) >= 0)) ? defaultTags : [...defaultTags, 'Point']
})
},
loadProfileTypes (channel) {
Expand Down

0 comments on commit a1bd96b

Please sign in to comment.