no message
This commit is contained in:
@@ -132,18 +132,18 @@ public function RequestAction($Ident, $Value)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function SetAktuelle_Leistung(int $y)
|
public function SetAktuelle_Leistung(int $power)
|
||||||
{
|
{
|
||||||
$power = (-1)*$y;
|
$y = (-1)*$power;
|
||||||
|
|
||||||
if ($power < 0) {
|
if ($y < 0) {
|
||||||
|
|
||||||
// Laden
|
// Laden
|
||||||
$uVarID = $this->ReadPropertyInteger("Batteriespannung");
|
$uVarID = $this->ReadPropertyInteger("Batteriespannung");
|
||||||
if ($uVarID > 0 && IPS_VariableExists($uVarID)) {
|
if ($uVarID > 0 && IPS_VariableExists($uVarID)) {
|
||||||
$U = GetValue($uVarID);
|
$U = GetValue($uVarID);
|
||||||
if ($U > 0) {
|
if ($U > 0) {
|
||||||
$lade_strom = abs($power) / $U;
|
$lade_strom = abs($y) / $U;
|
||||||
} else {
|
} else {
|
||||||
$lade_strom = 0;
|
$lade_strom = 0;
|
||||||
}
|
}
|
||||||
@@ -155,14 +155,14 @@ public function RequestAction($Ident, $Value)
|
|||||||
$this->SetValue("Entladestrom", 0);
|
$this->SetValue("Entladestrom", 0);
|
||||||
$this->SetValue("Batteriespannung_laden_entladen", 56);
|
$this->SetValue("Batteriespannung_laden_entladen", 56);
|
||||||
|
|
||||||
} elseif ($power > 0) {
|
} elseif ($y > 0) {
|
||||||
|
|
||||||
// Entladen
|
// Entladen
|
||||||
$uVarID = $this->ReadPropertyInteger("Batteriespannung");
|
$uVarID = $this->ReadPropertyInteger("Batteriespannung");
|
||||||
if ($uVarID > 0 && IPS_VariableExists($uVarID)) {
|
if ($uVarID > 0 && IPS_VariableExists($uVarID)) {
|
||||||
$U = GetValue($uVarID);
|
$U = GetValue($uVarID);
|
||||||
if ($U > 0) {
|
if ($U > 0) {
|
||||||
$entlade_strom = $power / $U;
|
$entlade_strom = $y / $U;
|
||||||
} else {
|
} else {
|
||||||
$entlade_strom = 0;
|
$entlade_strom = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user