From f06a27795c4f0eb31ca7f7bde3f75a78c185a92f Mon Sep 17 00:00:00 2001 From: vincent Date: Wed, 13 Apr 2022 21:35:45 +0200 Subject: [PATCH] . --- .idea/workspace.xml | 21 ++++++++++++--------- scripts/domoticz_device_event.php | 4 ++++ scripts/lib/lib.php | 10 ++++++++++ scripts/lib/scenes.php | 1 - scripts/light.php | 3 +++ 5 files changed, 29 insertions(+), 10 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 8f8e392..317c68b 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -3,7 +3,10 @@ + + + diff --git a/scripts/domoticz_device_event.php b/scripts/domoticz_device_event.php index c8d3372..8745543 100644 --- a/scripts/domoticz_device_event.php +++ b/scripts/domoticz_device_event.php @@ -18,6 +18,10 @@ if (in_array($_GET['device'], $cubesalon)) { require_once "import.php"; +if (gloria()) { + die('0'); +} + if ($_GET['device'] == 480) { chambreToggle(); diff --git a/scripts/lib/lib.php b/scripts/lib/lib.php index 39c2700..6333dad 100644 --- a/scripts/lib/lib.php +++ b/scripts/lib/lib.php @@ -630,3 +630,13 @@ function makeNav($nav) $res .= ''; return $res; } + +function gloria() +{ + $j = intval(date('N')); + if ($j !== 4) { + return false; + } + $h = intval(date('H')); + return $h >= 11 && $h <= 16; +} diff --git a/scripts/lib/scenes.php b/scripts/lib/scenes.php index 1559974..113a4ad 100644 --- a/scripts/lib/scenes.php +++ b/scripts/lib/scenes.php @@ -674,7 +674,6 @@ $scenes = [ ['type' => 'function', 'function' => 'stopAllSqueezebox'], ['type' => 'function', 'function' => 'offAllOMX'], ['type' => 'scene', 'scene' => 'chambre/deshumidificateur/on'], - ['type' => 'phonetask', 'phone' => 'vincent', 'task' => 'Stop All Sounds'], ['type' => 'scene', 'scene' => 'chambre/planetarium/off'], ['type' => 'scene', 'scene' => 'cuisine/coffee/off'], ['type' => 'scene', 'scene' => 'bureau/pc/shutdown'], diff --git a/scripts/light.php b/scripts/light.php index 5444bd5..5176041 100644 --- a/scripts/light.php +++ b/scripts/light.php @@ -2,6 +2,9 @@ include "import.php"; if (isset($_GET['scene'])) { + if ($_GET['scene'] == 'home/welcome/eco' && gloria()) { + $_GET['scene'] = 'home/welcome'; + } execScene($_GET['scene'], true); } else if (isset($_GET['cheminee'])) { if ($_GET['cheminee'] == 'on') { -- 2.39.5