Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions core/api/mobile.api.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ function saveMenuFromAppV2($menu, $mobile)
log::add('mobile', 'debug', '| [INFO] Configs > ' . json_encode($configs));
log::add('mobile', 'debug', '| [INFO] Geolocs > ' . json_encode($geolocs));
//log::add('mobile', 'debug', '| [INFO] Menu > ' . json_encode($menu));
log::add('mobile', 'debug', '| [INFO] Notification > ' . json_encode($notification));
log::add('mobile', 'debug', '| [INFO] Notification ─▶︎ ' . json_encode($notification));
$mobile = null;
if (isset($params['Iq'])) {
$mobile = eqLogic::byLogicalId($params['Iq'], 'mobile');
Expand All @@ -142,7 +142,7 @@ function saveMenuFromAppV2($menu, $mobile)
$mobile->setConfiguration('type_mobile', $notification['platform']);
if (isset($notification['token'])) {
if ($notification['token'] != '') {
log::add('mobile', 'debug', '| Token à ajouter > ' . $notification['token']);
log::add('mobile', 'debug', '| Token à ajouter ─▶︎ ' . $notification['token']);
$mobile->setConfiguration('notificationRegistrationToken', $notification['token']);
if ($notification['token'] == 'notifsBGDisabled') {
message::removeAll("mobile", 'alertNotifs');
Expand All @@ -156,12 +156,12 @@ function saveMenuFromAppV2($menu, $mobile)
$notifsTime = intval($notification['notifsTime']);
if ($mobile->getConfiguration('notifsTime', 30) != $notifsTime) {
$mobile->setConfiguration('notifsTime', $notifsTime);
log::add('mobile', 'debug', '| [INFO] New notifsTime > ' . intval($notification['notifsTime']));
log::add('mobile', 'debug', '| [INFO] New notifsTime ─▶︎ ' . intval($notification['notifsTime']));
$mobile->cleaningNotifications();
}
}
if (is_object($user = user::byHash($params['apikey']))) {
log::add('mobile', 'debug', '| [INFO] affect_user > ' . $user->getLogin() . ' (' . $user->getId() . ')');
log::add('mobile', 'debug', '| [INFO] affect_user ─▶︎ ' . $user->getLogin() . ' (' . $user->getId() . ')');
$mobile->setConfiguration('affect_user', $user->getId());
}
$mobile->save();
Expand Down Expand Up @@ -195,8 +195,8 @@ function saveMenuFromAppV2($menu, $mobile)
log::add('mobile', 'debug', '┌─────▶︎ AppV2 setCustomMenu ─────────────────');
$configs = $params['configs'];
$menu = $configs['menu'];
log::add('mobile', 'debug', '| [INFO] Configs > ' . json_encode($configs));
log::add('mobile', 'debug', '| [INFO] Menu > ' . json_encode($menu));
log::add('mobile', 'debug', '| [INFO] Configs ─▶︎ ' . json_encode($configs));
log::add('mobile', 'debug', '| [INFO] Menu ─▶︎ ' . json_encode($menu));
$mobile = null;
if (isset($params['Iq']) && is_object($mobile = eqLogic::byLogicalId($params['Iq'], 'mobile'))) {
saveMenuFromAppV2($menu, $mobile);
Expand Down Expand Up @@ -255,7 +255,7 @@ function saveMenuFromAppV2($menu, $mobile)
$return[$idBox]['informations']['plugins'] = $arrayPlugins;
$return[$idBox]['informations']['changelog'] = $changeLogs;
$return[$idBox]['informations']['infosDemon'] = $deamons_infos;
log::add('mobile', 'debug', '| [INFO] Retour vers App > ' . json_encode($return));
log::add('mobile', 'debug', '| [INFO] Retour vers App ─▶︎ ' . json_encode($return));
log::add('mobile', 'debug', '└───────────────────────────────────────────');
$jsonrpc->makeSuccess($return);
}
Expand Down Expand Up @@ -336,8 +336,8 @@ function saveMenuFromAppV2($menu, $mobile)
$return[$idBox]['jeedom_version'] = jeedom::version();
$return[$idBox]['rdk'] = $rdk;
$return[$idBox]['name'] = config::byKey('name') == '' ? 'Jeedom' : config::byKey('name');
log::add('mobile', 'debug', '| [INFO] Retour de base > ' . json_encode($return));
log::add('mobile', 'debug', '| Recherche du mobile via sont Iq > ' . $params['Iq']);
log::add('mobile', 'debug', '| [INFO] Retour de base ─▶︎ ' . json_encode($return));
log::add('mobile', 'debug', '| Recherche du mobile via sont Iq ─▶︎ ' . $params['Iq']);
$mobile = eqLogic::byLogicalId($params['Iq'], 'mobile');
$return[$idBox]['configs'] = array();
$return[$idBox]['miscellanousParams'] = array();
Expand Down Expand Up @@ -367,15 +367,15 @@ function saveMenuFromAppV2($menu, $mobile)
*/
if ($jsonrpc->getMethod() == 'getCustomMenu') {
log::add('mobile', 'debug', '┌─────◀︎ AppV2 getCustomMenu ────────────────────');
log::add('mobile', 'debug', '| Recherche du mobile via sont Iq > ' . $params['Iq']);
log::add('mobile', 'debug', '| Recherche du mobile via sont Iq ─▶︎ ' . $params['Iq']);
$mobile = eqLogic::byLogicalId($params['Iq'], 'mobile');
if (is_object($mobile)) {
log::add('mobile', 'debug', '| OK Mobile trouvé > ' . $mobile->getName());
log::add('mobile', 'debug', '| OK Mobile trouvé ─▶︎ ' . $mobile->getName());
$menu = $mobile->configMenuCustom();
} else {
$menu = mobile::getMenuDefaultTab();
}
log::add('mobile', 'debug', '| [INFO] Retour vers App > ' . json_encode($menu));
log::add('mobile', 'debug', '| [INFO] Retour vers App ─▶︎ ' . json_encode($menu));
log::add('mobile', 'debug', '└───────────────────────────────────────────');
$jsonrpc->makeSuccess($menu);
}
Expand Down Expand Up @@ -462,7 +462,7 @@ function saveMenuFromAppV2($menu, $mobile)
$textCasse = strtolower($params['text']);
}
$cmd = $mobile->getCmd(null, 'notif');
log::add('mobile', 'debug', '| Réponse : ' . $textCasse . ' - IQ > ' . $params['Iq'] . ' -- Demande cmd > ' . $cmd->getId());
log::add('mobile', 'debug', '| Réponse : ' . $textCasse . ' - IQ ─▶︎ ' . $params['Iq'] . ' -- Demande cmd ─▶︎ ' . $cmd->getId());
if ($cmd->askResponse($textCasse)) {
log::add('mobile', 'debug', '| ASK bien trouvé : Réponse validée');
} else {
Expand Down Expand Up @@ -491,7 +491,7 @@ function saveMenuFromAppV2($menu, $mobile)
$filePath = dirname(__FILE__) . '/../data/notifications/' . $Iq . '.json';
$idNotif = $params['idNotif'];
$choiceAsk = $params['choiceAsk'];
log::add('mobile', 'debug', '| Réponse ASK > ' . $Iq . ' > ' . $idNotif . ' > ' . $choiceAsk);
log::add('mobile', 'debug', '| Réponse ASK ─▶︎ ' . $Iq . ' > ' . $idNotif . ' > ' . $choiceAsk);
if (file_exists($filePath)) {
$notifications = file_get_contents($filePath);
$notificationsArray = json_decode($notifications, true);
Expand Down
14 changes: 7 additions & 7 deletions core/class/mobile.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -624,26 +624,26 @@ public static function EventGeoloc($geoloc)
{
/******************** APP V1 *************************/
log::add('mobile', 'debug', '|┌──:fg-success: jsonPublish :/fg:──');
log::add('mobile', 'debug', '| Geoloc Event du mobile > ' . $geoloc['Iq'] . ' pour ' . $geoloc['id']);
log::add('mobile', 'debug', '| Geoloc Event du mobile ─▶︎ ' . $geoloc['Iq'] . ' pour ' . $geoloc['id']);
$eqLogicMobile = eqLogic::byLogicalId($geoloc['Iq'], 'mobile');
$cmdgeoloc = cmd::byEqLogicIdAndLogicalId($eqLogicMobile->getId(), 'geoId_' . $geoloc['id']);
$cmdgeolocv2 = cmd::byEqLogicIdAndLogicalId($eqLogicMobile->getId(), 'geoloc_' . $geoloc['id']);
if (is_object($cmdgeoloc)) {
log::add('mobile', 'debug', 'commande trouvé');
log::add('mobile', 'debug', '| commande trouvé');
if ($geoloc['value'] !== $cmdgeoloc->execCmd()) {
log::add('mobile', 'debug', 'Valeur non pareille.');
log::add('mobile', 'debug', '| Valeur non identique');
$cmdgeoloc->event($geoloc['value']);
} else {
log::add('mobile', 'debug', '| Valeur pareille. ─▶︎ ' . $geoloc['value'] . ' / ' . $cmdgeoloc->execCmd());
log::add('mobile', 'debug', '| Valeur identique ─▶︎ ' . $geoloc['value'] . ' / ' . $cmdgeoloc->execCmd());
}
}
if (is_object($cmdgeolocv2)) {
log::add('mobile', 'debug', 'commande trouvé');
log::add('mobile', 'debug', '| commande trouvé');
if ($geoloc['value'] !== $cmdgeolocv2->execCmd()) {
log::add('mobile', 'debug', 'Valeur non pareille.');
log::add('mobile', 'debug', '| Valeur non identique');
$cmdgeolocv2->event($geoloc['value']);
} else {
log::add('mobile', 'debug', '| Valeur pareille. ─▶︎ ' . $geoloc['value'] . ' / ' . $cmdgeolocv2->execCmd());
log::add('mobile', 'debug', '| Valeur identique ─▶︎ ' . $geoloc['value'] . ' / ' . $cmdgeolocv2->execCmd());
}
}
log::add('mobile', 'debug', '|└────────────────────');
Expand Down