feat(forecast): integrate full forecast charts and complete SDL visualization
Tests / test (push) Failing after 52s
Tests / test (push) Failing after 52s
This commit is contained in:
@@ -273,8 +273,9 @@ trait ManagerEnergieTrait
|
||||
throw new RuntimeException('Unterobjekt EnergyPie hat einen unpassenden Typ.');
|
||||
}
|
||||
IPS_SetHidden($instanzID, false);
|
||||
$this->synchronisiereEnergyPieAnteile($instanzID);
|
||||
|
||||
return 'Bestehende Energy-Pie-Konfiguration bleibt unveraendert.';
|
||||
return 'Bestehende Energy-Pie-Messquellen und Darstellung bleiben unveraendert.';
|
||||
}
|
||||
IPS_SetName($instanzID, 'Energy Pie');
|
||||
IPS_SetPosition($instanzID, 500);
|
||||
@@ -288,11 +289,35 @@ trait ManagerEnergieTrait
|
||||
] as $property => $wert) {
|
||||
IPS_SetProperty($instanzID, $property, $wert);
|
||||
}
|
||||
$this->synchronisiereEnergyPieAnteile($instanzID, false);
|
||||
IPS_ApplyChanges($instanzID);
|
||||
|
||||
return 'Energy Pie wurde erstellt oder aktualisiert.';
|
||||
}
|
||||
|
||||
private function synchronisiereEnergyPieAnteile(int $instanzID, bool $anwenden = true): void
|
||||
{
|
||||
// Physischer Netzbezug enthaelt SDL, die Hausenergie dagegen nicht.
|
||||
$berechenbar = !$this->ReadPropertyBoolean('SDLAktiv');
|
||||
$konfiguration = json_decode(IPS_GetConfiguration($instanzID), true, 512, JSON_THROW_ON_ERROR);
|
||||
if (!is_array($konfiguration) || !array_key_exists('EnergieanteileBerechenbar', $konfiguration)) {
|
||||
IPS_SetHidden($instanzID, !$berechenbar);
|
||||
if (!$berechenbar) {
|
||||
IPS_LogMessage('Enelix Manager ' . $this->InstanceID,
|
||||
'Energy Pie ausgeblendet: Enelix Utils aktualisieren, damit bei aktiver SDL keine unbestimmbaren Energieanteile angezeigt werden.');
|
||||
}
|
||||
return;
|
||||
}
|
||||
IPS_SetHidden($instanzID, false);
|
||||
if (IPS_GetProperty($instanzID, 'EnergieanteileBerechenbar') === $berechenbar) {
|
||||
return;
|
||||
}
|
||||
IPS_SetProperty($instanzID, 'EnergieanteileBerechenbar', $berechenbar);
|
||||
if ($anwenden) {
|
||||
IPS_ApplyChanges($instanzID);
|
||||
}
|
||||
}
|
||||
|
||||
private function erstelleEnergiefluss(): string
|
||||
{
|
||||
if (!in_array(self::ENERGY_FLOW_MODULE_ID, IPS_GetModuleList(), true)) {
|
||||
|
||||
Reference in New Issue
Block a user