From 6c56798c1a4ba2e4b8d362d072fb5785210a68d3 Mon Sep 17 00:00:00 2001 From: Christoph Weitkamp Date: Sun, 30 May 2021 10:41:57 +0200 Subject: [PATCH] Improvements for multimedia badges Signed-off-by: Christoph Weitkamp --- .../components/cards/glance/location/status-badge.vue | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/bundles/org.openhab.ui/web/src/components/cards/glance/location/status-badge.vue b/bundles/org.openhab.ui/web/src/components/cards/glance/location/status-badge.vue index 47ffbec1a0..3933923083 100644 --- a/bundles/org.openhab.ui/web/src/components/cards/glance/location/status-badge.vue +++ b/bundles/org.openhab.ui/web/src/components/cards/glance/location/status-badge.vue @@ -152,7 +152,8 @@ export default { case 'speakers': equipment = [ ...findEquipment(this.element.equipment, 'Equipment_Receiver', false), - ...findEquipment(this.element.equipment, 'Equipment_Speaker', false) + ...findEquipment(this.element.equipment, 'Equipment_Speaker', false), + ...findEquipment(this.element.equipment, 'Equipment_VoiceAssistant', false) ] if (!equipment.length) return [] allPoints = allEquipmentPoints(equipment) @@ -189,10 +190,14 @@ export default { return this.map.filter((state) => expr.eval(ast, { state: state, Number: Number })).length } switch (this.type) { - case 'lights': - return this.map.filter((state) => state === 'ON' || (state.split(',').length === 3 && state.split(',')[2] !== '0') || (state.indexOf(',') < 0 && Number.parseInt(state) > 0)).length case 'blinds': return this.map.filter((state) => state === 'OPEN' || state === 'ON' || Number.parseInt(state) === 0).length + case 'lights': + return this.map.filter((state) => state === 'ON' || (state.split(',').length === 3 && state.split(',')[2] !== '0') || (state.indexOf(',') < 0 && Number.parseInt(state) > 0)).length + case 'projectors': + case 'screens': + case 'speakers': + return this.map.filter((state) => state === 'ON' || state === 'PLAY' || state === 'FASTFORWARD' || state === 'REWIND').length default: return this.map.filter((state) => state === 'ON' || state === 'OPEN').length }