no message
This commit is contained in:
@@ -67,8 +67,7 @@ class Verbraucher_extern extends IPSModule
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private function berechneKombinationen(array $verbraucherListe)
|
private function berechneKombinationen(array $verbraucherListe){
|
||||||
{
|
|
||||||
$kombinationen = [];
|
$kombinationen = [];
|
||||||
foreach ($verbraucherListe as $verbraucher) {
|
foreach ($verbraucherListe as $verbraucher) {
|
||||||
|
|
||||||
@@ -89,7 +88,7 @@ class Verbraucher_extern extends IPSModule
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private function find($target, $values, $current, &$result) {
|
private function find($target, $values, $current, &$result) {
|
||||||
if ($target == 0) {
|
if ($target == 0) {
|
||||||
$result[] = $current;
|
$result[] = $current;
|
||||||
return;
|
return;
|
||||||
@@ -99,7 +98,7 @@ class Verbraucher_extern extends IPSModule
|
|||||||
}
|
}
|
||||||
for ($i = 0; $i < count($values); $i++) {
|
for ($i = 0; $i < count($values); $i++) {
|
||||||
$newValues = array_slice($values, $i + 1);
|
$newValues = array_slice($values, $i + 1);
|
||||||
find($target - $values[$i], $newValues, array_merge($current, [$values[$i]]), $result);
|
$this->find($target - $values[$i], $newValues, array_merge($current, [$values[$i]]), $result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -129,9 +128,10 @@ class Verbraucher_extern extends IPSModule
|
|||||||
|
|
||||||
|
|
||||||
public function SetAktuelle_Leistung(float $power) {
|
public function SetAktuelle_Leistung(float $power) {
|
||||||
|
$this->SetValue("Bezogene_Energie", ($this->GetValue("Bezogene_Energie") + ($this->GetValue("Aktuelle_Leistung")*($this->ReadPropertyInteger("Interval")/3600))));
|
||||||
$this->CheckIdle($power);
|
$this->CheckIdle($power);
|
||||||
|
|
||||||
$verbraucherListe = json_decode($this->ReadPropertyString("Verbraucher_Liste"), true);
|
$verbraucherListe = json_decode($this->ReadPropertyString("Verbraucher_Liste"), true);
|
||||||
|
|
||||||
$this->berechneInverseKombinationen();
|
$this->berechneInverseKombinationen();
|
||||||
$this->SetValue("Leistung_Delta", GetValue($this->ReadPropertyInteger("delta_power")));
|
$this->SetValue("Leistung_Delta", GetValue($this->ReadPropertyInteger("delta_power")));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user