<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$/scripts/lib/medialibrary.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/medialibrary.php" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/config/chambre.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/chambre.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$/scripts/lib/weatherstation.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/weatherstation.php" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<workItem from="1582013653504" duration="1339000" />
<workItem from="1582100423273" duration="2523000" />
<workItem from="1582130476569" duration="857000" />
- <workItem from="1582201880333" duration="2436000" />
- </task>
- <task id="LOCAL-00257" summary=".">
- <created>1577380217123</created>
- <option name="number" value="00257" />
- <option name="presentableId" value="LOCAL-00257" />
- <option name="project" value="LOCAL" />
- <updated>1577380217123</updated>
+ <workItem from="1582201880333" duration="3283000" />
+ <workItem from="1582660044500" duration="814000" />
+ <workItem from="1582796298540" duration="1959000" />
+ <workItem from="1582798438958" duration="112000" />
</task>
<task id="LOCAL-00258" summary=".">
<created>1577380602449</created>
<option name="project" value="LOCAL" />
<updated>1582130758226</updated>
</task>
- <option name="localTasksCounter" value="306" />
+ <task id="LOCAL-00306" summary=".">
+ <created>1582220578115</created>
+ <option name="number" value="00306" />
+ <option name="presentableId" value="LOCAL-00306" />
+ <option name="project" value="LOCAL" />
+ <updated>1582220578115</updated>
+ </task>
+ <option name="localTasksCounter" value="307" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
</state>
<state x="720" y="247" key="#com.intellij.openapi.updateSettings.impl.PluginUpdateInfoDialog/0.0.1920.1040@0.0.1920.1040" timestamp="1577298128269" />
<state x="960" y="247" key="#com.intellij.openapi.updateSettings.impl.PluginUpdateInfoDialog/0.0.2560.1040@0.0.2560.1040" timestamp="1580459136096" />
- <state x="701" y="127" key="CommitChangelistDialog2" timestamp="1582130743400">
+ <state x="701" y="127" width="1170" height="972" key="CommitChangelistDialog2" timestamp="1582220569877">
<screen x="0" y="0" width="1920" height="1160" />
</state>
<state x="701" y="114" key="CommitChangelistDialog2/0.0.1920.1040@0.0.1920.1040" timestamp="1577381105204" />
- <state x="701" y="127" key="CommitChangelistDialog2/0.0.1920.1160@0.0.1920.1160" timestamp="1582130743400" />
+ <state x="701" y="127" width="1170" height="972" key="CommitChangelistDialog2/0.0.1920.1160@0.0.1920.1160" timestamp="1582220569877" />
<state x="935" y="114" key="CommitChangelistDialog2/0.0.2560.1040@0.0.2560.1040" timestamp="1582104424372" />
<state x="92" y="92" width="2376" height="856" key="DiffContextDialog" timestamp="1580377344165">
<screen x="0" y="0" width="2560" height="1040" />
<screen x="0" y="0" width="2560" height="1040" />
</state>
<state x="872" y="242" key="Vcs.Push.Dialog.v2/0.0.2560.1040@0.0.2560.1040" timestamp="1580377827629" />
- <state x="732" y="383" key="com.intellij.ide.util.TipDialog" timestamp="1582201881167">
- <screen x="0" y="0" width="1920" height="1160" />
+ <state x="976" y="343" key="com.intellij.ide.util.TipDialog" timestamp="1582798439144">
+ <screen x="0" y="0" width="2560" height="1040" />
</state>
<state x="732" y="343" key="com.intellij.ide.util.TipDialog/0.0.1920.1040@0.0.1920.1040" timestamp="1577380394903" />
<state x="732" y="383" key="com.intellij.ide.util.TipDialog/0.0.1920.1160@0.0.1920.1160" timestamp="1582201881167" />
- <state x="976" y="343" key="com.intellij.ide.util.TipDialog/0.0.2560.1040@0.0.2560.1040" timestamp="1582100425539" />
- <state x="733" y="287" width="607" height="598" key="find.popup" timestamp="1582125776502">
- <screen x="0" y="0" width="1920" height="1160" />
+ <state x="976" y="343" key="com.intellij.ide.util.TipDialog/0.0.2560.1040@0.0.2560.1040" timestamp="1582798439144" />
+ <state x="977" y="257" width="607" height="536" key="find.popup" timestamp="1582796777847">
+ <screen x="0" y="0" width="2560" height="1040" />
</state>
<state x="732" y="257" width="607" height="536" key="find.popup/0.0.1920.1040@0.0.1920.1040" timestamp="1577380471547" />
<state x="733" y="287" width="607" height="598" key="find.popup/0.0.1920.1160@0.0.1920.1160" timestamp="1582125776502" />
- <state x="977" y="257" width="607" height="536" key="find.popup/0.0.2560.1040@0.0.2560.1040" timestamp="1581412193715" />
+ <state x="977" y="257" width="607" height="536" key="find.popup/0.0.2560.1040@0.0.2560.1040" timestamp="1582796777847" />
<state x="936" y="240" key="run.anything.popup" timestamp="1578386519646">
<screen x="0" y="0" width="2560" height="1040" />
</state>
['type' => 'hue', 'group' => $wc, 'scene' => 'h82j28eNu6ZHVhM'],
['type' => 'function', 'function' => 'squeezePlayByName', 'args' => ['FIP', $squeezeboxPlayers['WC'], 30, false]],
],
+ 'wc/late' => [
+ ['type' => 'hue', 'group' => $wc, 'scene' => 'IGo4F5jRQXc1H95'],
+ ['type' => 'function', 'function' => 'squeezePlayByName', 'args' => ['FIP', $squeezeboxPlayers['WC'], 30, false]],
+ ],
'wc/night' => [
['type' => 'hue', 'group' => $wc, 'scene' => 'eJy09JTEzCiIL1P'],
],
function wcOn($vmc = true)
{
$hour = getHour();
- if ($hour > 2.5 && $hour < 6.75) {
+ if (getNightMode()) {
$period = 'night';
+ } else if ($hour > 0 && $hour < 6.75) {
+ $period = 'late';
} else if ($hour >= 6.75 && $hour < 10) {
$period = 'morning';
} else if ($hour >= 10 && $hour < 20) {
}
function isDay()
+{
+ return getPeriodOfDay()['day'];
+}
+
+function getPeriodOfDay()
{
$time = new DateTime('now', new DateTimeZone('Europe/Paris'));
$timestamp = $time->getTimestamp();
$offset = $time->getOffset() / 3600;
+ $hours = intval(date('H'));
+
$sunrise = date_sunrise($timestamp, SUNFUNCS_RET_TIMESTAMP, LATITUDE, LONGITUDE, 90, $offset);
$sunset = date_sunset($timestamp, SUNFUNCS_RET_TIMESTAMP, LATITUDE, LONGITUDE, 90, $offset);
$sunrise += 3600 * 24;
}
- if ($timestamp < $sunrise || $timestamp > $sunset) {
- return false;
+
+ $start_twilight = $sunset - 3600;
+ $end_twilight = $sunset + 3600;
+
+ $start_dawn = $sunrise - 3600;
+ $end_dawn = $sunrise + 3600;
+
+ $day = !($timestamp < $sunrise || $timestamp >= $sunset);
+
+ if ($timestamp >= $start_twilight && $timestamp < $end_twilight) {
+ $period = 'twilight';
+ } else if ($timestamp >= $start_dawn && $timestamp < $end_dawn) {
+ $period = 'dawn';
+ } else if ($day) {
+
+ } else {
+ $period = 'night';
}
- return true;
+
+ if ($day) {
+ $midday = ($sunset + $sunrise) / 2;
+ } else {
+
+ }
+
+ return ['day' => $day, 'period' => $period];
}
\ No newline at end of file