From d0489c7353ab00d4958d216d4216d11f4c2916a4 Mon Sep 17 00:00:00 2001 From: Daniel Tartavel Date: Tue, 2 Aug 2022 23:25:59 +0200 Subject: [PATCH] debug --- events.php | 2 +- hooks/notifiers/notificationfreemobile.php | 9 +++------ hooks/scripts/rdc_sdb_eclairage.php | 1 - 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/events.php b/events.php index e64159f..aa244f9 100644 --- a/events.php +++ b/events.php @@ -230,7 +230,7 @@ function removeEvent(device $deviceObject, string $property , $value, int $metho } } -function searchEvent(device $deviceObject, string $property, $function, $value) +function searchEvent(device $deviceObject, string $property, $value, $function=null) { global $events; logger(DEBUG, sprintf(_("searching event for device %s, property %s and value %s"), $deviceObject->friendlyName, $property, bool2string($value)), __FILE__ . ":" . __LINE__); diff --git a/hooks/notifiers/notificationfreemobile.php b/hooks/notifiers/notificationfreemobile.php index bbae5e6..6ee2f51 100644 --- a/hooks/notifiers/notificationfreemobile.php +++ b/hooks/notifiers/notificationfreemobile.php @@ -25,8 +25,8 @@ class notificationFreemobile $ch = curl_init(); // set url curl_setopt($ch, CURLOPT_URL, $this->url . $this->dest[$destinataire] . "&msg=" . urlencode(trim($message))); - - //return the transfer as a string + + // return the transfer as a string //curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // $result contains the output string if ($this->curlErr <= 5) @@ -42,7 +42,7 @@ class notificationFreemobile $error = true; }else { - logger(DEBUG, sprintf(_("Curl return: %s when sending notification"), $result), false, __FILE__ . ":" . __LINE__); + logger(DEBUG, sprintf(_("Curl return: %s when sending notification"), curl_error($ch)), false, __FILE__ . ":" . __LINE__); $this->curlErr = 0; } }else @@ -53,12 +53,9 @@ class notificationFreemobile } $error = true; } - - //TODO managing curl errors // close curl resource to free up system resources curl_close($ch); - } return $error; } diff --git a/hooks/scripts/rdc_sdb_eclairage.php b/hooks/scripts/rdc_sdb_eclairage.php index 0197741..292bd73 100644 --- a/hooks/scripts/rdc_sdb_eclairage.php +++ b/hooks/scripts/rdc_sdb_eclairage.php @@ -44,7 +44,6 @@ class rdc_sdb_eclairage extends hook { if($deviceTarget->properties["state_l1"]["method"] == IDLE) { - logger(DEBUG, _("lighting with method auto"), __FILE__ . ":" . __LINE__); //$deviceTarget->properties["state_l1"]["method"] = AUTO; $this->send("ON", AUTO);