Example #1
0
 public static function restore()
 {
     try {
         sonos3::syncSonos();
     } catch (Exception $e) {
     }
 }
Example #2
0
function sonos3_install()
{
    $cron = cron::byClassAndFunction('sonos3', 'pull');
    if (!is_object($cron)) {
        $cron = new cron();
        $cron->setClass('sonos3');
        $cron->setFunction('pull');
        $cron->setEnable(1);
        $cron->setDeamon(1);
        $cron->setDeamonSleepTime(5);
        $cron->setSchedule('* * * * *');
        $cron->setTimeout(1440);
        $cron->save();
    }
    try {
        sonos3::syncSonos();
    } catch (Exception $e) {
    }
}
Example #3
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 - Accès non autorisé', __FILE__));
    }
    if (init('action') == 'syncSonos') {
        sonos3::syncSonos();
        ajax::success();
    }
    if (init('action') == 'getQueue') {
        $sonos = sonos3::byId(init('id'));
        if (!is_object($sonos)) {
            ajax::success();
        }
        ajax::success($sonos->getQueue());
    }
    if (init('action') == 'playTrack') {
        $sonos = sonos3::byId(init('id'));
        if (!is_object($sonos)) {
            ajax::success();
        }
        ajax::success($sonos->playTrack(init('position')));