* 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/>.
 */
if (!isConnect('admin')) {
    throw new Exception('401 Unauthorized');
}
sendVarToJs('node_id', init('id'));
$listServerZwave = openzwave::listServerZwave();
sendVarToJs('path', $listServerZwave[init('serverId')]['path'] . '/');
?>
<style media="screen" type="text/css">
	.noscrolling{
		width:99%;
		overflow: hidden;
	}
	.node-item{
		border: 1px solid;
	}
	.greeniconcolor {color:green;}
	.yellowiconcolor {color:#FFD700;}
	.rediconcolor {color:red;}
	.modal-dialog-center {
		margin: 0;
Beispiel #2
0
          <input type="checkbox" class="eqLogicAttr bootstrapSwitch" data-label-text="{{Activer}}" data-l1key="isEnable" checked/>
          <input type="checkbox" class="eqLogicAttr bootstrapSwitch" data-label-text="{{Visible}}" data-l1key="isVisible" checked/>
        </div>
      </div>
      <div class="form-group expertModeVisible">
        <label class="col-sm-4 control-label">{{Node ID}}</label>
        <div class="col-sm-2">
          <input type="text" class="eqLogicAttr form-control" data-l1key="logicalId" />
        </div>
      </div>
      <div class="form-group expertModeVisible">
        <label class="col-sm-4 control-label">{{Serveur}}</label>
        <div class="col-sm-4">
         <select class="form-control eqLogicAttr" data-l1key="configuration" data-l2key="serverID">
          <?php 
foreach (openzwave::listServerZwave() as $id => $server) {
    if (isset($server['name'])) {
        echo '<option value="' . $id . '">' . $server['name'] . '</option>';
    }
}
?>
      </select>
    </div>
  </div>
  <div class="form-group expertModeVisible">
    <label class="col-sm-4 control-label">{{Délai maximum autorisé entre 2 messages (min)}}</label>
    <div class="col-sm-4">
      <input class="eqLogicAttr form-control" data-l1key="timeout" />
    </div>
  </div>
</fieldset>
 }
 if (init('action') == 'restartDeamon') {
     $cron = cron::byClassAndFunction('zwave', 'pull');
     if (is_object($cron)) {
         $cron->stop();
     }
     ajax::success();
 }
 if (init('action') == 'getControllerState') {
     ajax::success(openzwave::callOpenzwave('/ZWaveAPI/Run/network.GetControllerStatus()', init('serverID')));
 }
 if (init('action') == 'callRazberry') {
     ajax::success(openzwave::callOpenzwave(init('call'), init('serverId', 1)));
 }
 if (init('action') == 'listServerZwave') {
     ajax::success(openzwave::listServerZwave());
 }
 if (init('action') == 'autoDetectModule') {
     $eqLogic = openzwave::byId(init('id'));
     if (!is_object($eqLogic)) {
         throw new Exception(__('Zwave eqLogic non trouvé : ', __FILE__) . init('id'));
     }
     foreach ($eqLogic->getCmd() as $cmd) {
         $cmd->remove();
     }
     $eqLogic->createCommand(true);
     ajax::success();
 }
 if (init('action') == 'migrateZwave') {
     $cmd = 'sudo php ' . dirname(__FILE__) . '/../../script/migrate.php';
     $cmd .= ' >> ' . log::getPathToLog('openzwave_migrate') . ' 2>&1 &';