feat(forecast): integrate full forecast charts and complete SDL visualization
Tests / test (push) Failing after 52s

This commit is contained in:
dh
2026-10-06 17:40:45 +00:00
parent 5687596799
commit 372b997876
30 changed files with 4377 additions and 53 deletions
+26 -1
View File
@@ -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)) {