<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
- <component name="dataSourceStorageLocal" created-in="IU-222.4345.14">
+ <component name="dataSourceStorageLocal" created-in="IU-222.4459.24">
<data-source name="LFY(3).db" uuid="e5a3291d-855f-44b2-be41-76fe6b0c2136">
<database-info product="SQLite" version="3.25.1" jdbc-version="2.1" driver-name="SQLite JDBC" driver-version="3.25.1" dbms="SQLITE" exact-version="3.25.1" exact-driver-version="3.25">
<identifier-quote-string>"</identifier-quote-string>
<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/water.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/water.php" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/scripts/hotwater.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/hotwater.php" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/scripts/lib/redis.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/redis.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/switchbot.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/switchbot.php" afterDir="false" />
</list>
<workItem from="1667037570905" duration="1563000" />
<workItem from="1667739527547" duration="1293000" />
<workItem from="1668006276656" duration="1860000" />
- <workItem from="1668260964528" duration="1497000" />
- </task>
- <task id="LOCAL-00493" summary=".">
- <created>1639302540066</created>
- <option name="number" value="00493" />
- <option name="presentableId" value="LOCAL-00493" />
- <option name="project" value="LOCAL" />
- <updated>1639302540067</updated>
+ <workItem from="1668260964528" duration="2677000" />
+ <workItem from="1668672202122" duration="723000" />
+ <workItem from="1668769338986" duration="676000" />
+ <workItem from="1669206068222" duration="2217000" />
+ <workItem from="1669377758083" duration="43000" />
</task>
<task id="LOCAL-00494" summary=".">
<created>1639837981727</created>
<option name="project" value="LOCAL" />
<updated>1668013144815</updated>
</task>
- <option name="localTasksCounter" value="542" />
+ <task id="LOCAL-00542" summary=".">
+ <created>1668415032851</created>
+ <option name="number" value="00542" />
+ <option name="presentableId" value="LOCAL-00542" />
+ <option name="project" value="LOCAL" />
+ <updated>1668415032851</updated>
+ </task>
+ <option name="localTasksCounter" value="543" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
],
'home/welcome/eco' => [
+ ['type' => 'function', 'function' => 'welcomeEco'],
+ ],
+
+ 'home/welcome/eco/salon' => [
['type' => 'scene', 'scene' => 'cuisine/on'],
['type' => 'scene', 'scene' => 'salon/auto'],
['type' => 'ecomode', 'mode' => '0'],
['type' => 'scene', 'scene' => 'sdb/hotwater/auto'],
],
+ 'home/welcome/eco/homeoffice' => [
+ ['type' => 'scene', 'scene' => 'cuisine/coffee/on'],
+ ['type' => 'scene', 'scene' => 'bureau/auto'],
+ ['type' => 'ecomode', 'mode' => '0'],
+ ['type' => 'scene', 'scene' => 'sdb/hotwater/auto'],
+ ],
+
'home/welcome' => [
['type' => 'scene', 'scene' => 'home/welcome/eco'],
['type' => 'scene', 'scene' => 'bureau/auto'],
['type' => 'function', 'function' => 'hotwaterAutoMode', 'args' => ['1']],
],
'sdb/hotwater/auto/force' => [
- ['type' => 'function', 'function' => 'hotwaterAutoMode', 'args' => ['1',true]],
+ ['type' => 'function', 'function' => 'hotwaterAutoMode', 'args' => ['1', true]],
],
'sdb/hotwater/eco' => [
['type' => 'function', 'function' => 'hotwaterAutoMode', 'args' => ['0']],
];
+function welcomeEco()
+{
+ $businessHour = [7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19];
+ if (isWeekEnd() || !in_array(date('G'), $businessHour)) {
+ execScene('home/welcome/eco/salon');
+ } else {
+ execScene('home/welcome/eco/homeoffice');
+ }
+}
+
function chambreRideaux($ouvre = true)
{
$device = 1756;
$vincent = isVincent($force);
$h = date('G');
- $d = date('N');
- $isWeek = $d < 6;
- $maxLevel = $jerome ? "2" : '1';
+ $isWeek = isWeekDay();
+
+ $maxLevel = '2';
$ecomode = (int)getState('ecomode', '0');
}
}
}
- echo "\n\n" . 'V:' . $vincent . '/J:' . $jerome . '/H:' . $h . '/D:' . $d . '/W:' . $hot . "\n\n";
+ echo "\n\n" . 'V:' . $vincent . '/J:' . $jerome . '/H:' . $h . '/WD:' . $isWeek . '/W:' . $hot . "\n\n";
hotwater($hot);
}
return $res;
}
+function isWeekDay()
+{
+ $d = date('N');
+ return $d < 6;
+}
+
+function isWeekEnd()
+{
+ return !isWeekDay();
+}
+
function isVincent($force = false)
{
return remember('vincent_in_paris', 3600, function () {