Commit 588253daa4375ffce2ea9d62bb9c37c603fc507e
Committed by
GitHub
Merge pull request #4113 from ChantsovaEkaterina/improvement/get-alarm-first-entity-info
Get first entity info: add alarm entity info for single-entity aliases even if no alarms to display
Showing
1 changed file
with
9 additions
and
1 deletions
@@ -467,7 +467,15 @@ export class WidgetSubscription implements IWidgetSubscription { | @@ -467,7 +467,15 @@ export class WidgetSubscription implements IWidgetSubscription { | ||
467 | entityName = this.targetDeviceName; | 467 | entityName = this.targetDeviceName; |
468 | } | 468 | } |
469 | } else if (this.type === widgetType.alarm) { | 469 | } else if (this.type === widgetType.alarm) { |
470 | - if (this.alarms && this.alarms.data.length) { | 470 | + if (this.alarmSource && this.alarmSource.entityType && this.alarmSource.entityId) { |
471 | + entityId = { | ||
472 | + entityType: this.alarmSource.entityType, | ||
473 | + id: this.alarmSource.entityId | ||
474 | + }; | ||
475 | + entityName = this.alarmSource.entityName; | ||
476 | + entityLabel = this.alarmSource.entityLabel; | ||
477 | + entityDescription = this.alarmSource.entityDescription; | ||
478 | + } else if (this.alarms && this.alarms.data.length) { | ||
471 | const data = this.alarms.data[0]; | 479 | const data = this.alarms.data[0]; |
472 | entityId = data.originator; | 480 | entityId = data.originator; |
473 | entityName = data.originatorName; | 481 | entityName = data.originatorName; |