anpassungen
This commit is contained in:
@@ -243,7 +243,7 @@ class Ladestation_Universal extends IPSModule
|
||||
// Dekodiere die JSON-Antwort
|
||||
$data = json_decode($response, true);
|
||||
|
||||
if($this->ReadPropertyInteger("Ladestation")==2||$this->ReadPropertyInteger("Ladestation")==1){
|
||||
if($this->ReadPropertyInteger("Ladestation")==2){
|
||||
// Überprüfe, ob das JSON-Dekodieren erfolgreich war und der Schlüssel "car" existiert
|
||||
if (json_last_error() === JSON_ERROR_NONE && isset($data["car"])) {
|
||||
// Speichere den Wert von "car" in der Variable $status
|
||||
@@ -262,6 +262,26 @@ class Ladestation_Universal extends IPSModule
|
||||
}
|
||||
}
|
||||
}
|
||||
if($this->ReadPropertyInteger("Ladestation")==1){
|
||||
// Überprüfe, ob das JSON-Dekodieren erfolgreich war und der Schlüssel "car" existiert
|
||||
if (json_last_error() === JSON_ERROR_NONE && isset($data["car"])) {
|
||||
// Speichere den Wert von "car" in der Variable $status
|
||||
|
||||
SetValue(
|
||||
$this->GetIDForIdent("Ladeleistung_Effektiv"),
|
||||
$data["nrg"][11]*10
|
||||
);
|
||||
|
||||
SetValue($this->GetIDForIdent("Fahrzeugstatus"), $data["car"]);
|
||||
|
||||
if ($data["nrg"][6] > 1 && $data["car"] == 2) {
|
||||
SetValue($this->GetIDForIdent("Lademodus"), 1);
|
||||
} elseif ($data["nrg"][6] <= 1 && $data["car"] == 2) {
|
||||
SetValue($this->GetIDForIdent("Lademodus"), 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($this->ReadPropertyInteger("Ladestation")==3){
|
||||
// Überprüfe, ob das JSON-Dekodieren erfolgreich war und der Schlüssel "car" existiert
|
||||
if (json_last_error() === JSON_ERROR_NONE && isset($data["State"])) {
|
||||
|
||||
Reference in New Issue
Block a user