예제 #1
0
 * 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') == 'syncEqLogicWithRazberry') {
        zwave::syncEqLogicWithRazberry();
        ajax::success();
    }
    if (init('action') == 'changeIncludeState') {
        zwave::changeIncludeState(init('mode'), init('state'));
        ajax::success();
    }
    if (init('action') == 'getCommandClassInfo') {
        ajax::success(zwave::getCommandClassInfo(init('class')));
    }
    if (init('action') == 'getModuleInfo') {
        $eqLogic = zwave::byId(init('id'));
        if (!is_object($eqLogic)) {
            throw new Exception('Razberry plugin non trouvé : ' . init('id'));
        }
        ajax::success($eqLogic->getInfo());
예제 #2
0
 * 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 - Accès non autorisé', __FILE__));
    }
    if (init('action') == 'syncEqLogicWithRazberry') {
        foreach (zwave::listServerZway() as $serverID => $server) {
            if (isset($server['name'])) {
                zwave::syncEqLogicWithRazberry($serverID);
            }
        }
        ajax::success();
    }
    if (init('action') == 'changeIncludeState') {
        zwave::changeIncludeState(init('mode'), init('state'), init('serverID'));
        ajax::success();
    }
    if (init('action') == 'showNotification') {
        ajax::success(zwave::showNotification(init('serverID')));
    }
    if (init('action') == 'updateZwayServer') {
        zwave::updateZwayServer(init('version'));
        ajax::success();
    }