Fehler bei abfragen werden "abgefangen"
This commit is contained in:
@@ -192,7 +192,6 @@ class Ladestation_v2 extends IPSModule
|
|||||||
|
|
||||||
public function Get_Car_Status(int $carType)
|
public function Get_Car_Status(int $carType)
|
||||||
{
|
{
|
||||||
$plug_state = false;
|
|
||||||
$ch = curl_init();
|
$ch = curl_init();
|
||||||
|
|
||||||
switch ($carType) {
|
switch ($carType) {
|
||||||
@@ -205,7 +204,10 @@ class Ladestation_v2 extends IPSModule
|
|||||||
|
|
||||||
if (json_last_error() === JSON_ERROR_NONE && isset($data["car"])) {
|
if (json_last_error() === JSON_ERROR_NONE && isset($data["car"])) {
|
||||||
if ($data["car"] != 1) {
|
if ($data["car"] != 1) {
|
||||||
$plug_state = true;
|
$this->SetValue("Car_detected", true);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$this->SetValue("Car_detected", false);
|
||||||
}
|
}
|
||||||
$this->SetValue("Ladeleistung_Effektiv", $data["nrg"][11]*10);
|
$this->SetValue("Ladeleistung_Effektiv", $data["nrg"][11]*10);
|
||||||
$this->SetValue("Fahrzeugstatus", $data["car"]);
|
$this->SetValue("Fahrzeugstatus", $data["car"]);
|
||||||
@@ -221,7 +223,10 @@ class Ladestation_v2 extends IPSModule
|
|||||||
|
|
||||||
if (json_last_error() === JSON_ERROR_NONE && isset($data["car"])) {
|
if (json_last_error() === JSON_ERROR_NONE && isset($data["car"])) {
|
||||||
if ($data["car"] != 1) {
|
if ($data["car"] != 1) {
|
||||||
$plug_state = true;
|
$this->SetValue("Car_detected", true);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$this->SetValue("Car_detected", false);
|
||||||
}
|
}
|
||||||
$this->SetValue("Ladeleistung_Effektiv", $data["nrg"][11]);
|
$this->SetValue("Ladeleistung_Effektiv", $data["nrg"][11]);
|
||||||
$this->SetValue("Fahrzeugstatus", $data["car"]);
|
$this->SetValue("Fahrzeugstatus", $data["car"]);
|
||||||
@@ -239,7 +244,10 @@ class Ladestation_v2 extends IPSModule
|
|||||||
|
|
||||||
if (json_last_error() === JSON_ERROR_NONE && isset($data["State"])) {
|
if (json_last_error() === JSON_ERROR_NONE && isset($data["State"])) {
|
||||||
if ($data["State"] != 1) {
|
if ($data["State"] != 1) {
|
||||||
$plug_state = true;
|
$this->SetValue("Car_detected", true);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$this->SetValue("Car_detected", false);
|
||||||
}
|
}
|
||||||
$this->SetValue("Ladeleistung_Effektiv", round($data["ActiveChargingPower"]*1000));
|
$this->SetValue("Ladeleistung_Effektiv", round($data["ActiveChargingPower"]*1000));
|
||||||
$this->SetValue("Fahrzeugstatus", $data["State"]);
|
$this->SetValue("Fahrzeugstatus", $data["State"]);
|
||||||
@@ -248,7 +256,7 @@ class Ladestation_v2 extends IPSModule
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 4:
|
case 4:
|
||||||
$plug_state = true;
|
$this->SetValue("Car_detected", true);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 5:
|
case 5:
|
||||||
@@ -256,14 +264,13 @@ class Ladestation_v2 extends IPSModule
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
$plug_state = false;
|
$this->SetValue("Car_detected", false);
|
||||||
$this->SetValue("Fahrzeugstatus", -1);
|
$this->SetValue("Fahrzeugstatus", -1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->SetValue("Car_detected", $plug_state);
|
|
||||||
|
|
||||||
return $plug_state;
|
return $this->GetValue("Car_detected");
|
||||||
}
|
}
|
||||||
|
|
||||||
public function Calc_Max_Current(bool $is_1_ph)
|
public function Calc_Max_Current(bool $is_1_ph)
|
||||||
|
|||||||
Reference in New Issue
Block a user