dashboard electricity colors

This commit is contained in:
Patrick Haßel 2024-10-17 15:46:38 +02:00
parent 3cfc0dd890
commit 6f9fb935e3

View File

@ -73,9 +73,13 @@ export class DashboardComponent implements OnInit {
return selfRatio * producedTotal; return selfRatio * producedTotal;
}); });
const deliveringAny = (this.gridPower?.value || 0) < 0;
const purchasingAny = (this.gridPower?.value || 0) > 0; const purchasingAny = (this.gridPower?.value || 0) > 0;
const purchasingMuch = (this.gridPower?.value || 0) > PURCHASING_MUCH; 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 [ return [
new Display('Bezug', '', this.gridPurchased), new Display('Bezug', '', this.gridPurchased),
@ -84,9 +88,9 @@ export class DashboardComponent implements OnInit {
new Display('Produktion', '#006600', this.photovoltaicProduced), new Display('Produktion', '#006600', this.photovoltaicProduced),
new Display('Eigenverbrauch', '#006600', selfConsumed), new Display('Eigenverbrauch', '#006600', selfConsumed),
null, null,
new Display('Produktion', color, this.photovoltaicPower), new Display('Produktion', productionColor, this.photovoltaicPower),
new Display('Netz', color, this.gridPower), new Display('Netz', gridColor, this.gridPower),
new Display('Verbrauch', color, consumptionPower), new Display('Verbrauch', '', consumptionPower),
]; ];
} }