<project version="4">
<component name="ChangeListManager">
<list default="true" id="352ce63a-b52a-41a2-979b-becda7920939" name="Default" comment=".">
+ <change afterPath="$PROJECT_DIR$/servers/hue.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/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/hue.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/hue.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" />
<property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1553247665857" />
<property name="dumpAutoload T:/Drive/Works/home/composer.json" value="--no-interaction --ansi --verbose --optimize" />
<property name="editor.config.ad.shown" value="true" />
- <property name="last_opened_file_path" value="$PROJECT_DIR$/config" />
+ <property name="last_opened_file_path" value="$PROJECT_DIR$/servers" />
<property name="list.type.of.created.stylesheet" value="Less" />
<property name="nodejs_package_manager_path" value="npm" />
<property name="project.structure.last.edited" value="Project" />
<property name="settings.editor.selected.configurable" value="preferences.pluginManager" />
</component>
<component name="RecentsManager">
+ <key name="CopyFile.RECENT_KEYS">
+ <recent name="T:\Drive\Works\home\servers" />
+ <recent name="T:\Drive\Works\home\config" />
+ <recent name="T:\Drive\Works\home\images\backgrounds" />
+ <recent name="T:\Drive\Works\home\tools\xplanet" />
+ <recent name="T:\Drive\Works\home\tools\pop" />
+ </key>
<key name="MoveFile.RECENT_KEYS">
<recent name="T:\Drive\Works\home\tools\xplanet" />
<recent name="T:\Drive\Works\home\style\fonts\webfonts" />
<recent name="T:\Drive\Works\home\images" />
<recent name="D:\CloudStation\Works\home\style\fonts" />
</key>
- <key name="CopyFile.RECENT_KEYS">
- <recent name="T:\Drive\Works\home\config" />
- <recent name="T:\Drive\Works\home\images\backgrounds" />
- <recent name="T:\Drive\Works\home\tools\xplanet" />
- <recent name="T:\Drive\Works\home\tools\pop" />
- <recent name="T:\Drive\Works\home\scripts\lib" />
- </key>
</component>
<component name="RunManager">
<configuration default="true" type="Applet">
<option name="Make" enabled="true" />
</method>
</configuration>
+ <configuration default="true" type="ArquillianJUnit" factoryName="" nameIsGenerated="true">
+ <option name="arquillianRunConfiguration">
+ <value>
+ <option name="containerStateName" value="" />
+ </value>
+ </option>
+ <option name="TEST_OBJECT" value="class" />
+ <method v="2">
+ <option name="Make" enabled="true" />
+ </method>
+ </configuration>
<configuration default="true" type="ArquillianTestNG" factoryName="">
<option name="arquillianRunConfiguration">
<value>
<workItem from="1602581583330" duration="1284000" />
<workItem from="1602862886793" duration="1014000" />
<workItem from="1603095373591" duration="1368000" />
- <workItem from="1603270756890" duration="2727000" />
- </task>
- <task id="LOCAL-00300" summary=".">
- <created>1581951532460</created>
- <option name="number" value="00300" />
- <option name="presentableId" value="LOCAL-00300" />
- <option name="project" value="LOCAL" />
- <updated>1581951532461</updated>
+ <workItem from="1603270756890" duration="3366000" />
+ <workItem from="1603558842019" duration="446000" />
</task>
<task id="LOCAL-00301" summary=".">
<created>1582014172949</created>
<option name="project" value="LOCAL" />
<updated>1603131455369</updated>
</task>
- <option name="localTasksCounter" value="349" />
+ <task id="LOCAL-00349" summary=".">
+ <created>1603276030272</created>
+ <option name="number" value="00349" />
+ <option name="presentableId" value="LOCAL-00349" />
+ <option name="project" value="LOCAL" />
+ <updated>1603276030273</updated>
+ </task>
+ <option name="localTasksCounter" value="350" />
<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="198" y="0" width="745" height="567" key="CommitChangelistDialog2" timestamp="1603131428714">
+ <state x="198" y="0" width="745" height="567" key="CommitChangelistDialog2" timestamp="1603275999359">
<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="198" y="0" width="745" height="567" key="CommitChangelistDialog2/0.0.2560.1040@0.0.2560.1040" timestamp="1603131428714" />
+ <state x="198" y="0" width="745" height="567" key="CommitChangelistDialog2/0.0.2560.1040@0.0.2560.1040" timestamp="1603275999359" />
<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="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">
+ <state x="977" y="257" width="607" height="536" key="find.popup" timestamp="1603559077781">
<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="1598297024487" />
+ <state x="977" y="257" width="607" height="536" key="find.popup/0.0.2560.1040@0.0.2560.1040" timestamp="1603559077781" />
</component>
<component name="antWorkspaceConfiguration">
<option name="IS_AUTOSCROLL_TO_SOURCE" value="false" />
return $hue;
}
-//function hueScene($id,$intensity)
-//{
-// $command=new Phue\Test\Command\
-//
-// $hue = getHueInstance();
-// $hue->sendCommand();
-//}
-
function getHueState()
{
$hue = getHueInstance();
return array('groups' => $hue->getGroups(), 'scenes' => $hue->getScenes(), 'lights' => $hue->getLights());
}
+function hueCommand($action, $transitionTime)
+{
+ $redis = connectRedis();
+ $queue = $redis->igbget('hue_queue');
+ if (!is_array($queue)) {
+ $queue = [];
+ }
+ $command = $action;
+ $command['transitionTime'] = $transitionTime;
+ $queue[] = $command;
+ $redis->igbset('hue_queue', $queue);
+ $redis->publish('hue_queue', 'handle_queue');
+}
+
+function _hueCommand($action)
+{
+ if (isset($action['group'])) {
+ hueApplyScene($action['group'], $action['scene'], $action['transitionTime']);
+ } else if (isset($action['light'])) {
+ hueApplySceneLight($action['light'], $action['scene'], $action['transitionTime']);
+ }
+}
function hueApplyScene($groupId, $sceneId, $transitionTime = null)
{