<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/global.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/global.php" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/config/rooms.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/rooms.php" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/scripts/domoticz_device_event.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/domoticz_device_event.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/scenes.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/scenes.php" afterDir="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="1602501229079" duration="559000" />
<workItem from="1602581583330" duration="1284000" />
<workItem from="1602862886793" duration="1014000" />
- <workItem from="1603095373591" duration="50000" />
- </task>
- <task id="LOCAL-00299" summary=".">
- <created>1581934414894</created>
- <option name="number" value="00299" />
- <option name="presentableId" value="LOCAL-00299" />
- <option name="project" value="LOCAL" />
- <updated>1581934414894</updated>
+ <workItem from="1603095373591" duration="1368000" />
+ <workItem from="1603270756890" duration="2727000" />
</task>
<task id="LOCAL-00300" summary=".">
<created>1581951532460</created>
<option name="project" value="LOCAL" />
<updated>1602863336459</updated>
</task>
- <option name="localTasksCounter" value="348" />
+ <task id="LOCAL-00348" summary=".">
+ <created>1603131455368</created>
+ <option name="number" value="00348" />
+ <option name="presentableId" value="LOCAL-00348" />
+ <option name="project" value="LOCAL" />
+ <updated>1603131455369</updated>
+ </task>
+ <option name="localTasksCounter" value="349" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
<screen x="0" y="0" width="2560" height="1040" />
</state>
<state x="872" y="161" key="#Plugins/0.0.2560.1040@0.0.2560.1040" timestamp="1596008801840" />
- <state x="935" y="70" width="1170" height="972" key="CommitChangelistDialog2" timestamp="1602863330816">
+ <state x="198" y="0" width="745" height="567" key="CommitChangelistDialog2" timestamp="1603131428714">
<screen x="0" y="0" width="2560" height="1040" />
</state>
<state x="701" y="75" key="CommitChangelistDialog2/0.0.1920.1160@0.0.1920.1160" timestamp="1602171117745" />
- <state x="935" y="70" key="CommitChangelistDialog2/0.0.2560.1040@0.0.2560.1040" timestamp="1602863330816" />
+ <state x="198" y="0" width="745" height="567" key="CommitChangelistDialog2/0.0.2560.1040@0.0.2560.1040" timestamp="1603131428714" />
<state x="1114" y="443" key="NewPhpFileDialog" timestamp="1602146675515">
<screen x="0" y="0" width="2560" height="1040" />
</state>
<screen x="0" y="0" width="1920" height="1160" />
</state>
<state x="655" y="270" width="816" height="530" key="Vcs.Push.Dialog.v2/0.0.1920.1160@0.0.1920.1160" timestamp="1595521362224" />
+ <state x="295" y="0" width="1290" height="907" key="dock-window-1" timestamp="1603274697406">
+ <screen x="0" y="0" width="2560" height="1040" />
+ </state>
+ <state x="295" y="0" width="1290" height="907" key="dock-window-1/0.0.2560.1040@0.0.2560.1040" timestamp="1603274697406" />
<state x="977" y="257" width="607" height="536" key="find.popup" timestamp="1598297024487">
<screen x="0" y="0" width="2560" height="1040" />
</state>
'password' => '4pyA?Rnyeyc1$44M')
);
+$squeezeboxPlayersByRoom = [
+ 'bureau' => ['Bureau'],
+ 'bureausun' => ['Bureau'],
+ 'chambre' => ['Lit Vincent', 'Lit Jérôme', 'Chambre'],
+ 'salon' => ['Salon'],
+ 'cuisine' => ['Cuisine'],
+ 'sdb' => ['Salle de bains'],
+ 'wc' => ['WC'],
+];
+
$devices = [
'cerveau' => ['id' => 'cerveau', 'host' => '192.168.13.60', 'user' => 'pi', 'password' => 'atacama'],
'litvincent' => ['id' => 'litvincent', 'host' => '192.168.13.61', 'user' => 'pi', 'password' => 'atacama'],
'X' => array('dir' => 'Z/X', 'context' => 'movie', 'id' => 'x')
);
-$videoExt = ['mkv', 'mp4', 'avi', 'ogv', 'ts', 'm2ts', 'mpg', 'm4v', 'flv', 'f4v', 'mov', 'mpg', 'mpeg','divx'];
+$videoExt = ['mkv', 'mp4', 'avi', 'ogv', 'ts', 'm2ts', 'mpg', 'm4v', 'flv', 'f4v', 'mov', 'mpg', 'mpeg', 'divx'];
profile('Set globals', __FILE__, __LINE__);
['type' => 'light', 'scene' => 'salon/on', 'label' => 'Allumer'],
['type' => 'light', 'scene' => 'salon/off', 'label' => 'éteindre'],
['type' => 'light', 'scene' => 'salon/cinema', 'label' => 'cinéma'],
+ ['type' => 'light', 'scene' => 'salon/cineclub', 'label' => 'cinéma de minuit'],
['type' => 'light', 'scene' => 'salon/tamise', 'label' => 'Tamisé'],
['type' => 'light', 'scene' => 'salon/lecturenocture', 'label' => 'Lecture nocturne'],
['type' => 'light', 'scene' => 'salon/cheminee', 'label' => 'Cheminée'],
if ($_GET['device'] == 1695) {
$forceConfig = 'wc';
}
+if ($_GET['device'] == 1478) {
+ $forceConfig = 'bureau';
+}
require_once "import.php";
if ($_GET['device'] == 480) {
chambreToggle();
-} else if ($_GET['device'] == 1033 || $_GET['device'] == 1476 || $_GET['device'] == 1478) {
+} else if ($_GET['device'] == 1033 || $_GET['device'] == 1476) {
// Cube
switch ($_GET['state']) {
case 'Shake':
} else if ($_GET['device'] == 1451) {
domoticzSwitch(1450);
} else if ($_GET['device'] == 1695) {
- $forceConfig = 'salon';
+ $forceConfig = 'wc';
switch ($_GET['state']) {
case 'Double_Click':
execScene('wc/spa');
wcToggle();
break;
}
+} else if ($_GET['device'] == 1478) {
+ // Cube
+ switch ($_GET['state']) {
+ case 'Shake':
+ execScene('home/alert');
+ break;
+ case 'Flip_90':
+ execScene('bureau/rideaux/toggle');
+ break;
+ case 'Flip_180':
+ execScene('bureau/auto');
+ break;
+ case 'Free_Fall':
+ execScene('bureau/off');
+ off('bureau');
+ break;
+ case 'Move':
+ off('bureau');
+ break;
+ case 'Clock_Wise':
+ volume(5, '+');
+ break;
+ case 'Anti_Clock_Wise':
+ volume(5, '-');
+ break;
+ case 'Tap':
+ squeezePlayByName('Samba', $squeezeboxPlayers['Bureau']);
+ break;
+ case 'Alert':
+ default:
+ break;
+ }
}
echo '1';
\ No newline at end of file
function commonOff($device)
{
remoteCmdMedia('stop', $device);
- squeezeRequest('stop');
+ stopPlayersIn($device);
}
function offSalon()
['type' => 'hue', 'group' => $salon, 'scene' => array('on' => false)],
['type' => 'scene', 'scene' => 'salon/fan/off'],
],
- 'salon/cinema' => [
- ['type' => 'hue', 'group' => $salon, 'scene' => 'AsU9eOyGsjEyz35'],
+ 'salon/cinemabase' => [
['type' => 'scene', 'scene' => 'cuisine/tamise'],
['type' => 'ecomode', 'mode' => '0'],
['type' => 'insteon', 'command' => '0?1111=I=0=0'],
+ ],
+ 'salon/cineclub' => [
+ ['type' => 'hue', 'group' => $salon, 'scene' => 'xpCjXtV3u7O1kYu'],
+ ['type' => 'scene', 'scene' => 'salon/cinemabase'],
+ ['type' => 'hue', 'group' => $salon, 'scene' => 'xpCjXtV3u7O1kYu'],
+ ],
+ 'salon/cinema' => [
+ ['type' => 'hue', 'group' => $salon, 'scene' => 'AsU9eOyGsjEyz35'],
+ ['type' => 'scene', 'scene' => 'salon/cinemabase'],
['type' => 'hue', 'group' => $salon, 'scene' => 'AsU9eOyGsjEyz35'],
],
'salon/tamise' => [
['type' => 'ecomode', 'mode' => '0'],
['type' => 'function', 'function' => 'wakeupPC', 'args' => ['avion']],
],
-
'bureau/l61/on' => [
['type' => 'domoticz', 'device' => '2074', 'command' => true],
],
'bureau/rideaux/open' => [
['type' => 'domoticz', 'device' => '391', 'command' => true, 'priority' => true],
],
+ 'bureau/rideaux/toggle' => [
+ ['type' => 'domoticz', 'device' => '391', 'command' => 'Toggle', 'priority' => true],
+ ],
'insteon/off' => [
['type' => 'insteon', 'command' => '0?135=I=0=0'],
],
}
}
+function stopPlayersIn($room)
+{
+ global $squeezeboxPlayers, $squeezeboxPlayersByRoom;
+ if (isset($squeezeboxPlayersByRoom[$room])) {
+ foreach ($squeezeboxPlayersByRoom[$room] as $player) {
+ stopSqueezebox($player);
+ }
+ }
+}
+
function squeezeRequest($params, $player = '')
{
$redis = connectRedis();