<project version="4">
<component name="ChangeListManager">
<list default="true" id="352ce63a-b52a-41a2-979b-becda7920939" name="Default" comment=".">
+ <change afterPath="$PROJECT_DIR$/scripts/checkstate.php" afterDir="false" />
+ <change afterPath="$PROJECT_DIR$/scripts/pcgames.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/scripts/lib/ecomode.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/ecomode.php" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/scripts/lib/medialibrary.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/medialibrary.php" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/scripts/lib/mediarasp.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/mediarasp.php" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/scripts/lib/pc.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/pc.php" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/scripts/lib/scenes.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/scenes.php" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/scripts/lib/squeezebox.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/squeezebox.php" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/scripts/media.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/media.php" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/scripts/squeeze.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/squeeze.php" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/servers/domoticz.php" beforeDir="false" afterPath="$PROJECT_DIR$/servers/domoticz.php" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/config/media.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/media.php" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/config/rooms.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/rooms.php" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/js/home.js" beforeDir="false" afterPath="$PROJECT_DIR$/js/home.js" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/scripts/lib/lib.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/lib.php" afterDir="false" />
</list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<workItem from="1570487789445" duration="14000" />
<workItem from="1570487824771" duration="196000" />
<workItem from="1570898873609" duration="7576000" />
- <workItem from="1571207547358" duration="1665000" />
- </task>
- <task id="LOCAL-00186" summary=".">
- <created>1562398828376</created>
- <option name="number" value="00186" />
- <option name="presentableId" value="LOCAL-00186" />
- <option name="project" value="LOCAL" />
- <updated>1562398828377</updated>
+ <workItem from="1571207547358" duration="2774000" />
+ <workItem from="1571379187683" duration="3078000" />
+ <workItem from="1571384814081" duration="5000" />
+ <workItem from="1571569117453" duration="3639000" />
</task>
<task id="LOCAL-00187" summary=".">
<created>1562430926369</created>
<option name="project" value="LOCAL" />
<updated>1569663460125</updated>
</task>
- <option name="localTasksCounter" value="235" />
+ <task id="LOCAL-00235" summary=".">
+ <created>1571209734092</created>
+ <option name="number" value="00235" />
+ <option name="presentableId" value="LOCAL-00235" />
+ <option name="project" value="LOCAL" />
+ <updated>1571209734093</updated>
+ </task>
+ <option name="localTasksCounter" value="236" />
<servers />
</component>
<component name="TodoView">
$shortcuts['media'][] = ['label' => 'Films', 'type' => 'sub', 'sub' => 'movies'];
if ($device == 'salon' || $device == 'bureau') {
$shortcuts['media'][] = ['label' => 'Nintendo Switch', 'type' => 'harmonyactivity', 'activity' => 'nintendo-switch'];
+ $shortcuts['media'][] = ['label' => 'Jeux PC', 'type' => 'ajax', 'url' => '/scripts/pcgames.php'];
$shortcuts['media'][] = ['label' => 'Vidéo web', 'type' => 'raspberrycast'];
}
profile('Got recents', __FILE__, __LINE__);
}
-if(is_array($media)) {
+if (is_array($media)) {
foreach ($media as $id => $mediagroup) {
if ($id == 'x' && !isset($_GET['x'])) {
continue;
function home()
{
$favorites = [
- ['type' => 'light', 'scene' => 'home/welcome', 'label' => 'Bienvenue'],
+ ['type' => 'light', 'scene' => 'home/welcome', 'label' => 'Bienvenue', 'confirm' => ['message' => 'Quelqu\'un dort peut-être. Veuillez confirmer votre action.', 'conditions' => ['night' => '1']]],
['type' => 'light', 'scene' => 'home/off', 'label' => 'éteindre'],
];
$all = array_merge($favorites, [
return true;
});
+ $(document).on(clickevent, '[data-confirm]:not(.confirmok)', function (e) {
+ var $this = $(this);
+ e.preventDefault();
+ e.stopPropagation();
+ e.stopImmediatePropagation();
+
+ var needsconfirm;
+ $.get('scripts/checkstate.php?state=' + encodeURIComponent($(this).attr('data-confirm')), function (data) {
+ needsconfirm = data === '1';
+
+ if (!needsconfirm || window.confirm($this.data('confirm-message'))) {
+ $this.addClass('confirmok');
+ $this.click();
+ setTimeout(function () {
+ $this.removeClass('confirmok');
+ }, 500);
+ }
+ });
+
+ return false;
+ });
+
$(document).on(clickevent, '[data-volume]', function () {
$.get('scripts/volume.php?volume=' + $(this).data('volume') + '%');
return true;
--- /dev/null
+<?php
+require_once "import.php";
+
+$state = json_decode($_GET['state']);
+$res = true;
+foreach ($state as $k => $v) {
+ if (getState($k) != $v) {
+ $res = false;
+ break;
+ }
+}
+header('Content-Type: text/plain');
+echo $res ? '1' : '0';
\ No newline at end of file
$swcorner = '';
- if ($s['type'] == 'task') {
+ if ($s['type'] == 'ajax') {
+ $attrs['class'] = 'ajax';
+ $attrs['href'] = $s['url'];
+ } elseif ($s['type'] == 'task') {
$attrs['class'] = 'ajax';
$attrs['href'] = 'scripts/tortugatask.php?task=' . $s['command'];
} elseif ($s['type'] == 'light') {
$attrs['data-volume'] = $s['volume'];
}
+ if (isset($s['confirm'])) {
+ $attrs['data-confirm'] = json_encode($s['confirm']['conditions']);
+ $attrs['data-confirm-message'] = $s['confirm']['message'];
+ }
+
+
if (isset($html)) {
$res = $html;
} else {
--- /dev/null
+<?php
+require_once "import.php";
+
+if (config('DEVICE') == 'salon') {
+ harmonyActivity('media');
+ sshCommand('killall fbi', 'salon', false,true);
+ sshCommand('DISPLAY=:0 remmina -c /home/pi/.local/share/remmina/1571565005433.remmina', 'salon');
+}
\ No newline at end of file