]> _ Git - tortuga-home.git/commitdiff
.
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 12 Mar 2024 15:37:26 +0000 (16:37 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 12 Mar 2024 15:37:26 +0000 (16:37 +0100)
.idea/workspace.xml
bin/healthcheck
scripts/lib/squeezebox.php
scripts/lib/velib.php

index 48761f9b9a635312ad61dc44070530f46d09ba74..a79c8e00990b02692087b003fef1fe71efeab279 100644 (file)
@@ -5,17 +5,10 @@
   </component>
   <component name="ChangeListManager">
     <list default="true" id="352ce63a-b52a-41a2-979b-becda7920939" name="Default" comment=".">
-      <change beforePath="$PROJECT_DIR$/.docker/config/monit/conf.d/home" beforeDir="false" afterPath="$PROJECT_DIR$/.docker/config/monit/conf.d/home" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/.docker/update" beforeDir="false" afterPath="$PROJECT_DIR$/.docker/update" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/bin/healthcheck" beforeDir="false" afterPath="$PROJECT_DIR$/bin/healthcheck" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/bin/restart-logcat" beforeDir="false" afterPath="$PROJECT_DIR$/bin/restart-logcat" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/bin/restarthome" beforeDir="false" afterPath="$PROJECT_DIR$/bin/restarthome" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/scripts/cron/cron.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/cron/cron.php" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/servers/domoticz.php" beforeDir="false" />
-      <change beforePath="$PROJECT_DIR$/servers/hue.php" beforeDir="false" afterPath="$PROJECT_DIR$/servers/hue.php" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/servers/insteon.php" beforeDir="false" />
-      <change beforePath="$PROJECT_DIR$/servers/squeezebox.php" beforeDir="false" afterPath="$PROJECT_DIR$/servers/squeezebox.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/lib/velib.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/velib.php" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
       <workItem from="1707323806669" duration="1110000" />
       <workItem from="1708089220716" duration="1619000" />
       <workItem from="1708442844514" duration="418000" />
-      <workItem from="1709114228146" duration="2209000" />
+      <workItem from="1709114228146" duration="2292000" />
+      <workItem from="1709117286043" duration="1376000" />
+      <workItem from="1710247312163" duration="986000" />
     </task>
     <task id="LOCAL-00502" summary=".">
       <created>1641726946298</created>
       <option name="project" value="LOCAL" />
       <updated>1687259667913</updated>
     </task>
-    <option name="localTasksCounter" value="608" />
+    <option name="localTasksCounter" value="609" />
     <servers />
   </component>
   <component name="TypeScriptGeneratedFilesManager">
     <option name="version" value="3" />
   </component>
+  <component name="Vcs.Log.History.Properties">
+    <option name="COLUMN_ID_ORDER">
+      <list>
+        <option value="Default.Root" />
+        <option value="Default.Author" />
+        <option value="Default.Date" />
+        <option value="Default.Subject" />
+        <option value="Space.CommitStatus" />
+      </list>
+    </option>
+  </component>
   <component name="Vcs.Log.Tabs.Properties">
     <option name="TAB_STATES">
       <map>
index b7218ff3200d96b395d2823c96fd05001bd25d1b..d2b842f9c727a852eda01ceb2880af914dd7894c 100644 (file)
@@ -15,8 +15,8 @@ foreach ($heartbeats as $h) {
 }
 $diff = time() - $mintime;
 
-if ($diff > 120) {
-    if ($diff > 300) {
+if ($diff > 300) {
+    if ($diff > 600) {
         echo 'Need to restart container.';
         exit(1);
     } else {
index b836749ca64560326ef68062eda20e06364b158b..45af8f01f71afd5946cd5542e09a62fbee246a7a 100644 (file)
@@ -134,29 +134,39 @@ function squeezePlayByName($musicName, $player, $volume = null, $playIfSync = tr
         return;
     }
 
+    $player = _player($player);
+
+    $sdb=$player === 'Salle de bains' || $player == $squeezeboxPlayers['Salle de bains'];
+    $wc=$player === 'WC' || $player == $squeezeboxPlayers['WC'];
+
     $currentMusicKey = 'squeezeplaybyname_' . $player;
     $currentMusic = getState($currentMusicKey, '');
 
-
     global $allmusics;
     $m = $allmusics[$musicName];
 
-    squeezeRequest('pause', $player);
-
-    if ($currentMusic !== $musicName) {
-        setState($currentMusicKey, $musicName);
+    if($wc) {
+        squeezeRequest('pause', $player);
+        if ($currentMusic !== $musicName) {
+            setState($currentMusicKey, $musicName);
+            foreach ($m['commands'] as $command) {
+                echo $player . ':' . $command . '<br />';
+                squeezeRequest($command, $player);
+            }
+        } else {
+            squeezeRequest('button jump_fwd', $player);
+        }
+    }else{
+        squeezeRequest('pause', $player);
         foreach ($m['commands'] as $command) {
             echo $player . ':' . $command . '<br />';
             squeezeRequest($command, $player);
         }
-    } else {
-        squeezeRequest('button jump_fwd', $player);
     }
 
-    $player = _player($player);
     $player = _squeezePlay($player, $volume);
 
-    if ($player === 'Salle de bains' || $player == $squeezeboxPlayers['Salle de bains']) {
+    if ($sdb) {
         hotwaterCheckMode();
         sleep(3);
         hotwaterCheckMode();
index 7e17f188a6232e9f376971d5b3856a723a120b53..5fb35c5cde2294a147baf72c6c619578b64d8af1 100644 (file)
@@ -13,10 +13,10 @@ function velibStations($force = false)
 
     if ($force || !file_exists($cache) || filemtime($cache) < (time() - $limit)) {
         $allcache = __DIR__ . '/../../cache/velib.all.json';
-        $ffversion = rand('105', '116');
-        $thversion = rand('1', '100');
+        $ffversion = rand('105', '124');
+        $thversion = rand('1', '150');
 
-        `curl 'https://velib-metropole-opendata.smoove.pro/opendata/Velib_Metropole/station_status.json' -H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv$ffversion.0) Gecko/20100101 Firefox/$ffversion.0 TortugaHome/$thversion.0' --output $allcache`;
+        `curl --max-time 10 'https://velib-metropole-opendata.smoove.pro/opendata/Velib_Metropole/station_status.json' -H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv$ffversion.0) Gecko/20100101 Firefox/$ffversion.0 TortugaHome/$thversion.0' --output $allcache`;
         $alldata = json_decode(file_get_contents($allcache), true);
 
         $stations = ['Cadet' => '9101', 'Bleue' => '9113', 'Folies bergères' => '9011', 'Square Montholon' => '9009', 'Le Pelletier' => '9014'];