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
+62
View File
@@ -386,6 +386,68 @@ final class ManagerSDLTest extends TestCase
}
}
public function testEnergyPieAttributionTracksSDLWithoutChangingCustomSettings(): void
{
$custom = [
'ProduktionZaehlerID' => 801,
'NetzbezugZaehlerID' => 802,
'EinspeisungZaehlerID' => 803,
'VerbrauchZaehlerID' => 804,
'FarbeEigenverbrauch' => '#123456',
'FarbeAutarkie' => '#ABCDEF',
'Standardzeitraum' => 'month',
'EnergieanteileBerechenbar' => true,
];
ManagerSDLRuntime::$properties[303] = $custom;
$this->properties(['SDLAktiv' => true]);
$this->invoke('synchronisiereEnergyPieAnteile', [303]);
self::assertSame(array_replace($custom, ['EnergieanteileBerechenbar' => false]),
ManagerSDLRuntime::$properties[303]);
$writes = ManagerSDLRuntime::$writes;
$this->invoke('synchronisiereEnergyPieAnteile', [303]);
self::assertSame($writes, ManagerSDLRuntime::$writes);
$this->properties(['SDLAktiv' => false]);
$this->invoke('synchronisiereEnergyPieAnteile', [303]);
self::assertSame($custom, ManagerSDLRuntime::$properties[303]);
}
public function testOlderEnergyPieStaysVisibleWithoutSDLAndKeepsConfiguration(): void
{
$custom = ['ProduktionZaehlerID' => 801, 'FarbeEigenverbrauch' => '#123456'];
ManagerSDLRuntime::$properties[303] = $custom;
$this->properties(['SDLAktiv' => false]);
$this->invoke('synchronisiereEnergyPieAnteile', [303]);
self::assertSame($custom, ManagerSDLRuntime::$properties[303]);
self::assertFalse(ManagerSDLRuntime::$hidden[303]);
self::assertSame([], ManagerSDLRuntime::$logs);
}
public function testOlderEnergyPieIsHiddenWithSDLAndRestoredAfterUtilsUpdate(): void
{
$custom = ['ProduktionZaehlerID' => 801, 'FarbeEigenverbrauch' => '#123456'];
ManagerSDLRuntime::$properties[303] = $custom;
$this->properties(['SDLAktiv' => true]);
$this->invoke('synchronisiereEnergyPieAnteile', [303]);
self::assertSame($custom, ManagerSDLRuntime::$properties[303]);
self::assertTrue(ManagerSDLRuntime::$hidden[303]);
self::assertCount(1, ManagerSDLRuntime::$logs);
self::assertStringContainsString('Enelix Utils aktualisieren', ManagerSDLRuntime::$logs[0][1]);
ManagerSDLRuntime::$properties[303]['EnergieanteileBerechenbar'] = true;
$this->invoke('synchronisiereEnergyPieAnteile', [303]);
self::assertFalse(ManagerSDLRuntime::$hidden[303]);
self::assertSame(array_replace($custom, ['EnergieanteileBerechenbar' => false]),
ManagerSDLRuntime::$properties[303]);
self::assertCount(1, ManagerSDLRuntime::$logs);
}
private function advanceCounters(): void
{
foreach ([201 => 102.0, 202 => 11.0, 203 => 5.2, 204 => 10.4, 205 => 8.1] as $id => $value) {