Compare commits

...

2 Commits

Author SHA1 Message Date
GamerClassN7
cb45cf9e22 Fixes 2021-01-06 19:23:12 +01:00
GamerClassN7
47a5f71d9b Tweeks 2021-01-05 21:35:12 +01:00
2 changed files with 17 additions and 3 deletions

View File

@ -5,6 +5,21 @@ class Device extends Template
{
function __construct($sortBy = null, $sortType = null)
{
// //Notification data setup
// $notificationMng = new NotificationManager;
// $notificationData = [
// 'title' => 'Info',
// 'body' => 'New device Detected Found',
// 'icon' => 'http://dev.steelants.cz/projekty/simplehome-client/img/icons/favicon-16x16.png',
// ];
// //Notification for newly added Device
// if ($notificationData != []) {
// $subscribers = $notificationMng::getSubscription();
// foreach ($subscribers as $key => $subscriber) {
// $notificationMng::sendSimpleNotification(SERVERKEY, $subscriber['token'], $notificationData);
// }
// }
$userManager = new UserManager();
$deviceManager = new DeviceManager();
$subDeviceManager = new SubDeviceManager();
@ -54,8 +69,8 @@ class Device extends Template
//Signal Stenght
$subdevice = $subDeviceManager->getSubDeviceByMasterAndType($device['device_id'], "wifi");
$subdeviceLocal = $subDeviceManager->getSubDeviceByMaster($device['device_id']);
if (!empty ($subdeviceLocal)) {
$devices[$key]['history'] = (!empty ($subdeviceLocal['history']) ? $subdeviceLocal['history'] : 0);
if (!empty($subdeviceLocal)) {
$devices[$key]['history'] = (!empty($subdeviceLocal['history']) ? $subdeviceLocal['history'] : 0);
} else {
$devices[$key]['history'] = "null";
}

View File

@ -60,7 +60,6 @@ const UNITS = [
//Notifications
define('SERVERKEY','');
define('SERVERVAIPKEY','');
//TODO: Po registraci vzít výchozí hodnoty
//Default network Setting