From: Vincent Date: Sun, 15 Nov 2020 10:36:29 +0000 (+0100) Subject: . X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=d4becb417355fbc0bc22a12ee50c94a2718568d8;p=tortuga-home.git . --- diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 4bcb8eb..cc69433 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -3,8 +3,9 @@ - - + + + @@ -1290,12 +1291,12 @@ - + - + @@ -1319,11 +1320,11 @@ - + - + diff --git a/scripts/cron/cron.php b/scripts/cron/cron.php index bb8cc4f..d719cd3 100644 --- a/scripts/cron/cron.php +++ b/scripts/cron/cron.php @@ -64,6 +64,10 @@ function cronShield($cronmin) shieldConnect(true, $device['id']); } } + if ($cronmin % 10 === 0) { + setState('maskShieldSalonWakeup', false); + setState('maskShieldBureauWakeup', false); + } //`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?playerid=b8%3A27%3Aeb%3Af6%3A1d%3A30' -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=null; Squeezebox-advancedsettings=plugins/CastBridge/settings/basic.html%3F; Squeezebox-expanded-activePlugins=1; Squeezebox-expanded-inactivePlugins=1; Squeezebox-expanded-otherPlugins0=1' -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'`; //`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' -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'`; diff --git a/scripts/lib/squeezebox.php b/scripts/lib/squeezebox.php index 085dcd0..1d43a50 100644 --- a/scripts/lib/squeezebox.php +++ b/scripts/lib/squeezebox.php @@ -92,13 +92,14 @@ function squeezePlayByName($musicName, $player, $volume = null, $playIfSync = tr } if ($player == $squeezeboxPlayers['Salon']) { + setState('maskShieldSalonWakeup', true); harmonyActivity('musique'); } if ($player == $squeezeboxPlayers['Salle de bains']) { execScene('sdb/ampli/on'); } if ($player == $squeezeboxPlayers['Bureau']) { - sshCommand('/usr/local/bin/soundtojack', 'bureau', true, true); + setState('maskShieldBureauWakeup', true); } if ($player == $squeezeboxPlayers['Chambre']) { denon(true); diff --git a/servers/logcat.php b/servers/logcat.php index 5671808..b2b2ca4 100644 --- a/servers/logcat.php +++ b/servers/logcat.php @@ -16,7 +16,16 @@ $cases = [ }, 'Waking up from sleep' => function () use ($device) { echo 'wakeup' . "\n"; - shieldRunActivity($device); + if ($device == 'salon') { + $state = 'maskShieldSalonWakeup'; + } else if ($device === 'bureau') { + $state = 'maskShieldBureauWakeup'; + } + if (getState($state, false)) { + setState($state, true); + } else { + shieldRunActivity($device); + } }, 'WindowManager: handleComboKeys keyCode: 25, keyAction: 1' => function () use ($device) { if ($device === 'salon') {