evt fehler behoben

This commit is contained in:
belevo\mh
2025-02-24 13:50:55 +01:00
parent d20a8ed950
commit 2f88f264fb
2 changed files with 17 additions and 4 deletions

View File

@@ -12,8 +12,8 @@ class Batterie extends IPSModule
$this->RegisterPropertyInteger("AufdasNachladen",0);
$this->RegisterPropertyInteger("MinimumEntladen",0);
$this->RegisterPropertyInteger("Batterieladezustand",0);
$this->RegisterPropertyFloat("Entladeleistung",0);
$this->RegisterPropertyFloat("Ladeleistung",0);
$this->ReadPropertyInteger("Entladeleistung",0);
$this->ReadPropertyInteger("Ladeleistung",0);
// Variabeln für Kommunkation mit Manager
$this->RegisterVariableInteger("Aktuelle_Leistung", "Aktuelle_Leistung", "", 0);
@@ -91,14 +91,27 @@ public function RequestAction($Ident, $Value)
public function SetAktuelle_Leistung(int $power)
{
/*
if ($power >= 0){
SetValue($this->ReadPropertyFloat("Ladeleistung"), $power);
SetValue($this->ReadPropertyFloat("Entladeleistung"),0);
}else{
SetValue($this->ReadPropertyFloat("Entladeleistung"), abs($power));
SetValue($this->ReadPropertyFloat("Ladeleistung"), 0);
}*/
$ladeleistungID = $this->ReadPropertyInteger("Ladeleistung");
$entladeleistungID = $this->ReadPropertyInteger("Entladeleistung");
if ($ladeleistungID > 0 && IPS_VariableExists($ladeleistungID)) {
SetValue($ladeleistungID, floatval($power));
}
if ($entladeleistungID > 0 && IPS_VariableExists($entladeleistungID)) {
SetValue($entladeleistungID, floatval(abs($power)));
}
/*
$entladeleistungID = $this->ReadPropertyFloat("Entladeleistung");

View File

@@ -6,7 +6,7 @@
"compatibility": {
"version": "7.1"
},
"version": "1.062",
"version": "1.063",
"build": 0,
"date": 0
}