From 6b9241d0c75eb6b62753350d7a60d9e0c3e2b67d Mon Sep 17 00:00:00 2001 From: Jon Ziebell Date: Tue, 11 Feb 2020 20:45:27 -0500 Subject: [PATCH] Fixed #239 Historical runtime fails to sync when it reaches point where ecobee has deleted data --- api/runtime.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/runtime.php b/api/runtime.php index a6e0b17..89b7607 100644 --- a/api/runtime.php +++ b/api/runtime.php @@ -313,7 +313,7 @@ class runtime extends cora\api { * @param int $begin * @param int $end * - * @return string The last updated or inserted timestamp. + * @return array The first and last updated or inserted timestamp. */ private function sync_($thermostat_id, $begin, $end) { $this->user_lock($thermostat_id); @@ -596,8 +596,8 @@ class runtime extends cora\api { } return [ - 'data_begin' => strtotime($data_begin), - 'data_end' => strtotime($data_end) + 'data_begin' => (($data_begin === null) ? null : strtotime($data_begin)), + 'data_end' => (($data_end === null) ? null : strtotime($data_end)) ]; }