<project version="4">
<component name="ChangeListManager">
<list default="true" id="352ce63a-b52a-41a2-979b-becda7920939" name="Default" comment=".">
- <change afterPath="$PROJECT_DIR$/servers/cheminee.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/config/coffee.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/coffee.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/domoticz.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/domoticz.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/scenes.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/scenes.php" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/config/global.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/global.php" 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/denon.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/denon.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/mediarasp.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/mediarasp.php" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/scripts/lib/off.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/off.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/lib/tmdb.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/tmdb.php" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/servers/logcat.php" beforeDir="false" afterPath="$PROJECT_DIR$/servers/logcat.php" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<workItem from="1617794856868" duration="1126000" />
<workItem from="1617801536336" duration="4107000" />
<workItem from="1618050897134" duration="4462000" />
- <workItem from="1618158049208" duration="6569000" />
- </task>
- <task id="LOCAL-00415" summary=".">
- <created>1606809331094</created>
- <option name="number" value="00415" />
- <option name="presentableId" value="LOCAL-00415" />
- <option name="project" value="LOCAL" />
- <updated>1606809331095</updated>
+ <workItem from="1618158049208" duration="17694000" />
</task>
<task id="LOCAL-00416" summary=".">
<created>1606938157166</created>
<option name="project" value="LOCAL" />
<updated>1618054953035</updated>
</task>
- <option name="localTasksCounter" value="464" />
+ <task id="LOCAL-00464" summary=".">
+ <created>1618321419071</created>
+ <option name="number" value="00464" />
+ <option name="presentableId" value="LOCAL-00464" />
+ <option name="project" value="LOCAL" />
+ <updated>1618321419071</updated>
+ </task>
+ <option name="localTasksCounter" value="465" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
'ip' => '192.168.13.32',
'key' => 'dmGYolpN-k4:APA91bEcMcfkZ0jZViEvyqyVWoT71-vQko9DE0wwg-vzPkZ5-lHwiVJDH38dXfIoWrHWTrtEiMsv-6TrebFR-dNOLhVoVUb3rCsehmLi-Ew17lkP75Yqds3KsWEiyF_yx-i-9dc_4ewV',
'password' => '4pyA?Rnyeyc1$44M'
+ ],
+ 'salon' => [
+ 'ip' => '192.168.13.32',
+ 'key' => 'dmGYolpN-k4:APA91bEcMcfkZ0jZViEvyqyVWoT71-vQko9DE0wwg-vzPkZ5-lHwiVJDH38dXfIoWrHWTrtEiMsv-6TrebFR-dNOLhVoVUb3rCsehmLi-Ew17lkP75Yqds3KsWEiyF_yx-i-9dc_4ewV',
+ 'password' => '4pyA?Rnyeyc1$44M'
]
+ //dOQilKX5CVQ:APA91bGOo1g2Hk2p7A4qYNg0wuKjvDeU3quKi6r73ae6rxVqSXmztMIDRn00DOZmXP1q1fBS0hLEd7xZo_Rr3LQMrRIHJpgy0FxnH7G_OV3kxFmGqWu1yOg5tBUEPlEybH_JkjlEgGof
];
$squeezeboxPlayersByRoom = [
config('VIDEOPLAYER_DEVICE', 'salon');
config('HIDEMASK_TIMEOUT', 250);
config('THEME','#7a6854');
+config('SLEEPSCREEN', 15);
+config('SCREENSAVER_BRIGHTNESS', 100);
+config('SLEEPTYPE', 'screensaver');
+config('SCREENSAVER','weatherstationoroff');
if (DISPLAYINTERFACE) {
$c = salon();
return $current . '->' . $volume;
}
-function denonAVROn($input = 'Media Player')
+function denonAVROn($input = 'Media Player', $force = false)
{
- if (!denonAVRGetPowerState()) {
+ if ($force || !denonAVRGetPowerState()) {
_denonTelnet('ZMON');
}
denonAVRInput($input);
if (denonAVRGetInput() !== $cmd) {
_denonTelnet($cmd);
sleep(1);
+ $volumes = ['Media Player' => 60, 'HEOS Music' => 50, 'CD' => 30, 'AUX' => 26];
+ if (isset($volumes[$input])) {
+ denonAVRVolume($volumes[$input], '');
+ usleep(1000000 * 1);
+ }
}
- $audioMode = ['Media Player' => 'DOLBY DIGITAL', 'AUX' => 'DOLBY DIGITAL', 'CD' => 'DOLBY DIGITAL'];
- if (isset($audioMode[$input])) {
- denonAVRSetAudioMode($audioMode[$input]);
- usleep(1000000 * 1);
- }
+// $audioMode = ['Media Player' => 'DOLBY DIGITAL', 'AUX' => 'DOLBY DIGITAL', 'CD' => 'DOLBY DIGITAL'];
+// if (isset($audioMode[$input])) {
+// denonAVRSetAudioMode($audioMode[$input]);
+// usleep(1000000 * 1);
+// }
- $volumes = ['Media Player' => 60, 'HEOS Music' => 50, 'CD' => 30, 'AUX' => 26];
- if (isset($volumes[$input])) {
- denonAVRVolume($volumes[$input], '');
- usleep(1000000 * 1);
- }
//denonAVRSetSpeakerPreset(1);
}
sshCommand('/usr/local/bin/ir Epson ' . $cmd, 'salon');
setState('EpsonPowerState', $on ? '1' : '0');
if ($currentState !== $on && $on) {
- sleep(26);
+ sleep(30);
}
}
<?php
+$kodiClients = [];
+$kodiIP = ['salon' => '192.168.13.40', 'bureau' => '192.168.13.41', 'avion' => '192.168.13.5', 'cuisine' => '192.168.13.32'];
+
function getKodiDBConnection()
{
return mysqli_connect('localhost', "kodi", "atacama", "MyVideos119");
$fileId = $files[$f];
mysqli_query($con, 'UPDATE files SET playCount=1,lastPlayed=NOW() WHERE idFile=' . $fileId);
}
+ }
+}
+
+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()) {
}
+}
+
+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'`;
}
\ No newline at end of file
}
if ($key == 'rewind' || $key == 'fast-rewind') {
$way = '-';
- } else if ($key == 'forward' || $key = 'fast-forward') {
+ } else if ($key == 'forward' || $key == 'fast-forward') {
$way = '+';
}
$res = VLCCmd(['command' => 'seek', 'val' => $way . $amount . 's'], $device);
denonAVROff();
shieldKillAll('salon');
shieldSleep('salon');
+ sleep(2);
+ epson(false, true);
}
function offBureau()
//`curl 'http://192.168.13.60:9000/plugins/Extensions/settings/plugins/CastBridge/settings/basic.html?playerid=b8%3A27%3Aeb%3Af6%3A1d%3A30' -H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:83.0) Gecko/20100101 Firefox/83.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 'Content-Type: application/x-www-form-urlencoded' -H 'Origin: http://192.168.13.60:9000' -H 'Connection: keep-alive' -H 'Referer: http://192.168.13.60:9000/plugins/Extensions/settings/plugins/CastBridge/settings/basic.html' -H 'Cookie: Squeezebox-player=b8%3A27%3Aeb%3Af6%3A1d%3A30; Squeezebox-enableHiDPI=1; Squeezebox-expandPlayerControl=true; Squeezebox-expanded-MY_MUSIC=0; Squeezebox-expanded-RADIO=1; Squeezebox-expanded-PLUGIN_MY_APPS_MODULE_NAME=1; Squeezebox-expanded-FAVORITES=1; Squeezebox-expanded-PLUGINS=0; Squeezebox-playersettings=settings/player/basic.html%3F; Squeezebox-advancedsettings=plugins/CastBridge/settings/basic.html%3F; Squeezebox-expanded-activePlugins=1; Squeezebox-expanded-inactivePlugins=1; Squeezebox-expanded-otherPlugins0=1; securitytoken=1b5a6a8ddf493f1bf1f0787e0de41708' -H 'Upgrade-Insecure-Requests: 1' --data-raw 'saveSettings=1&useAJAX=0&page=PLUGIN_CASTBRIDGE&playerid=b8%3A27%3Aeb%3Af6%3A1d%3A30&player=b8%3A27%3Aeb%3Af6%3A1d%3A30&autorun=on&bin=squeeze2cast-armv6hf&opts=&debugs=&log_limit=-1&configfile=castbridge.xml&autosave=on&upnp_socket=%3F&xmlparams=1&prevseldevice=.common.&seldevice=.common.&codecs=aac%2Cogg%2Cops%2Cogf%2Cflc%2Calc%2Cwav%2Caif%2Cpcm%2Cmp3&sample_rate=96000&encode_mode=thru&encode_level=&encode_bitrate=&encode_rate=&encode_size=&server=%3F&enabled=1&remove_timeout=0&volume_on_play=1&media_volume=50&send_metadata=1&send_coverart=1&enabled.79a3f5f078d67e3b25a6b3dedc624e18=1&enabled.c4f32d227235313d8c59eff43a01350c=1'`;
}
-function shieldRunActivity($device = null)
+function shieldRunActivity($device = null, $force = false)
{
$device = getDevice($device);
$onlySound = in_array(shieldGetCurrentApp($device), ['spotify']);
if ($device['id'] === 'salon') {
stopPlayersIn('salon', true, false);
+ denonAVROn('Media Player', $force);
epson(true);
- denonAVROn();
execScene('salon/cinema');
} else if ($device['id'] === 'bureau' || $device['id'] === 'bureausun') {
stopPlayersIn('bureau', true, false);
return $res;
}
+function tmdbToTvdb($tmdbid)
+{
+ $cacheKey = 'tmdb_to_tvdb_' . $tmdbid;
+ $cached = getState($cacheKey, null);
+ if (null === $cached) {
+ $client = getTmbdClient();
+ $find = $client->getTvApi();
+ $data = $find->getExternalIds($tmdbid);
+ $cached = $data['tvdb_id'];
+ setState($cacheKey, $cached);
+ }
+ return $cached;
+}
+
function mb_strcasecmp($str1, $str2, $encoding = null)
{
if (null === $encoding) {
$edate = explode('-', $data['last_air_date']);
$mtime = gmmktime(12, 0, 0, $edate[1], $edate[2], $edate[0]);
- if (file_exists($file.'.netflix')) {
- $dir = 'netflix:' . file_get_contents($file.'.netflix');
+ if (file_exists($file . '.netflix')) {
+ $dir = 'netflix:' . file_get_contents($file . '.netflix');
} else {
$dir = file_exists($file) && is_file($file) ? file_get_contents($file) : $f->getPath();
}
'Going to sleep due to power button' => function () use ($device) {
echo 'sleep ' . $device . "\n";
off($device);
- execScene('salon/on');
},
'Waking up from sleep' => function () use ($device) {
echo 'wakeup ' . $device . "\n";
$squeezePlayer = 'Bureau';
}
if (getState($state, '0') < time() && getSqueezePlayerStatus($squeezePlayer) <= 0) {
- shieldRunActivity($device);
+ shieldRunActivity($device,true);
}
},
'WindowManager: handleComboKeys keyCode: 25, keyAction: 1' => function () use ($device) {