no message
This commit is contained in:
@@ -128,27 +128,13 @@ class Ladestation_v2 extends IPSModule
|
|||||||
$data["configuration"] = [];
|
$data["configuration"] = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
$changed = !array_key_exists("EaseeGatewayID", $data["configuration"]);
|
if (array_key_exists("EaseeGatewayID", $data["configuration"])) {
|
||||||
$gatewayID = (int)($data["configuration"]["EaseeGatewayID"] ?? 0);
|
|
||||||
|
|
||||||
// Vorhandene Gateway-Verbindung aus Version 1.1 uebernehmen.
|
|
||||||
if ($gatewayID <= 0) {
|
|
||||||
$instance = IPS_GetInstance($this->InstanceID);
|
|
||||||
$connectionID = (int)$instance["ConnectionID"];
|
|
||||||
if ($connectionID > 0 && IPS_InstanceExists($connectionID)) {
|
|
||||||
$parent = IPS_GetInstance($connectionID);
|
|
||||||
if ($parent["ModuleInfo"]["ModuleID"] === self::EASEE_GATEWAY_MODULE_ID) {
|
|
||||||
$gatewayID = $connectionID;
|
|
||||||
$changed = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$changed) {
|
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
$data["configuration"]["EaseeGatewayID"] = $gatewayID;
|
// In Migrate keine Instanzfunktionen aufrufen: Die Instanzschnittstelle
|
||||||
|
// wird zu diesem Zeitpunkt erst aufgebaut.
|
||||||
|
$data["configuration"]["EaseeGatewayID"] = 0;
|
||||||
return json_encode($data);
|
return json_encode($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user