From 79ab922ae83ca5a8b200e5c2fa16903bfe7ff191 Mon Sep 17 00:00:00 2001 From: Vincent Date: Mon, 7 Sep 2020 09:04:11 +0200 Subject: [PATCH] . --- .idea/workspace.xml | 24 ++++++++++++------------ scripts/lib/scenes.php | 33 ++++++++++++++++----------------- 2 files changed, 28 insertions(+), 29 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 4c3f3ed..9bc4408 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -3,7 +3,6 @@ - @@ -1262,11 +1262,11 @@ - + - + diff --git a/scripts/lib/scenes.php b/scripts/lib/scenes.php index 01701ce..54e3ab4 100644 --- a/scripts/lib/scenes.php +++ b/scripts/lib/scenes.php @@ -572,13 +572,12 @@ $scenes = [ ], 'sdb/off' => [ ['type' => 'state', 'key' => 'sdb', 'value' => 0], - ['type' => 'hue', 'group' => $sdb, 'scene' => ['on' => false]], + ['type' => 'domoticz', 'scene' => 20, 'command' => false, 'priority' => true], ['type' => 'function', 'function' => 'stopSqueezeboxPlayer', 'args' => [$squeezeboxPlayers['Salle de bains'], false]], ], 'sdb/on' => [ ['type' => 'state', 'key' => 'sdb', 'value' => 1], - ['type' => 'hue', 'group' => $sdb, 'scene' => ['effect' => 'none']], - ['type' => 'hue', 'group' => $sdb, 'scene' => 'LmwN0cs0qsep2sA'], + ['type' => 'domoticz', 'scene' => 20, 'command' => true, 'priority' => true], ], 'sdb/morning' => [ ['type' => 'state', 'key' => 'sdb', 'value' => 1], @@ -587,12 +586,11 @@ $scenes = [ ], 'sdb/nuit' => [ ['type' => 'state', 'key' => 'sdb', 'value' => 1], - ['type' => 'hue', 'group' => $sdb, 'scene' => ['effect' => 'none']], - ['type' => 'hue', 'group' => $sdb, 'scene' => 'S59ayiWOy11L2tR'], + ['type' => 'domoticz', 'scene' => 21, 'command' => true, 'priority' => true], ], 'sdb/spa' => [ ['type' => 'state', 'key' => 'sdb', 'value' => 1], - ['type' => 'hue', 'group' => $sdb, 'scene' => ['effect' => 'colorloop', 'on' => true, 'brightness' => 128]], + ['type' => 'domoticz', 'scene' => 22, 'command' => true, 'priority' => true], ['type' => 'function', 'function' => 'squeezePlayByName', 'args' => ['Rivière', $squeezeboxPlayers['Salle de bains'], 65]], ], 'salon/freebox/on' => [ @@ -622,7 +620,6 @@ $scenes = [ ['type' => 'hue', 'group' => $cour, 'scene' => 'WVanIpWUWjkBjsS'], ], 'cour/off' => [ - // ['type' => 'domoticz', 'device' => '678', 'command' => false], ['type' => 'hue', 'group' => $cour, 'scene' => ['on' => false]], ['type' => 'function', 'function' => 'courAuto', 'args' => [false]], ], @@ -934,18 +931,20 @@ function courAuto($on = true) function updateChambreAuto($transitionTime = null) { $hours = intval(date('H')); - if ($hours <= 1) { - $scene = 'tropical'; - } else if ($hours <= 7) { - $scene = 'tonic'; - } else if ($hours <= 11) { + if ($hours <= 4) { + $scene = 'party'; + } else if ($hours <= 9) { $scene = 'boreal'; + } else if ($hours <= 11) { + $scene = 'tonic'; } else if ($hours <= 14) { $scene = 'flowers'; } else if ($hours <= 18) { $scene = 'beach'; - } else { + } else if ($hours <= 22) { $scene = 'tropical'; + } else { + $scene = 'party'; } execScene('chambre/' . $scene, false, $transitionTime); } @@ -953,12 +952,12 @@ function updateChambreAuto($transitionTime = null) function updateBureauAuto() { $hours = intval(date('H')); - if ($hours <= 3) { + if ($hours <= 4) { $scene = 'outrun'; - } else if ($hours <= 7) { - $scene = 'tonic'; - } else if ($hours <= 11) { + } else if ($hours <= 9) { $scene = 'boreal'; + } else if ($hours <= 11) { + $scene = 'tonic'; } else if ($hours <= 14) { $scene = 'flowers'; } else if ($hours <= 18) { -- 2.39.5