From 696ff079870f74dfdb07f787b7a47eacb91d4eb5 Mon Sep 17 00:00:00 2001 From: JonatanRek Date: Tue, 5 Jan 2021 13:24:49 +0100 Subject: [PATCH] Fixes --- app/api/EndpointsApi.php | 3 ++- app/models/managers/DeviceManager.php | 4 +++- app/models/managers/SubDeviceManager.php | 2 +- public/css/main.css | 6 +++--- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/app/api/EndpointsApi.php b/app/api/EndpointsApi.php index 9f08935..ca419e5 100644 --- a/app/api/EndpointsApi.php +++ b/app/api/EndpointsApi.php @@ -62,6 +62,7 @@ class EndpointsApi extends ApiController{ } $device = DeviceManager::getDeviceByToken($obj['token']); + DeviceManager::setHeartbeat($device['device_id']); //Diagnostic if (isset($obj['settings'])){ @@ -110,7 +111,7 @@ class EndpointsApi extends ApiController{ if (!SubDeviceManager::getSubDeviceByMaster($device['device_id'], $key)) { SubDeviceManager::create($device['device_id'], $key, UNITS[$key]); } - + $subDeviceLastReordValue[$key] = $value['value']; RecordManager::create($device['device_id'], $key, round($value['value'],3)); $logManager->write("[API] Device_ID " . $device['device_id'] . " writed value " . $key . ' ' . $value['value'], LogRecordTypes::INFO); diff --git a/app/models/managers/DeviceManager.php b/app/models/managers/DeviceManager.php index f8c5ce5..48bd0c0 100644 --- a/app/models/managers/DeviceManager.php +++ b/app/models/managers/DeviceManager.php @@ -7,7 +7,9 @@ class DeviceManager{ WHERE approved != ?", Array(2)); } - + static function setHeartbeat($deviceId){ + self::edit($deviceId, ['heartbeat' => date("Y-m-d H:i:s", time())]); + } static function getAllDevicesInRoom ($roomId = "") { return Db::loadAll ("SELECT * FROM devices WHERE room_id = ? AND approved != ?", Array($roomId, 2)); diff --git a/app/models/managers/SubDeviceManager.php b/app/models/managers/SubDeviceManager.php index d714e9f..143bd90 100644 --- a/app/models/managers/SubDeviceManager.php +++ b/app/models/managers/SubDeviceManager.php @@ -50,7 +50,7 @@ class SubDeviceManager } //check if dubdevice exist - + //Add History to be set in Creation public static function create($deviceId, $type, $unit) { $record = array( diff --git a/public/css/main.css b/public/css/main.css index b328f01..9520163 100644 --- a/public/css/main.css +++ b/public/css/main.css @@ -2660,19 +2660,19 @@ html { @font-face { font-family: 'Metropolis'; - src: url("../fonts/Metropolis-Regular.ttf"); + /*src: url("../fonts/Metropolis-Regular.ttf");*/ font-weight: 400; } @font-face { font-family: 'Metropolis'; - src: url("../fonts/Metropolis-Medium.ttf"); + /*src: url("../fonts/Metropolis-Medium.ttf");*/ font-weight: 500; } @font-face { font-family: 'Metropolis'; - src: url("../fonts/Metropolis-SemiBold.ttf"); + /*src: url("../fonts/Metropolis-SemiBold.ttf");*/ font-weight: 600; }