From f9603f5e7a40e27206cfa7404e4c9336c1bf414c Mon Sep 17 00:00:00 2001 From: tysauron Date: Thu, 5 Oct 2023 00:47:50 +0200 Subject: [PATCH] Add jeedom.history.getLast --- core/class/history.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/class/history.class.php b/core/class/history.class.php index d9fded156f..93216f17eb 100644 --- a/core/class/history.class.php +++ b/core/class/history.class.php @@ -884,7 +884,7 @@ public static function lastFromDate($_cmd_id, $_time){ $return = DB::Prepare($sql, $values, DB::FETCH_TYPE_ALL, PDO::FETCH_CLASS, __CLASS__); if(isset($return[0])) - return $return[0]->getValue(); + return array('unite' => $cmd->getUnite(), 'value' => $return[0]->getValue()); } elseif(is_object($cmd)){ return array('unite' => $cmd->getUnite(), 'value' =>history::getLastHistoryFromCalcul (jeedom::fromHumanReadable($cmd->getConfiguration('calcul')), $_time));