function broadcast($arr) { $push = new PushMessage(); if (isset($arr['secret'])) { $push->sendMessageAll('at_commands', 'geoi'); } else { $push->sendMessageAll('at_commands', 'geo'); } http_response_code(202); }
function notify($arr) { if (isset($arr['msg'])) { if (isset($arr['id'])) { // TODO } else { $msg = $arr['msg']; $push = new PushMessage(); $push->sendMessageAll('Atlantis', $msg); http_response_code(202); } } else { http_response_code(404); } }
$arrMvt2[$i] = $zwave->GetTimestamp($sensor['sensor']); execScenario($i, $scenarios); if ($mode->getMode() == Mode::AWAY) { $alarm->execAlarm(); } } break; } } else { if ($sensor['type'] == 'Tamper') { switch ($sensor['protocol']) { case 'zwave': if ($zwave->GetTimestamp($sensor['sensor']) != $arrMvt2[$i]) { $arrMvt2[$i] = $zwave->GetTimestamp($sensor['sensor']); $txt = "Le capteur " . $sensor['alias'] . " dans " . $sensor['room_label'] . " a ete trafique !"; $push->sendMessageAll("Atlantis - Alarme", $txt); } break; } } else { if ($sensor['type'] == 'Temperature') { switch ($sensor['protocol']) { case 'zwave': if ($settings->getSettings('Security', 'temperature')) { //TODO } break; } } } }