示例#1
0
 *
 * 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());
    }
    if (init('action') == 'getDeviceConfiguration') {
        $eqLogic = zwave::byId(init('id'));
        if (!is_object($eqLogic)) {