This commit is contained in:
2025-03-07 14:40:36 +01:00
parent ca9e8c76ae
commit 54199fa243
3 changed files with 8 additions and 6 deletions

View File

@@ -61,7 +61,7 @@ class Batterie extends IPSModule
{
$maxleistung = $this->ReadPropertyInteger("MaxBatterieleistung");
$array_powersteps = [];
$stepSize = 250; // Schrittgröße
$stepSize = 125; // Schrittgröße
// Erstellen der PowerSteps
for ($i = -$maxleistung; $i <= $maxleistung; $i += $stepSize) {
@@ -203,8 +203,11 @@ public function RequestAction($Ident, $Value)
}
else{
IPS_LogMessage("Manager", "Im else teil");
if($batterieladezustand>99){
IPS_LogMessage("Manager", "im 1");
$filtered_powersteps_entladen = array_filter($array_powersteps, function ($value) {
return $value <= 0;
@@ -214,11 +217,14 @@ public function RequestAction($Ident, $Value)
}elseif($batterieladezustand>=$aufdasnachladen && $hyst==false){
$this->SetValue("PowerSteps", json_encode($array_powersteps));
IPS_LogMessage("Manager", "im 2");
}else{
$dummy_array[] = $this->ReadPropertyInteger("MaxNachladen");
$this->SetValue("PowerSteps", json_encode($dummy_array));
IPS_LogMessage("Manager", "im 3");
}