diff --git a/inc/lib/CIoT.class.php b/inc/lib/CIoT.class.php index b2cbbe8..bef9ceb 100644 --- a/inc/lib/CIoT.class.php +++ b/inc/lib/CIoT.class.php @@ -173,7 +173,7 @@ class CIoT { * @param $deviceId */ public static function getSensorAllData($deviceId){ - for($i=1; $i<11; $i++) { + for($i=1; $i<5; $i++) { $res = self::$DB->query('SELECT * FROM sensors WHERE device="'.$deviceId.'" and sensor="ds'.($i).'" ORDER BY id DESC LIMIT 1'); if($res) { $result['ds'.$i]['sensor'] = $res[0]['sensor']; diff --git a/index.php b/index.php index 5614c30..e0b6d05 100644 --- a/index.php +++ b/index.php @@ -2,7 +2,7 @@ require_once __DIR__ . '/inc/bootstrap.php'; require_once __DIR__ . '/inc/header.php'; -$cacheId = md5('CIoT::getDallasArrData_'.$USER['deviceId']); +$cacheId = md5('CIoT::getSensorsArrData_'.$USER['deviceId']); if(CCache::check($cacheId) and CCache::getAge($cacheId) < 60) { $arSensors = CCache::get($cacheId); @@ -70,7 +70,7 @@ if(CCache::check($cacheId) and CCache::getAge($cacheId) < 60) { }, dataType: "json" }); - }, 3000); + }, 30000); });