This commit is contained in:
@@ -297,9 +297,21 @@ trait ManagerEnergieTrait
|
||||
|
||||
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('Gesamtbilanz', $konfiguration)) {
|
||||
// Physical grid counters already include SDL; Utils derives the complete site balance.
|
||||
IPS_SetHidden($instanzID, false);
|
||||
if (IPS_GetProperty($instanzID, 'Gesamtbilanz') !== true) {
|
||||
IPS_SetProperty($instanzID, 'Gesamtbilanz', true);
|
||||
if ($anwenden) {
|
||||
IPS_ApplyChanges($instanzID);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Compatibility until Utils is updated: do not enable the old mixed-boundary calculation.
|
||||
$berechenbar = !$this->ReadPropertyBoolean('SDLAktiv');
|
||||
if (!is_array($konfiguration) || !array_key_exists('EnergieanteileBerechenbar', $konfiguration)) {
|
||||
IPS_SetHidden($instanzID, !$berechenbar);
|
||||
if (!$berechenbar) {
|
||||
|
||||
Reference in New Issue
Block a user