Skip to content

Commit

Permalink
Add panel for voiceSystem metadata (#2222)
Browse files Browse the repository at this point in the history
Refs openhab/openhab-core#3925,
openhab/openhab-core#3897 and
openhab/openhab-core#3853.

---------

Signed-off-by: Miguel Álvarez <miguelwork92@gmail.com>
  • Loading branch information
GiviMAD authored Dec 17, 2023
1 parent 20a313f commit d52296a
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export default [
{ name: 'widgetOrder', label: 'Default Widget Order Index' },
{ name: 'autoupdate', label: 'Auto-update' },
{ name: 'expire', label: 'Expiration Timer' },
{ name: 'voiceSystem', label: 'Voice System' },
{ name: 'alexa', label: 'Amazon Alexa' },
{ name: 'homekit', label: 'Apple HomeKit' },
{ name: 'ga', label: 'Google Assistant' }
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<template>
<div>
<f7-list>
<f7-list-input ref="input" type="textarea" :floating-label="$theme.md" :label="'Custom Rules'" name="custom-rules"
:value="customRules" @input="updateValue" />
<f7-block-footer class="param-description" slot="after-list">
<small>Enter each rule on a separate line. Available placeholders: $name$, $cmd$ and $*$</small>
</f7-block-footer>
</f7-list>
<config-sheet :parameterGroups="[]" :parameters="ruleOptionParameters" :configuration="metadata.config" />
</div>
</template>

<script>
import ConfigSheet from '@/components/config/config-sheet.vue'
export default {
props: ['itemName', 'metadata', 'namespace'],
components: {
ConfigSheet
},
data: () => {
return {
ruleOptionParameters: [
{ type: 'BOOLEAN', name: 'isForced', label: 'Is Forced', description: 'Send command without check current Item state' },
{ type: 'BOOLEAN', name: 'isSilent', label: 'Is Silent', description: 'Disable success confirmation message' },
{ type: 'BOOLEAN', name: 'isTemplate', label: 'Is Template', description: 'Target similar Items instead of the current one' }
]
}
},
computed: {
customRules () {
if (!this.metadata.value) return []
return this.metadata.value.split('\n').map((s) => s.trim()).join('\n')
}
},
methods: {
updateValue (ev) {
this.metadata.value = ev.target.value.split('\n').map((s) => s.trim()).join('\n')
}
}
}
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ import ItemMetadataExpire from '@/components/item/metadata/item-metadata-expire.
import ItemMetadataAlexa from '@/components/item/metadata/item-metadata-alexa.vue'
import ItemMetadataHomeKit from '@/components/item/metadata/item-metadata-homekit.vue'
import ItemMetadataGa from '@/components/item/metadata/item-metadata-ga.vue'
import ItemMetadataVoiceSystem from '@/components/item/metadata/item-metadata-voicesystem.vue'
import DirtyMixin from '../../dirty-mixin'
export default {
Expand Down Expand Up @@ -128,6 +129,8 @@ export default {
return ItemMetadataAlexa
case 'homekit':
return ItemMetadataHomeKit
case 'voiceSystem':
return ItemMetadataVoiceSystem
case 'ga':
return ItemMetadataGa
default:
Expand Down

0 comments on commit d52296a

Please sign in to comment.