This commit is contained in:
JonatanRek 2020-02-11 15:09:15 +01:00
parent 21bcff9660
commit cb95a0f9b8
3 changed files with 7 additions and 7 deletions

View File

@ -79,8 +79,8 @@ try {
RecordManager::clean(RECORDTIMOUT);
} catch (\Exception $e) {
$logManager->write("[Record] cleaning record older that " . RECORDTIMOUT , LogRecordType::ERROR);
}
//Variables
$token = $obj['token'];
$values = null;
@ -158,7 +158,7 @@ if ($values != null || $values != "") {
if (!SubDeviceManager::getSubDeviceByMaster($deviceId, $key)) {
SubDeviceManager::create($deviceId, $key, UNITS[$key]);
}
RecordManager::create($deviceId, $key, round($value['value'],2));
RecordManager::create($deviceId, $key, round($value['value'],3));
$logManager->write("[API] Device_ID " . $deviceId . " writed value " . $key . ' ' . $value['value'], LogRecordType::INFO);
//notification

View File

@ -15,7 +15,7 @@
<?php
$partial = new Partial('menu');
$partial->prepare('item', 'rooms');
$partial->prepare('lang',$LANG);
$partial->prepare('langMng',$LANGMNG);
$partial->prepare('debugMod',$DEBUGMOD);
$partial->render();
?>
@ -30,7 +30,7 @@
<div class="">
<h1><?php echo $room['name']; ?></h1>
<?php foreach ($room['reading'] as $key => $value) { ?>
<?php echo $LANG[$key] .": ". $value; ?></br>
<?php echo $LANGMNG->get($key) .": ". $value; ?></br>
<?php } ?>
<?php if (DEBUGMOD == 1) { ?>
<pre>

View File

@ -6,7 +6,7 @@ class Rooms extends Template
function __construct()
{
global $userManager;
global $lang;
global $langMng;
if (!$userManager->isLogin()){
header('Location: ' . BASEDIR . 'login');
@ -17,7 +17,7 @@ class Rooms extends Template
$template->prepare('baseDir', BASEDIR);
$template->prepare('debugMod', DEBUGMOD);
$template->prepare('title', 'Rooms');
$template->prepare('lang', $lang);
$template->prepare('langMng', $langMng);
$roomsItems = [];
$roomsData = RoomManager::getAllRooms();