<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/music.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/music.php" 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$/scripts/lib/lib.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/lib.php" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/scripts/lib/mediarasp.php" beforeDir="false" />
- <change beforePath="$PROJECT_DIR$/scripts/lib/remoteinfos.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/remoteinfos.php" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/scripts/lib/shield.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/shield.php" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/scripts/shield.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/shield.php" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/scripts/syno.php" beforeDir="false" />
- <change beforePath="$PROJECT_DIR$/scripts/tmdb.php" beforeDir="false" />
- <change beforePath="$PROJECT_DIR$/scripts/transcode.php" beforeDir="false" />
+ <change beforePath="$PROJECT_DIR$/scripts/lib/squeezebox.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/squeezebox.php" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<workItem from="1772370387714" duration="7090000" />
<workItem from="1773390371781" duration="506000" />
<workItem from="1774028822942" duration="792000" />
- <workItem from="1774430967346" duration="5035000" />
+ <workItem from="1774430967346" duration="5227000" />
</task>
<task id="LOCAL-00502" summary=".">
<created>1641726946298</created>
<option name="project" value="LOCAL" />
<updated>1687259667913</updated>
</task>
- <option name="localTasksCounter" value="638" />
+ <option name="localTasksCounter" value="639" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
squeezeFavorites(connectRedis()->igbget('squeezebox_favorites'), $shortcuts);
profile('Got Music favorites', __FILE__, __LINE__);
-$podcasts = connectRedis()->igbget('squeezebox_podcasts');
-//podcastDir($podcasts, 'Podcasts', 'podcasts', $shortcuts);
-//profile('Got podcasts', __FILE__, __LINE__);
function squeezeFavorites($favorites, &$shortcuts)
{
$shortcuts[$key] = array_merge([['type' => 'back', 'label' => $label]], $t);
}
-function podcastDir($podcasts, $label, $key, &$shortcuts)
-{
- global $allmusics;
-
- $k = 'sub-' . $key;
- $t = [];
-
- $hasDir = false;
- if (!is_array($podcasts)) {
- return;
- }
- foreach ($podcasts as $subitem) {
- if ($subitem['hasitems']) {
- if (count($subitem['subitems']) == 0) {
-
- } elseif (count($subitem['subitems']) == 1) {
- $t[] = audioElement($subitem['subitems'][0], 'podcasts');
- } else {
- $subname = isset($subitem['name']) && $subitem['name'] ? $subitem['name'] : $subitem['title'];
- $subkey = $key . '-' . str_replace('.', '_', $subitem['id']);
- $t[] = ['type' => 'sub', 'label' => $subname, 'sub' => $subkey];
- podcastDir($subitem['subitems'], $subname, $subkey, $shortcuts);
- $hasDir = true;
- }
- } else {
- $t[] = audioElement($subitem, 'podcasts');
- }
- }
-
- $shortcuts[$k] = array_merge([['type' => 'back', 'label' => $label]], $t);
-
-}
-
function audioElement($subitem, $app = 'favorites')
{
global $allmusics;
['type' => 'sub', 'label' => 'Radios', 'sub' => 'radio'],
['type' => 'sub', 'label' => 'Musique', 'sub' => 'playlists'],
['type' => 'sub', 'label' => 'Ambiance', 'sub' => 'ambiance'],
-];
-
-if ($podcasts !== false) {
- $shortcuts['music'][] = ['type' => 'sub', 'label' => 'Podcasts', 'sub' => 'podcasts'];
-}
\ No newline at end of file
+];
\ No newline at end of file
require_once __DIR__ . "/../import.php";
-function cronOneLoop($cronmin) {
- set_time_limit(0);
+function cronOneLoop($cronmin)
+{
+ set_time_limit(0);
- echo '------------------------------------' . "\n";
- _logSection('One Loop // ' . $cronmin);
- cronHeartbeat($cronmin, false);
- cronRooms($cronmin);
- cronWeather($cronmin);
+ echo '------------------------------------' . "\n";
+ _logSection('One Loop // ' . $cronmin);
+ cronHeartbeat($cronmin, false);
+ cronRooms($cronmin);
+ cronWeather($cronmin);
if ($cronmin % 10 == 0) {
cronSqueezeFavorites($cronmin);
}
- if ($cronmin % 15 == 0) {
- cronPodcasts($cronmin);
- }
- if ($cronmin % 5 == 0) {
- cronGuest($cronmin);
- cronShield($cronmin);
- }
+ if ($cronmin % 5 == 0) {
+ cronGuest($cronmin);
+ cronShield($cronmin);
+ }
- if ($cronmin % 20 == 0) {
- cronSqueezeCheckPlayers($cronmin);
- }
+ if ($cronmin % 20 == 0) {
+ cronSqueezeCheckPlayers($cronmin);
+ }
- if ($cronmin % 2 == 0) {
- cronPing($cronmin);
- }
+ if ($cronmin % 2 == 0) {
+ cronPing($cronmin);
+ }
- cronHarmony($cronmin);
- cronInterface($cronmin);
+ cronHarmony($cronmin);
+ cronInterface($cronmin);
- cronEcoMode($cronmin);
- cronHeartbeat($cronmin, true);
- _logSection('End Loop (min:' . $cronmin . ')');
+ cronEcoMode($cronmin);
+ cronHeartbeat($cronmin, true);
+ _logSection('End Loop (min:' . $cronmin . ')');
}
-function cronShield($cronmin) {
- _logSection('Shield');
- `/usr/local/bin/adb-connect`;
+function cronShield($cronmin)
+{
+ _logSection('Shield');
+ `/usr/local/bin/adb-connect`;
}
-function cronGuest($cronmin) {
+function cronGuest($cronmin)
+{
- _logSection('Guest');
- setState('guest', hasGuest() ? '1' : '0');
+ _logSection('Guest');
+ setState('guest', hasGuest() ? '1' : '0');
}
-function cronEcoMode($cronmin) {
- _logSection('Ecomode');
+function cronEcoMode($cronmin)
+{
+ _logSection('Ecomode');
setState('cron_heartbeat', time());
- ecoMode(null, $cronmin % 15 === 0);
+ ecoMode(null, $cronmin % 15 === 0);
}
-function _logSection($t) {
- echo '------' . $t . ' :: ' . date('Y-m-d H:i:s') . "\n";
+function _logSection($t)
+{
+ echo '------' . $t . ' :: ' . date('Y-m-d H:i:s') . "\n";
}
-function cronRooms($cronmin) {
- _logSection('Rooms');
+function cronRooms($cronmin)
+{
+ _logSection('Rooms');
- _logSection('Bureau');
- updateBureauAuto();
+ _logSection('Bureau');
+ updateBureauAuto();
- _logSection('Chambre');
- updateChambreAuto();
+ _logSection('Chambre');
+ updateChambreAuto();
- _logSection('Cour');
- updateCourAuto();
+ _logSection('Cour');
+ updateCourAuto();
- _logSection('Salon');
- updateSalonAuto();
+ _logSection('Salon');
+ updateSalonAuto();
- _logSection('Cuisine');
- updateCuisine();
- _logSection('Planetarium');
- checkPlanetarium();
- if ($cronmin % 2) {
- _logSection('WC VMC');
- checkWCVMC();
- }
-}
-
-function cronPing($cronmin) {
- _logSection('Pings');
- global $devices;
- setState('vincenthere', ping('192.168.13.20', 5) ? '1' : '0');
- setState('hasnetwork', ping('1.1.1.1', 3, 443) ? '1' : '0');
- foreach ($devices as $name => $device) {
- if (!isset($device['host'])) {
- continue;
- }
- $result = ping($device['host'], 3, 22) ? '1' : '0';
- setState('device_' . $name . '_awake', $result);
- echo 'device_' . $name . '_awake : ' . getState('device_' . $name . '_awake') . "\n";
- if ($result) {
- sshCommand('pwd', $device['host'], false, false);
- sshCommand('pwd', $device['host'], false, true);
- }
- }
+ _logSection('Cuisine');
+ updateCuisine();
+ _logSection('Planetarium');
+ checkPlanetarium();
+ if ($cronmin % 2) {
+ _logSection('WC VMC');
+ checkWCVMC();
+ }
}
-function cronSqueezeFavorites($cronmin) {
- _logSection('Squeeze Favorites');
- $favorites = getSqueezeFavorites();
- if ($favorites !== false && count($favorites) > 0) {
- connectRedis()->igbset('squeezebox_favorites', $favorites);
- }
+function cronPing($cronmin)
+{
+ _logSection('Pings');
+ global $devices;
+ setState('vincenthere', ping('192.168.13.20', 5) ? '1' : '0');
+ setState('hasnetwork', ping('1.1.1.1', 3, 443) ? '1' : '0');
+ foreach ($devices as $name => $device) {
+ if (!isset($device['host'])) {
+ continue;
+ }
+ $result = ping($device['host'], 3, 22) ? '1' : '0';
+ setState('device_' . $name . '_awake', $result);
+ echo 'device_' . $name . '_awake : ' . getState('device_' . $name . '_awake') . "\n";
+ if ($result) {
+ sshCommand('pwd', $device['host'], false, false);
+ sshCommand('pwd', $device['host'], false, true);
+ }
+ }
}
-function cronSqueezeCheckPlayers($cronmin) {
- _logSection('Check squeezebox players');
+function cronSqueezeFavorites($cronmin)
+{
+ _logSection('Squeeze Favorites');
+ $favorites = getSqueezeFavorites();
+ if ($favorites !== false && count($favorites) > 0) {
+ connectRedis()->igbset('squeezebox_favorites', $favorites);
+ }
}
-function cronWeather($cronmin) {
- _logSection('Weather');
- getWeather();
+function cronSqueezeCheckPlayers($cronmin)
+{
+ _logSection('Check squeezebox players');
}
-function cronPodcasts($cronmin) {
- checkSpottyLogin();
- return;
- _logSection('Podcasts');
- $podcasts = getSqueezeFavorites(0, 'podcasts');
- if ($podcasts !== false && count($podcasts) > 0) {
- connectRedis()->igbset('squeezebox_podcasts', $podcasts);
- }
+function cronWeather($cronmin)
+{
+ _logSection('Weather');
+ getWeather();
}
-function cronInterface($cronmin) {
- _logSection('Interface');
- if ((getState('ecomode') == '0' && $cronmin % 3 == 0) || $cronmin % 10 == 0) {
- $devices = ['salon', 'bureau', 'entree', 'cuisine', 'litvincent', 'litjerome', 'sdb', 'chambre', 'bureausun', 'wc'];
- foreach ($devices as $device) {
- file_get_contents('https://' . $device . '.home.tortuga.enhydra.fr/');
- }
- }
+function cronInterface($cronmin)
+{
+ _logSection('Interface');
+ if ((getState('ecomode') == '0' && $cronmin % 3 == 0) || $cronmin % 10 == 0) {
+ $devices = ['salon', 'bureau', 'entree', 'cuisine', 'litvincent', 'litjerome', 'sdb', 'chambre', 'bureausun', 'wc'];
+ foreach ($devices as $device) {
+ file_get_contents('https://' . $device . '.home.tortuga.enhydra.fr/');
+ }
+ }
}
-function cronHarmony($cronmin) {
- _logSection('Harmony');
- $currentActivity = getCurrentHarmonyActivity();
- if ($currentActivity == HARMONY_MUSIQUE) {
- setPlaying('squeezebox', 'bureau');
- } else if ($currentActivity == HARMONY_OFF) {
- setPlaying('mycanal', 'bureau');
- }
+function cronHarmony($cronmin)
+{
+ _logSection('Harmony');
+ $currentActivity = getCurrentHarmonyActivity();
+ if ($currentActivity == HARMONY_MUSIQUE) {
+ setPlaying('squeezebox', 'bureau');
+ } else if ($currentActivity == HARMONY_OFF) {
+ setPlaying('mycanal', 'bureau');
+ }
}
-function cronHeartbeat($cronmin, $devices = false) {
- _logSection('Heartbeat');
- setState('cron_heartbeat', time());
- squeezeRequest(null);
- hueCommand(null);
+function cronHeartbeat($cronmin, $devices = false)
+{
+ _logSection('Heartbeat');
+ setState('cron_heartbeat', time());
+ squeezeRequest(null);
+ hueCommand(null);
- if (!$devices || $cronmin % 5 != 0) {
- return;
- }
- restartDeadDevices();
+ if (!$devices || $cronmin % 5 != 0) {
+ return;
+ }
+ restartDeadDevices();
}
\ No newline at end of file