This commit is contained in:
+10
-9
@@ -293,10 +293,9 @@ class Batterie extends IPSModule implements VerbraucherSchnittstelle
|
||||
$sollleistung = $daten['Sollleistung_W'];
|
||||
if ($sollleistung === null) {
|
||||
if ((bool) $this->leseZustand('SollwertGueltig')
|
||||
&& !in_array(
|
||||
(int) $this->leseZustand('Sollleistung'),
|
||||
&& !Nachrichtenvertrag::enthaeltLeistungswert(
|
||||
$this->leseLeistungsangebot(),
|
||||
true
|
||||
(int) $this->leseZustand('Sollleistung')
|
||||
)
|
||||
) {
|
||||
$this->setzeZustand('SollwertGueltig', false);
|
||||
@@ -306,7 +305,10 @@ class Batterie extends IPSModule implements VerbraucherSchnittstelle
|
||||
return;
|
||||
}
|
||||
|
||||
if (!in_array($sollleistung, $this->leseLeistungsangebot(), true)) {
|
||||
if (!Nachrichtenvertrag::enthaeltLeistungswert(
|
||||
$this->leseLeistungsangebot(),
|
||||
$sollleistung
|
||||
)) {
|
||||
throw new InvalidArgumentException(
|
||||
'Sollleistung_W liegt nicht im aktuell gemeldeten Leistungsangebot.'
|
||||
);
|
||||
@@ -394,10 +396,9 @@ class Batterie extends IPSModule implements VerbraucherSchnittstelle
|
||||
);
|
||||
|
||||
if ((bool) $this->leseZustand('SollwertGueltig')
|
||||
&& !in_array(
|
||||
(int) $this->leseZustand('Sollleistung'),
|
||||
&& !Nachrichtenvertrag::enthaeltLeistungswert(
|
||||
$angebot,
|
||||
true
|
||||
(int) $this->leseZustand('Sollleistung')
|
||||
)
|
||||
) {
|
||||
$this->setzeZustand('SollwertGueltig', false);
|
||||
@@ -1073,7 +1074,7 @@ class Batterie extends IPSModule implements VerbraucherSchnittstelle
|
||||
}
|
||||
}
|
||||
|
||||
/** @return list<int> */
|
||||
/** @return list<int|array{Von_W: int, Bis_W: int}> */
|
||||
private function leseLeistungsangebot(): array
|
||||
{
|
||||
$angebot = json_decode(
|
||||
@@ -1086,7 +1087,7 @@ class Batterie extends IPSModule implements VerbraucherSchnittstelle
|
||||
return [0];
|
||||
}
|
||||
|
||||
return array_values(array_map('intval', $angebot));
|
||||
return array_values($angebot);
|
||||
}
|
||||
|
||||
private function setzeStoerung(string $text): void
|
||||
|
||||
Reference in New Issue
Block a user