Zum Testen bereit

This commit is contained in:
belevo\mh
2024-11-11 15:35:45 +01:00
parent 15d62a008d
commit 42e3933a8d
2 changed files with 5 additions and 9 deletions

View File

@@ -117,8 +117,7 @@ class Belevo_Server_Kommunikation extends IPSModule
}
}
// Optional: Ausgabe im JSON-Format protokollieren
IPS_LogMessage("Belevo_Server_Kommunikation", json_encode($output));
// Wenn gewünscht, kannst du das JSON zurückgeben oder speichern
return json_encode($output);
@@ -192,7 +191,7 @@ public function MakeJson($json)
// Array in JSON konvertieren
$json = json_encode($influxData);
IPS_LogMessage("Belevo_Server_Kommunikation", "Erstelltes JSON: " . $json);
// JSON zurückgeben oder weiterverarbeiten
return $json;
@@ -228,7 +227,7 @@ private function SendJsonToInfluxDB($url, $jsonData) {
// cURL-Request ausführen
$result = curl_exec($curl);
IPS_LogMessage("Belevo_Server_Kommunikation", "result " . $result);
$error = curl_error($curl);
$httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
// cURL beenden
@@ -236,9 +235,6 @@ private function SendJsonToInfluxDB($url, $jsonData) {
if ($error) {
IPS_LogMessage("Belevo_Server_Kommunikation", "Fehler beim Senden an Influx: " . $error);
} else {
IPS_LogMessage("Belevo_Server_Kommunikation", "HTTP-Status: " . $httpCode);
IPS_LogMessage("Belevo_Server_Kommunikation", "Antwort von Influx: " . $result);
}
}

View File

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