From 0b12aed7d62e8dc2add6da40839e1b199309af50 Mon Sep 17 00:00:00 2001 From: Jon Ziebell Date: Thu, 12 Jan 2023 20:59:54 -0500 Subject: [PATCH] =?UTF-8?q?Fixed=20#336=20-=20Downloaded=20data=20does=20n?= =?UTF-8?q?ot=20convert=20to=20=C2=B0C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/runtime.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/api/runtime.php b/api/runtime.php index 2d495c7..46a3b78 100644 --- a/api/runtime.php +++ b/api/runtime.php @@ -939,6 +939,8 @@ class runtime extends cora\api { $this->user_lock($thermostat_id); + $user = $this->api('user', 'get', $this->session->get_user_id()); + $thermostat = $this->api('thermostat', 'get', $thermostat_id); $ecobee_thermostat = $this->api( 'ecobee_thermostat', @@ -1023,8 +1025,9 @@ class runtime extends cora\api { if($runtime_sensor['temperature'] !== null) { $runtime_sensor['temperature'] /= 10; if( - isset($thermostat['setting']['temperature_unit']) === true && - $thermostat['setting']['temperature_unit'] === '°C' + isset($user['settings']['units']) === true && + isset($user['settings']['units']['temperature']) === true && + $user['settings']['units']['temperature'] === '°C' ) { $runtime_sensor['temperature'] = round(($runtime_sensor['temperature'] - 32) * (5 / 9), 1); @@ -1089,8 +1092,9 @@ class runtime extends cora\api { if($runtime_thermostat[$key] !== null) { $runtime_thermostat[$key] /= 10; if( - isset($thermostat['setting']['temperature_unit']) === true && - $thermostat['setting']['temperature_unit'] === '°C' + isset($user['settings']['units']) === true && + isset($user['settings']['units']['temperature']) === true && + $user['settings']['units']['temperature'] === '°C' ) { $runtime_thermostat[$key] = round(($runtime_thermostat[$key] - 32) * (5 / 9), 1);