stepgrösse und berechnungsintervall geändert
This commit is contained in:
@@ -44,7 +44,7 @@ class Batterie extends IPSModule
|
|||||||
// Initialisiere Idle
|
// Initialisiere Idle
|
||||||
$this->SetValue("Idle", true);
|
$this->SetValue("Idle", true);
|
||||||
|
|
||||||
$this->RegisterTimer("Timer_Do_UserCalc",5000,"IPS_RequestAction(" .$this->InstanceID .', "Do_UserCalc", "");');
|
$this->RegisterTimer("Timer_Do_UserCalc",2500,"IPS_RequestAction(" .$this->InstanceID .', "Do_UserCalc", "");');
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -56,11 +56,11 @@ class Batterie extends IPSModule
|
|||||||
$batterieManagement = $this->ReadPropertyInteger("Batteriemanagement");
|
$batterieManagement = $this->ReadPropertyInteger("Batteriemanagement");
|
||||||
$this->SetValue("Batteriemanagement_Variabel", $batterieManagement);
|
$this->SetValue("Batteriemanagement_Variabel", $batterieManagement);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function GeneratePowerSteps($additionalValue)
|
private function GeneratePowerSteps($additionalValue)
|
||||||
{
|
{
|
||||||
$maxleistung = $this->ReadPropertyInteger("MaxBatterieleistung");
|
$maxleistung = $this->ReadPropertyInteger("MaxBatterieleistung");
|
||||||
$stepSize = 125; // Schrittgröße
|
$stepSize = 250; // Schrittgröße
|
||||||
$stepSizeSmall = 25; // Kleine Schrittgröße
|
$stepSizeSmall = 25; // Kleine Schrittgröße
|
||||||
|
|
||||||
// Array direkt als Range erzeugen (schneller als Schleife)
|
// Array direkt als Range erzeugen (schneller als Schleife)
|
||||||
@@ -79,11 +79,17 @@ class Batterie extends IPSModule
|
|||||||
|
|
||||||
// Zusätzliche Werte berechnen und auf MaxLeistung begrenzen
|
// Zusätzliche Werte berechnen und auf MaxLeistung begrenzen
|
||||||
$newValues = array_filter([
|
$newValues = array_filter([
|
||||||
|
$closestValue - 5 * $stepSizeSmall,
|
||||||
|
$closestValue - 4 * $stepSizeSmall,
|
||||||
|
$closestValue - 3 * $stepSizeSmall,
|
||||||
$closestValue - 2 * $stepSizeSmall,
|
$closestValue - 2 * $stepSizeSmall,
|
||||||
$closestValue - $stepSizeSmall,
|
$closestValue - $stepSizeSmall,
|
||||||
$closestValue,
|
$closestValue,
|
||||||
$closestValue + $stepSizeSmall,
|
$closestValue + $stepSizeSmall,
|
||||||
$closestValue + 2 * $stepSizeSmall
|
$closestValue + 2 * $stepSizeSmall
|
||||||
|
$closestValue + 3 * $stepSizeSmall
|
||||||
|
$closestValue + 4 * $stepSizeSmall
|
||||||
|
$closestValue + 5 * $stepSizeSmall
|
||||||
], function ($value) use ($maxleistung) {
|
], function ($value) use ($maxleistung) {
|
||||||
return $value >= -$maxleistung && $value <= $maxleistung;
|
return $value >= -$maxleistung && $value <= $maxleistung;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ class Manager extends IPSModule
|
|||||||
$this->RegisterPropertyInteger("DatenZuruck", 0); // Initialisierung mit 0
|
$this->RegisterPropertyInteger("DatenZuruck", 0); // Initialisierung mit 0
|
||||||
|
|
||||||
// Timer registrieren
|
// Timer registrieren
|
||||||
$this->RegisterTimer("Timer_DistributeEnergy",5000,"IPS_RequestAction(" .$this->InstanceID .', "DistributeEnergy", "");');
|
$this->RegisterTimer("Timer_DistributeEnergy",3000,"IPS_RequestAction(" .$this->InstanceID .', "DistributeEnergy", "");');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function ApplyChanges()
|
public function ApplyChanges()
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
"compatibility": {
|
"compatibility": {
|
||||||
"version": "7.1"
|
"version": "7.1"
|
||||||
},
|
},
|
||||||
"version": "1.183",
|
"version": "1.184",
|
||||||
"build": 0,
|
"build": 0,
|
||||||
"date": 0
|
"date": 0
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user