Пример #1
0
 public static function createFromDef($_def)
 {
     if (!isset($_def['packettype']) || !isset($_def['subtype']) || !isset($_def['id'])) {
         log::add('rfxcom', 'error', 'Information manquante pour ajouter l\'équipement : ' . print_r($_def, true));
         return;
     }
     $device = self::devicesParameters($_def['packettype']);
     if (!isset($device['subtype'][$_def['subtype']])) {
         log::add('rfxcom', 'info', 'Sous-type non trouvé : ' . print_r($_def, true) . ' dans : ' . print_r($device, true));
         return;
     }
     $rfxcom = rfxcom::byLogicalId($_def['id'], 'rfxcom');
     if (count($rfxcom) > 0) {
         $rfxcom = $rfxcom[0];
     }
     if (!is_object($rfxcom)) {
         $eqLogic = new rfxcom();
         $eqLogic->setName($_def['id']);
     }
     $eqLogic->setLogicalId($_def['id']);
     $eqLogic->setEqType_name('rfxcom');
     $eqLogic->setIsEnable(1);
     $eqLogic->setIsVisible(1);
     $eqLogic->setConfiguration('device', $_def['packettype'] . '::' . $_def['subtype']);
     $eqLogic->save();
     $eqLogic->applyModuleConfiguration();
 }
Пример #2
0
/* This file is part of Jeedom.
 *
 * Jeedom is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Jeedom is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Jeedom. If not, see <http://www.gnu.org/licenses/>.
 */
try {
    require_once dirname(__FILE__) . '/../../../../core/php/core.inc.php';
    include_file('core', 'authentification', 'php');
    if (!isConnect('admin')) {
        throw new Exception('401 Unauthorized');
    }
    if (init('action') == 'stopDeamon') {
        rfxcom::stopDeamon();
        ajax::success();
    }
    throw new Exception('Aucune methode correspondante');
    /*     * *********Catch exeption*************** */
} catch (Exception $e) {
    ajax::error(displayExeption($e), $e->getCode());
}
Пример #3
0
function remove()
{
    if (rfxcom::deamonRunning()) {
        rfxcom::stopDeamon();
    }
}
Пример #4
0
                            </div>
                        </div>
                    </fieldset> 
                </form>
            </div>
            <div class="col-lg-6">
                <form class="form-horizontal">
                    <fieldset>
                        <legend>Informations</legend>
                        <div class="form-group">
                            <label class="col-lg-2 control-label">Equipement</label>
                            <div class="col-lg-8">
                                <select class="eqLogicAttr form-control" data-l1key="configuration" data-l2key="device">
                                    <option value="">Aucun</option>
                                    <?php 
foreach (rfxcom::devicesParameters() as $packettype => $info) {
    foreach ($info['subtype'] as $subtype => $subInfo) {
        echo '<option value="' . $packettype . '::' . $subtype . '">' . $info['name'] . ' - ' . $subInfo['name'] . '</option>';
    }
}
?>
                                </select>
                            </div>
                        </div>
                    </fieldset> 
                </form>
            </div>
        </div>

        <legend>PushingBox</legend>
Пример #5
0
}
$message = '';
foreach ($_GET as $key => $value) {
    $message .= $key . '=>' . $value . ' ';
}
log::add('rfxcom', 'event', 'Evenement : ' . $message);
if (!isset($_GET['id'])) {
    return;
}
$rfxcom = rfxcom::byLogicalId($_GET['id'], 'rfxcom');
if (count($rfxcom) > 0) {
    $rfxcom = $rfxcom[0];
}
if (!is_object($rfxcom)) {
    rfxcom::createFromDef($_GET);
    $rfxcom = rfxcom::byLogicalId($_GET['id'], 'rfxcom');
    if (count($rfxcom) > 0) {
        $rfxcom = $rfxcom[0];
    }
    if (!is_object($rfxcom)) {
        return;
    }
}
if ($_GET['packettype'] == 11) {
    $logicalId = 'bt';
    if ($_GET['command'] == 'Group') {
        $logicalId = 'gr';
    }
    $logicalId .= $_GET['unitcode'];
    if (isset($_GET['dimlevel'])) {
        $_GET[$logicalId] = $_GET['dimlevel'];