<project version="4">
<component name="ChangeListManager">
<list default="true" id="352ce63a-b52a-41a2-979b-becda7920939" name="Default" comment=".">
+ <change afterPath="$PROJECT_DIR$/scripts/vmcoff.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/music.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/music.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/scenes.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/scenes.php" afterDir="false" />
</list>
<workItem from="1593501805520" duration="1107000" />
<workItem from="1594399361632" duration="763000" />
<workItem from="1594621701186" duration="596000" />
- <workItem from="1595313798230" duration="817000" />
- </task>
- <task id="LOCAL-00282" summary=".">
- <created>1580205716585</created>
- <option name="number" value="00282" />
- <option name="presentableId" value="LOCAL-00282" />
- <option name="project" value="LOCAL" />
- <updated>1580205716585</updated>
+ <workItem from="1595313798230" duration="4556000" />
</task>
<task id="LOCAL-00283" summary=".">
<created>1580377820162</created>
<option name="project" value="LOCAL" />
<updated>1593344786570</updated>
</task>
- <option name="localTasksCounter" value="331" />
+ <task id="LOCAL-00331" summary=".">
+ <created>1595314774388</created>
+ <option name="number" value="00331" />
+ <option name="presentableId" value="LOCAL-00331" />
+ <option name="project" value="LOCAL" />
+ <updated>1595314774389</updated>
+ </task>
+ <option name="localTasksCounter" value="332" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
<screen x="0" y="0" width="2560" height="1040" />
</state>
<state x="760" y="94" key="#Project_Structure/0.0.2560.1040@0.0.2560.1040" timestamp="1592377765650" />
- <state x="960" y="247" key="#com.intellij.openapi.updateSettings.impl.PluginUpdateInfoDialog" timestamp="1585852940968">
- <screen x="0" y="0" width="2560" height="1040" />
- </state>
- <state x="960" y="247" key="#com.intellij.openapi.updateSettings.impl.PluginUpdateInfoDialog/0.0.2560.1040@0.0.2560.1040" timestamp="1585852940968" />
- <state x="935" y="114" width="1170" height="972" key="CommitChangelistDialog2" timestamp="1593344767278">
+ <state x="935" y="114" width="1170" height="972" key="CommitChangelistDialog2" timestamp="1595314761980">
<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="1593086272091" />
- <state x="935" y="114" key="CommitChangelistDialog2/0.0.2560.1040@0.0.2560.1040" timestamp="1593344767278" />
+ <state x="935" y="114" key="CommitChangelistDialog2/0.0.2560.1040@0.0.2560.1040" timestamp="1595314761980" />
<state x="1060" y="275" key="FileChooserDialogImpl" timestamp="1590912263817">
<screen x="0" y="0" width="2560" height="1040" />
</state>
<state x="1060" y="275" key="FileChooserDialogImpl/0.0.2560.1040@0.0.2560.1040" timestamp="1590912263817" />
- <state x="1114" y="443" key="NewPhpFileDialog" timestamp="1592205861310">
+ <state x="1114" y="443" key="NewPhpFileDialog" timestamp="1595317059300">
<screen x="0" y="0" width="2560" height="1040" />
</state>
- <state x="1114" y="443" key="NewPhpFileDialog/0.0.2560.1040@0.0.2560.1040" timestamp="1592205861310" />
+ <state x="1114" y="443" key="NewPhpFileDialog/0.0.2560.1040@0.0.2560.1040" timestamp="1595317059300" />
<state x="1420" y="165" key="SettingsEditor" timestamp="1586722506607">
<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" key="Vcs.Push.Dialog.v2/0.0.1920.1160@0.0.1920.1160" timestamp="1591870150868" />
- <state x="873" y="242" key="Vcs.Push.Dialog.v2/0.0.2560.1040@0.0.2560.1040" timestamp="1585899399605" />
- <state x="1456" y="240" key="com.intellij.ide.util.TipDialog" timestamp="1586418523328">
- <screen x="0" y="0" width="2560" height="1040" />
- </state>
- <state x="1456" y="240" key="com.intellij.ide.util.TipDialog/0.0.2560.1040@0.0.2560.1040" timestamp="1586418523328" />
- <state x="977" y="257" width="607" height="536" key="find.popup" timestamp="1593416527009">
+ <state x="977" y="257" width="607" height="536" key="find.popup" timestamp="1595315147407">
<screen x="0" y="0" width="2560" height="1040" />
</state>
- <state x="977" y="257" width="607" height="536" key="find.popup/0.0.2560.1040@0.0.2560.1040" timestamp="1593416527009" />
+ <state x="977" y="257" width="607" height="536" key="find.popup/0.0.2560.1040@0.0.2560.1040" timestamp="1595315147407" />
</component>
<component name="antWorkspaceConfiguration">
<option name="IS_AUTOSCROLL_TO_SOURCE" value="false" />
['type' => 'function', 'function' => 'bureauAuto', 'args' => [false]],
['type' => 'hue', 'group' => $bureau, 'scene' => array('on' => false, 'brightness' => 0)],
['type' => 'state', 'key' => 'bureau_gradient', 'value' => 'off'],
- ['type' => 'function', 'function' => 'sleepPC', 'args' => ['avion']],
+ ['type' => 'scene', 'scene' => 'bureau/sleepPC'],
],
'bureau/media/play' => [
['type' => 'scene', 'scene' => 'bureau/screen/down'],
'bureau/rideaux/open' => [
['type' => 'domoticz', 'device' => '391', 'command' => true, 'priority' => true],
],
-
'insteon/off' => [
['type' => 'insteon', 'command' => '0?135=I=0=0'],
],
['type' => 'function', 'function' => 'wcVMCOn'],
],
'wc/vmc/off' => [
- ['type' => 'function', 'function' => 'wcVMCOff', 'args' => [0]],
+ ['type' => 'insteon', 'command' => '0?1334=I=0=0'],
],
'sdb/ampli/on' => [
$action['delay'] = 0;
}
if ($action['delay'] > 1) {
- $timeout = $action['delay'] + 30;
- $url = WEB_ROOT . 'scripts/light.php?r=' . $action['r'] . '&delay=' . $action['delay'] . '&scene=' . $action['scene'] . '&sid=' . session_id();
- $lynx = "lynx -connect_timeout=$timeout -dump \"$url\"";
- $cmd = "echo '$lynx' | at now 2>&1";
- $res = `$cmd`;
- echo $cmd . " : $res\n";
+ delayScene($action['scene'], $action['delay']);
} else {
if ($action['delay'] > 0) {
usleep(round($action['delay'] * 1000000));
function _wcVMCOff($timeout)
{
if ($timeout === 0) {
- return insteonCommand('0?1334=I=0=0');
- }
- $rand = rand(100000, 1000000);
- setState('wcTimeout', $rand);
- sleep($timeout);
- if (getState('wcTimeout') == $rand) {
- insteonCommand('0?1334=I=0=0');
+ execScene('wc/vmc/off');
+ return;
}
+ delayHttpCall(WEB_ROOT . 'script/vmcoff.php?delay=' . $timeout, $timeout + 30);
+}
+
+function delayHttpCall($url, $delay)
+{
+ $lynx = "lynx -connect_timeout=$delay -dump \"$url\"";
+ $cmd = "echo '$lynx' | at now 2>&1";
+ return `$cmd`;
+}
+
+function delayScene($scene, $delay)
+{
+ $timeout = $$delay + 30;
+ $url = WEB_ROOT . 'scripts/light.php?delay=' . $delay['delay'] . '&scene=' . $scene . '&sid=' . session_id();
+ return delayHttpCall($url, $timeout);
}
\ No newline at end of file