public static function pull() { $events = internalEvent::getNewInternalEvent('alarm'); foreach ($events as $event) { if ($event->getEvent() == 'event::cmd') { $trigger_id = $event->getOptions('id'); if (is_numeric($trigger_id)) { $eqLogics = eqLogic::byTypeAndSearhConfiguration('alarm', '#' . $trigger_id . '#'); if (is_array($eqLogics) && count($eqLogics) != 0) { foreach ($eqLogics as $eqLogic) { $eqLogic->launch($trigger_id, $event->getOptions('value')); } } } } } }
public static function getFromMarket(&$market, $_path) { $cibDir = dirname(__FILE__) . '/../config/devices/'; if (!file_exists($cibDir)) { throw new Exception('Impossible d\'installer la configuration du module le repertoire n\\éxiste pas : '******'/'); $zip->close(); } else { throw new Exception('Impossible de décompresser le zip : ' . $_path); } $moduleFile = dirname(__FILE__) . '/../config/devices/' . $market->getLogicalId() . '.php'; if (!file_exists($moduleFile)) { throw new Exception('Echec de l\'installation. Impossible de trouver le module ' . $moduleFile); } foreach (eqLogic::byTypeAndSearhConfiguration('zwave', $market->getLogicalId()) as $eqLogic) { $eqLogic->applyModuleConfiguration(); } }