]> _ Git - tortuga-home.git/commitdiff
.
authorVincent <vincent@enhydra.fr>
Tue, 28 Jan 2020 10:01:49 +0000 (11:01 +0100)
committerVincent <vincent@enhydra.fr>
Tue, 28 Jan 2020 10:01:49 +0000 (11:01 +0100)
.idea/workspace.xml
config/rooms.php
gradient.php
scripts/gradient.php
scripts/lib/scenes.php
scripts/youtubedl-download.php

index ea91c5a6afb065e59279fcdfdba8da83af8fecf7..cda8924ccca7465312101a18cb4be77a815176f7 100644 (file)
@@ -3,12 +3,11 @@
   <component name="ChangeListManager">
     <list default="true" id="352ce63a-b52a-41a2-979b-becda7920939" name="Default" comment=".">
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/config/global.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/global.php" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/scripts/lib/remoteinfos.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/remoteinfos.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/config/rooms.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/rooms.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/gradient.php" beforeDir="false" afterPath="$PROJECT_DIR$/gradient.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/scripts/gradient.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/gradient.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/pcgames.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/pcgames.php" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/scripts/squeeze.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/squeeze.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/scripts/youtubedl-download.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/youtubedl-download.php" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
       <workItem from="1579457368919" duration="5928000" />
       <workItem from="1579773474654" duration="57000" />
       <workItem from="1579773545061" duration="651000" />
-      <workItem from="1579853532996" duration="4039000" />
-    </task>
-    <task id="LOCAL-00232" summary=".">
-      <created>1568881166470</created>
-      <option name="number" value="00232" />
-      <option name="presentableId" value="LOCAL-00232" />
-      <option name="project" value="LOCAL" />
-      <updated>1568881166470</updated>
+      <workItem from="1579853532996" duration="4655000" />
+      <workItem from="1580059999939" duration="5604000" />
     </task>
     <task id="LOCAL-00233" summary=".">
       <created>1569056409835</created>
       <option name="project" value="LOCAL" />
       <updated>1579775430862</updated>
     </task>
-    <option name="localTasksCounter" value="281" />
+    <task id="LOCAL-00281" summary=".">
+      <created>1579858821017</created>
+      <option name="number" value="00281" />
+      <option name="presentableId" value="LOCAL-00281" />
+      <option name="project" value="LOCAL" />
+      <updated>1579858821017</updated>
+    </task>
+    <option name="localTasksCounter" value="282" />
     <servers />
   </component>
   <component name="TypeScriptGeneratedFilesManager">
       <screen x="0" y="0" width="2560" height="1040" />
     </state>
     <state x="872" y="242" key="Vcs.Push.Dialog.v2/0.0.2560.1040@0.0.2560.1040" timestamp="1578558711439" />
-    <state x="976" y="343" key="com.intellij.ide.util.TipDialog" timestamp="1579853534008">
+    <state x="976" y="343" key="com.intellij.ide.util.TipDialog" timestamp="1580060000258">
       <screen x="0" y="0" width="2560" height="1040" />
     </state>
     <state x="732" y="343" key="com.intellij.ide.util.TipDialog/0.0.1920.1040@0.0.1920.1040" timestamp="1577380394903" />
     <state x="732" y="383" key="com.intellij.ide.util.TipDialog/0.0.1920.1160@0.0.1920.1160" timestamp="1575647093028" />
-    <state x="976" y="343" key="com.intellij.ide.util.TipDialog/0.0.2560.1040@0.0.2560.1040" timestamp="1579853534008" />
-    <state x="977" y="257" width="607" height="536" key="find.popup" timestamp="1579857029996">
+    <state x="976" y="343" key="com.intellij.ide.util.TipDialog/0.0.2560.1040@0.0.2560.1040" timestamp="1580060000258" />
+    <state x="977" y="257" width="607" height="536" key="find.popup" timestamp="1580119054549">
       <screen x="0" y="0" width="2560" height="1040" />
     </state>
     <state x="732" y="257" width="607" height="536" key="find.popup/0.0.1920.1040@0.0.1920.1040" timestamp="1577380471547" />
-    <state x="977" y="257" width="607" height="536" key="find.popup/0.0.2560.1040@0.0.2560.1040" timestamp="1579857029996" />
+    <state x="977" y="257" width="607" height="536" key="find.popup/0.0.2560.1040@0.0.2560.1040" timestamp="1580119054549" />
     <state x="936" y="240" key="run.anything.popup" timestamp="1578386519646">
       <screen x="0" y="0" width="2560" height="1040" />
     </state>
index c41b9f43216ff9b77022f3b93aaa8433b35a2a76..7f5c6cc29e58fbc1625295d5c1f6c232ee263df9 100644 (file)
@@ -83,7 +83,7 @@ function bureau()
 
     $all = array_merge($favorites, [
         ['type' => 'light', 'scene' => 'bureau/boreal', 'label' => 'Aurore boréale'],
-        ['type' => 'light', 'scene' => 'bureau/savane', 'label' => 'Savane'],
+        ['type' => 'light', 'scene' => 'bureau/tchernobyl', 'label' => 'Чорнобиль'],
         ['type' => 'light', 'scene' => 'bureau/tonic', 'label' => 'Tonique'],
         ['type' => 'light', 'scene' => 'bureau/flowers', 'label' => 'Printemps floral'],
         ['type' => 'light', 'scene' => 'bureau/tropical', 'label' => 'Crépuscule tropical'],
index 1aa174819085319180f21b75bae510d7db52cd71..8945dc60e8d0b67a4e7f11393750466bc52cde0f 100644 (file)
@@ -41,6 +41,7 @@
                             css.backgroundImage = 'none';
                             //videoURL = data.data.video_path;
                             videoURL = data.data.video_path.replace('/nas/', 'file:///Z:/');
+                            videoURL = videoURL.replace('file:///Z:/Videos/YoutubeDL', 'file:///C:/YoutubeDL');
                             startVideo = 1;
                             if (data.data.start) {
                                 startVideo = data.data.start;
index a173633c205346a7c87cb3bc1b4809ac3ff0333e..dbdaab60add8c4b0e906a5edca0ea3e46478e9f0 100644 (file)
@@ -18,6 +18,10 @@ switch ($c) {
         $type = 'image';
         $res = ['image' => '/images/ambiance/savane.jpg', 'position' => '50% 0%'];
         break;
+    case 'tchernobyl':
+        $type = 'youtube';
+        $res = ['videoid' => '9ulX-VkvaBQ', 'start' => 1];
+        break;
     case 'boreal':
 //             $type = 'image';
 //             $res = ['image' => '/images/ambiance/borealis.jpg', 'position' => '50% 100%'];
@@ -38,8 +42,8 @@ switch ($c) {
         break;
     case 'focus':
     case 'tonic':
-        $type = 'gradient';
-        $res = ['#dffffc', '#53ffee'];
+        $type = 'youtube';
+        $res = ['videoid' => 'gosjiD288Jk', 'start' => 5];
         break;
     case 'lecture':
     case 'chillout':
@@ -81,7 +85,7 @@ if ($type == 'gradient' && (!is_array($res) || !count($res))) {
     $res = ['#ffffff', '#ffffff'];
 }
 if ($type == 'youtube') {
-    $res['video_path'] = downloadYoutubeDL('https://www.youtube.com/watch?v=' . $res['videoid'],0, false, 'webm');
+    $res['video_path'] = downloadYoutubeDL('https://www.youtube.com/watch?v=' . $res['videoid'], 0, false, 'webm');
 }
 header('Content-type: application/json');
 $r = ['type' => $type, 'data' => $res];
index 0eb5ec32cf0907d20930f02fd9845d051035183e..217c3a9843b264706ace2e9f7e550368ec3c4af5 100644 (file)
@@ -193,11 +193,14 @@ $scenes = [
         ['type' => 'scene', 'scene' => 'chambre/cheminee'],
     ],
     'chambre/off' => [
+        ['type' => 'scene', 'scene' => 'chambre/off/exceptcheminee'],
+        ['type' => 'scene', 'scene' => 'chambre/cheminee/off'],
+    ],
+    'chambre/off/exceptcheminee' => [
         ['type' => 'function', 'function' => 'chambreAuto', 'args' => [false]],
         ['type' => 'state', 'key' => 'chambre', 'value' => 0],
         ['type' => 'hue', 'group' => $chambre, 'scene' => array('on' => false, 'brightness' => 0)],
         ['type' => 'insteon', 'command' => '0?1332=I=0=0'],
-        ['type' => 'scene', 'scene' => 'chambre/cheminee/off'],
     ],
     'chambre/bedoff' => [
         ['type' => 'nightmode', 'mode' => '1'],
@@ -286,31 +289,29 @@ $scenes = [
     ],
     'salon/on' => [
         ['type' => 'hue', 'group' => $salon, 'scene' => 'Gte8sl76rzAD1wO'],
-        ['type' => 'domoticz', 'scene' => '3', 'command' => true],
         ['type' => 'insteon', 'command' => '0?113=I=0=0'],
         ['type' => 'scene', 'scene' => 'salon/cheminee', 'delay' => 1],
     ],
     'salon/off' => [
         ['type' => 'hue', 'group' => $salon, 'scene' => array('on' => false, 'brightness' => 0)],
-        ['type' => 'domoticz', 'scene' => '3', 'command' => false],
         ['type' => 'insteon', 'command' => '0?133=I=0=0'],
         ['type' => 'function', 'function' => 'chemineeOff', 'args' => ['salon']],
     ],
     'salon/cinema' => [
         ['type' => 'ecomode', 'mode' => '0'],
-        ['type' => 'domoticz', 'scene' => '4', 'command' => true],
-        ['type' => 'hue', 'group' => $salon, 'scene' => 'AsU9eOyGsjEyz35'],
         ['type' => 'insteon', 'command' => '0?1111=I=0=0'],
+        ['type' => 'hue', 'group' => $salon, 'scene' => 'AsU9eOyGsjEyz35'],
+        ['type' => 'hue', 'group' => $bureau, 'scene' => 'Ntv7DDEMGtuYA9L'],
+        ['type' => 'scene', 'scene' => 'chambre/off/exceptcheminee'],
+
     ],
     'salon/tamise' => [
-        ['type' => 'domoticz', 'scene' => '4', 'command' => true],
         ['type' => 'ecomode', 'mode' => '0'],
         ['type' => 'hue', 'group' => $salon, 'scene' => 'RbjnIcLtcDuHbfU'],
         ['type' => 'insteon', 'command' => '0?1130=I=0=0'],
         ['type' => 'function', 'function' => 'chemineeOn', 'args' => ['salon', 'fire', 0.8]],
     ],
     'salon/lecturenocture' => [
-        ['type' => 'domoticz', 'scene' => '4', 'command' => true],
         ['type' => 'hue', 'group' => $salon, 'scene' => 'HZiYyM6hMUMkmiY'],
         ['type' => 'insteon', 'command' => '0?1113=I=0=0'],
         ['type' => 'function', 'function' => 'chemineeOn', 'args' => ['salon', 'fire', 0.25]],
@@ -353,9 +354,9 @@ $scenes = [
         ['type' => 'state', 'key' => 'bureau_gradient', 'value' => 'flowers'],
         ['type' => 'scene', 'scene' => 'bureau/base/on'],
     ],
-    'bureau/savane' => [
+    'bureau/tchernobyl' => [
         ['type' => 'hue', 'group' => $bureau, 'scene' => 'KoByn2ehWHDdchu'],
-        ['type' => 'state', 'key' => 'bureau_gradient', 'value' => 'savane'],
+        ['type' => 'state', 'key' => 'bureau_gradient', 'value' => 'tchernobyl'],
         ['type' => 'scene', 'scene' => 'bureau/base/on'],
     ],
     'bureau/boreal' => [
@@ -380,7 +381,7 @@ $scenes = [
     ],
     'bureau/tonic' => [
         ['type' => 'hue', 'group' => $bureau, 'scene' => 'S-YiVWKsEKipL0G'],
-        ['type' => 'state', 'key' => 'bureau_gradient', 'value' => 'space'],
+        ['type' => 'state', 'key' => 'bureau_gradient', 'value' => 'tonic'],
         ['type' => 'scene', 'scene' => 'bureau/base/on'],
     ],
     'bureau/lecture' => [
index d111ec87ee075bb81e22529dc18bcbd212c383f9..ec0703dd08955d6f80314af8f80116bd03fcf99f 100644 (file)
@@ -10,7 +10,8 @@ $h = isset($_GET["h"]) ? $_GET['h'] : 0;
 
 $dest = getYoutubeDLPath($url, $h, $ext);
 $wip = $dest . '.wip';
-if (!file_exists($dest) && !file_exists($wip)) {
+$ps = `ps aux`;
+if (!file_exists($dest) && !file_exists($wip) && !stristr($ps, $dest)) {
 
     file_put_contents($wip, '');
     $height = '';
@@ -19,7 +20,7 @@ if (!file_exists($dest) && !file_exists($wip)) {
     }
 
     $format = 'bestvideo' . $height . '+bestaudio/best' . $height;
-    $cmd = "/usr/local/bin/youtube-dl -f '$format' -o $dest --merge-output-format mkv '$url'";
+    $cmd = "/usr/local/bin/youtube-dl -f '$format' -o $dest --merge-output-format $ext '$url'";
     `$cmd`;
     unlink($wip);
 }
\ No newline at end of file