]> _ Git - tortuga-home.git/commitdiff
.
authorVincent <vincent@enhydra.fr>
Wed, 14 Apr 2021 19:02:30 +0000 (21:02 +0200)
committerVincent <vincent@enhydra.fr>
Wed, 14 Apr 2021 19:02:30 +0000 (21:02 +0200)
.idea/workspace.xml
scripts/lib/kodi.php
scripts/lib/scenes.php

index ef6be6d0857de2d1b340ff915a77dccf956799a7..72cb789d0ccdc68bd782a82747896276fb14f087 100644 (file)
@@ -3,7 +3,8 @@
   <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/salon.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/salon.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/scripts/lib/kodi.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/kodi.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/scripts/lib/scenes.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/scenes.php" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
         <option name="Make" enabled="true" />
       </method>
     </configuration>
-    <configuration default="true" type="ArquillianJUnit" factoryName="" nameIsGenerated="true">
-      <option name="arquillianRunConfiguration">
-        <value>
-          <option name="containerStateName" value="" />
-        </value>
-      </option>
-      <option name="TEST_OBJECT" value="class" />
-      <method v="2">
-        <option name="Make" enabled="true" />
-      </method>
-    </configuration>
     <configuration default="true" type="ArquillianTestNG" factoryName="">
       <option name="arquillianRunConfiguration">
         <value>
       <workItem from="1617794856868" duration="1126000" />
       <workItem from="1617801536336" duration="4107000" />
       <workItem from="1618050897134" duration="4462000" />
-      <workItem from="1618158049208" duration="19253000" />
-    </task>
-    <task id="LOCAL-00418" summary=".">
-      <created>1607330684348</created>
-      <option name="number" value="00418" />
-      <option name="presentableId" value="LOCAL-00418" />
-      <option name="project" value="LOCAL" />
-      <updated>1607330684348</updated>
+      <workItem from="1618158049208" duration="20700000" />
+      <workItem from="1618426400216" duration="472000" />
     </task>
     <task id="LOCAL-00419" summary=".">
       <created>1607418039594</created>
       <option name="project" value="LOCAL" />
       <updated>1618341457184</updated>
     </task>
-    <option name="localTasksCounter" value="467" />
+    <task id="LOCAL-00467" summary=".">
+      <created>1618342660944</created>
+      <option name="number" value="00467" />
+      <option name="presentableId" value="LOCAL-00467" />
+      <option name="project" value="LOCAL" />
+      <updated>1618342660944</updated>
+    </task>
+    <option name="localTasksCounter" value="468" />
     <servers />
   </component>
   <component name="TypeScriptGeneratedFilesManager">
index 9dae7afdef507902dbbd87790854fdd4c14acf34..c490f9e813b98eaec1eccab2160a6758ee621b2e 100644 (file)
@@ -59,17 +59,9 @@ function kodiSyncPlayedStatus()
 
 function tmdbToKodiId($tmdbId, $type = 'tvshow')
 {
-
-    $con = getKodiDBConnection();
-
-    if ($type === 'tvshow') {
-        $tvdb = tmdbToTvdb($tmdbId);
-    }
-
-    $result = mysqli_query($con, 'SELECT `media_id` FROM `uniqueid` WHERE `media_type` = "' . $type . '" AND `value`="' . $tvdb . '" ORDER BY `media_id` ASC ');
-    $files = [];
-    $playCounts = [];
-    while ($file = $result->fetch_assoc()) {
+    $result = mysqli_query(getKodiDBConnection(), 'SELECT `media_id` FROM `uniqueid` WHERE `value`="' . $tmdbId . '" AND `type`="tmdb"');
+    while ($r = $result->fetch_assoc()) {
+        return $r['media_id'];
     }
 }
 
@@ -77,8 +69,7 @@ function kodiOpenTVShow($device, $tmdbId, $season = 1, $episode = 1)
 {
     global $kodiIP;
 
-
     $ip = $kodiIP[$device];
-    $json = '{"jsonrpc":"2.0","id":"1","method":"GUI.ActivateWindow","params":["videos",["videodb://tvshows/titles/' . $kodiId . '/' . $season . '","return"]]}';
-    `curl 'http://$ip:8754/jsonrpc' -H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:88.0) Gecko/20100101 Firefox/88.0' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' -H 'Accept-Language: fr-FR,en;q=0.5' --compressed -H 'Connection: keep-alive' -H 'Upgrade-Insecure-Requests: 1' -H 'Cache-Control: max-age=0, no-cache' -H 'Pragma: no-cache' --data-raw '$json'`;
+    $json = '{"jsonrpc":"2.0","id":"1","method":"GUI.ActivateWindow","params":["videos",["videodb://tvshows/titles/' . tmdbToKodiId($tmdbId) . '/' . $season . '","return"]]}';
+    `curl 'http://$ip:8754/jsonrpc' --data-raw '$json'`;
 }
\ No newline at end of file
index 517bd58fcfaa81af9006a274ca9ac57bc55c920a..b17bb42eda89e7980e6d46e26d0fa8428e539941 100644 (file)
@@ -70,10 +70,9 @@ $scenes = [
     'chambre/bed' => [
         ['type' => 'scene', 'scene' => 'chambre/bed/base'],
         ['type' => 'scene', 'scene' => 'chambre/nightlights'],
-        ['type' => 'scene', 'scene' => 'chambre/cheminee/smallfire'],
         ['type' => 'scene', 'scene' => 'chambre/planetarium/on'], // Planétarium on
         ['type' => 'scene', 'scene' => 'sdb/nuit'],
-        ['type' => 'scene', 'scene' => 'chambre/cheminee'],
+        ['type' => 'scene', 'scene' => 'chambre/cheminee/smallfire'],
     ],
     'chambre/bed/off' => [
         ['type' => 'scene', 'scene' => 'chambre/bed/base'],
@@ -250,16 +249,16 @@ $scenes = [
     ],
 
     'chambre/cheminee' => [
-        ['type' => 'function', 'function' => 'chemineeOn', 'args' => ['chambre', 'fire', 1]],
+        ['type' => 'domoticz', 'scene' => 43, 'command' => true, 'priority' => true],
     ],
     'chambre/cheminee/smallfire' => [
-        ['type' => 'function', 'function' => 'chemineeOn', 'args' => ['chambre', 'fire', 0.02]],
+        ['type' => 'domoticz', 'scene' => 43, 'command' => true, 'priority' => true],
     ],
     'chambre/cheminee/cold' => [
-        ['type' => 'function', 'function' => 'chemineeOn', 'args' => ['chambre', 'cold', 1]],
+        ['type' => 'domoticz', 'scene' => 43, 'command' => true, 'priority' => true],
     ],
     'chambre/cheminee/off' => [
-        ['type' => 'function', 'function' => 'chemineeOff', 'args' => ['chambre']],
+        ['type' => 'domoticz', 'scene' => 43, 'command' => false, 'priority' => true],
     ],
     'chambre/toggle' => [
         ['type' => 'function', 'function' => 'chambreToggle'],