diff --git a/bundles/org.openhab.ui/doc/components/index.md b/bundles/org.openhab.ui/doc/components/index.md index ac84314c61..eb173f1646 100644 --- a/bundles/org.openhab.ui/doc/components/index.md +++ b/bundles/org.openhab.ui/doc/components/index.md @@ -143,7 +143,7 @@ source: https://github.com/openhab/openhab-webui/edit/main/bundles/org.openhab.u | Component | Name | Description | |--------|------|-------------| | [`oh-location-card`](./oh-location-card.html) | [Location Card](./oh-location-card.html) | A card showing model items in a certain location | -| [`oh-equipment-card`](./oh-equipment-card.html) | [Equipment Class Card](./oh-equipment-card.html) | A card showing model items belonging to a certain equipment class | +| [`oh-equipment-card`](./oh-equipment-card.html) | [Equipment Card](./oh-equipment-card.html) | A card showing model items belonging to a certain equipment class | | [`oh-property-card`](./oh-property-card.html) | [Property Card](./oh-property-card.html) | A card showing model items related to a certain property | diff --git a/bundles/org.openhab.ui/doc/components/oh-equipment-card.md b/bundles/org.openhab.ui/doc/components/oh-equipment-card.md index 3063ba2cb6..37ee92abd2 100644 --- a/bundles/org.openhab.ui/doc/components/oh-equipment-card.md +++ b/bundles/org.openhab.ui/doc/components/oh-equipment-card.md @@ -29,6 +29,13 @@ A card showing model items belonging to a certain equipment class
General settings for this card + + + Equipment class to display + + + + Title of the card diff --git a/bundles/org.openhab.ui/doc/components/oh-location-card.md b/bundles/org.openhab.ui/doc/components/oh-location-card.md index 72ca005f05..6216fb5f2b 100644 --- a/bundles/org.openhab.ui/doc/components/oh-location-card.md +++ b/bundles/org.openhab.ui/doc/components/oh-location-card.md @@ -29,6 +29,11 @@ A card showing model items in a certain location
General settings for this card + + + Location to display + + Title of the card diff --git a/bundles/org.openhab.ui/doc/components/oh-property-card.md b/bundles/org.openhab.ui/doc/components/oh-property-card.md index c9793b9c6b..3e98c1d200 100644 --- a/bundles/org.openhab.ui/doc/components/oh-property-card.md +++ b/bundles/org.openhab.ui/doc/components/oh-property-card.md @@ -29,6 +29,13 @@ A card showing model items related to a certain property
General settings for this card + + + Property to display + + + + Title of the card diff --git a/bundles/org.openhab.ui/web/src/assets/definitions/widgets/home/index.js b/bundles/org.openhab.ui/web/src/assets/definitions/widgets/home/index.js index 04acc23ac4..45fba56a7c 100644 --- a/bundles/org.openhab.ui/web/src/assets/definitions/widgets/home/index.js +++ b/bundles/org.openhab.ui/web/src/assets/definitions/widgets/home/index.js @@ -96,7 +96,7 @@ const ModelCardParameters = () => [ ] export const OhLocationCardParameters = () => new WidgetDefinition('oh-location-card', 'Location Card', 'A card showing model items in a certain location') - .paramGroup(ModelCardParameterGroup(), ModelCardParameters()) + .paramGroup(ModelCardParameterGroup(), [pi('item', 'Item', 'Location to display')].concat(ModelCardParameters())) .paramGroup(pg('glance', 'Card at-a-glance badges'), [ pb('disableBadges', 'Disable badges', 'Do not examine items to display badges - can help with performance if you don\'t need them.'), pt('badges', 'Enabled badges', 'Select the badges you wish to show in the header of the card. Display all if none are selected.') @@ -120,8 +120,14 @@ export const OhLocationCardParameters = () => new WidgetDefinition('oh-location- ], true, true) ]) -export const OhEquipmentCardParameters = () => new WidgetDefinition('oh-equipment-card', 'Equipment Class Card', 'A card showing model items belonging to a certain equipment class') - .paramGroup(ModelCardParameterGroup(), ModelCardParameters()) +export const OhEquipmentCardParameters = () => new WidgetDefinition('oh-equipment-card', 'Equipment Card', 'A card showing model items belonging to a certain equipment class') + .paramGroup(ModelCardParameterGroup(), [ + pt('item', 'Item', 'Equipment class to display') + .o([]) // inject semantic equipment tags at runtime + ].concat(ModelCardParameters())) export const OhPropertyCardParameters = () => new WidgetDefinition('oh-property-card', 'Property Card', 'A card showing model items related to a certain property') - .paramGroup(ModelCardParameterGroup(), ModelCardParameters()) + .paramGroup(ModelCardParameterGroup(), [ + pt('item', 'Item', 'Property to display') + .o([]) // inject semantic property tags at runtime + ].concat(ModelCardParameters())) diff --git a/bundles/org.openhab.ui/web/src/components/app.vue b/bundles/org.openhab.ui/web/src/components/app.vue index 151e7f2891..fcd9751220 100644 --- a/bundles/org.openhab.ui/web/src/components/app.vue +++ b/bundles/org.openhab.ui/web/src/components/app.vue @@ -479,6 +479,7 @@ export default { dayjsLocalePromise = (dayjsLocale) ? import('dayjs/locale/' + dayjsLocale.key + '.js').then(() => Promise.resolve(dayjsLocale)) : Promise.resolve(null) } // load the pages & widgets, only if the 'ui' endpoint exists (or empty arrays otherwise) + // load the semantic tags return Promise.all([ ...this.$store.getters.apiEndpoint('ui') ? [this.$oh.api.get('/rest/ui/components/ui:page'), this.$oh.api.get('/rest/ui/components/ui:widget')] @@ -499,6 +500,9 @@ export default { if (data[2]) dayjs.locale(data[2].key) + // load & build the semantic model + return this.$store.dispatch('loadSemanticModel') + }).then(() => { // finished with loading this.ready = true return Promise.resolve() diff --git a/bundles/org.openhab.ui/web/src/components/cards/equipment-card.vue b/bundles/org.openhab.ui/web/src/components/cards/equipment-card.vue index a405cc8001..9d277338b3 100644 --- a/bundles/org.openhab.ui/web/src/components/cards/equipment-card.vue +++ b/bundles/org.openhab.ui/web/src/components/cards/equipment-card.vue @@ -15,7 +15,7 @@ -