diff --git a/src/main/angular/src/app/pages/dashboard/dashboard.component.ts b/src/main/angular/src/app/pages/dashboard/dashboard.component.ts index 8580c87..5c7097d 100644 --- a/src/main/angular/src/app/pages/dashboard/dashboard.component.ts +++ b/src/main/angular/src/app/pages/dashboard/dashboard.component.ts @@ -73,9 +73,13 @@ export class DashboardComponent implements OnInit { return selfRatio * producedTotal; }); + const deliveringAny = (this.gridPower?.value || 0) < 0; const purchasingAny = (this.gridPower?.value || 0) > 0; const purchasingMuch = (this.gridPower?.value || 0) > PURCHASING_MUCH; - const color = purchasingMuch ? 'red' : (purchasingAny ? 'orange' : 'green'); + const producingAny = (this.photovoltaicPower?.value || 0) > 0; + + const gridColor = deliveringAny ? 'magenta' : (purchasingMuch ? 'red' : (purchasingAny ? 'orange' : 'green')); + const productionColor = producingAny ? 'green' : 'black'; return [ new Display('Bezug', '', this.gridPurchased), @@ -84,9 +88,9 @@ export class DashboardComponent implements OnInit { new Display('Produktion', '#006600', this.photovoltaicProduced), new Display('Eigenverbrauch', '#006600', selfConsumed), null, - new Display('Produktion', color, this.photovoltaicPower), - new Display('Netz', color, this.gridPower), - new Display('Verbrauch', color, consumptionPower), + new Display('Produktion', productionColor, this.photovoltaicPower), + new Display('Netz', gridColor, this.gridPower), + new Display('Verbrauch', '', consumptionPower), ]; }