From ae77baf067848a2848f53c6172cc57f64ccb7db9 Mon Sep 17 00:00:00 2001 From: Vincent Date: Sun, 29 Nov 2020 16:44:13 +0100 Subject: [PATCH] . --- .idea/php.xml | 91 ++++++++++++++++++------------------ .idea/workspace.xml | 50 ++++++++++++-------- scripts/lib/medialibrary.php | 4 +- scripts/lib/pc.php | 3 +- scripts/lib/scenes.php | 27 ++++++----- 5 files changed, 92 insertions(+), 83 deletions(-) diff --git a/.idea/php.xml b/.idea/php.xml index 6907af9..9ede0ad 100644 --- a/.idea/php.xml +++ b/.idea/php.xml @@ -6,7 +6,6 @@ - @@ -40,7 +39,6 @@ - @@ -80,53 +78,54 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.idea/workspace.xml b/.idea/workspace.xml index bc0f105..7c4184e 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,12 +2,11 @@ + - - - - - + + + @@ -273,6 +271,17 @@ @@ -1305,12 +1315,12 @@ - + - + @@ -1338,11 +1348,11 @@ - + - + diff --git a/scripts/lib/medialibrary.php b/scripts/lib/medialibrary.php index 5314852..a0c9587 100644 --- a/scripts/lib/medialibrary.php +++ b/scripts/lib/medialibrary.php @@ -141,8 +141,8 @@ function mediaName($name, $context, $dir, $path) // function transcodeOneVideo() { - if (getState('night') == '1') { - //return; + if (getState('night') == '1' || getState('device_avion_awake') == '0') { + return; } $list = getVideosList(true); diff --git a/scripts/lib/pc.php b/scripts/lib/pc.php index 7962578..5cbc62a 100644 --- a/scripts/lib/pc.php +++ b/scripts/lib/pc.php @@ -22,10 +22,11 @@ function sleepPC($device) { $s = 'device_' . $device . '_awake'; if (getState($s) == '0') { + echo 'already sleeping '.$device.' :: '.$s; return; } setState($s, '0'); - $res = sshCommand('"C:\Program Files\Scripts\sleep.bat"', $device, false); + $res = sshCommand('"C:\Program Files\Scripts\sleep.bat"', $device, true); setState($s, '0'); return $res; } \ No newline at end of file diff --git a/scripts/lib/scenes.php b/scripts/lib/scenes.php index 6244bd7..7816a8b 100644 --- a/scripts/lib/scenes.php +++ b/scripts/lib/scenes.php @@ -149,7 +149,7 @@ $scenes = [ ['type' => 'state', 'key' => 'chambre', 'value' => 1], ['type' => 'hue', 'group' => $chambre, 'scene' => 'BNiNQjxiWNbKRaH'], ['type' => 'domoticz', 'scene' => 8, 'command' => true, 'priority' => true], - // ['type' => 'insteon', 'command' => '0?1131=I=0=0'], + // ['type' => 'insteon', 'command' => '0?1131=I=0=0'], ['type' => 'function', 'function' => 'bedbrightness', 'args' => [255]], ['type' => 'scene', 'scene' => 'chambre/cheminee'], ], @@ -158,7 +158,7 @@ $scenes = [ ['type' => 'state', 'key' => 'chambre', 'value' => 1], ['type' => 'hue', 'group' => $chambre, 'scene' => 'Tlcft9sPK492cJA'], ['type' => 'domoticz', 'scene' => 9, 'command' => true, 'priority' => true], - // ['type' => 'insteon', 'command' => '0?1131=I=0=0'], + // ['type' => 'insteon', 'command' => '0?1131=I=0=0'], ['type' => 'function', 'function' => 'bedbrightness', 'args' => [255]], ['type' => 'scene', 'scene' => 'chambre/cheminee/cold'], ], @@ -191,7 +191,7 @@ $scenes = [ ['type' => 'state', 'key' => 'chambre', 'value' => 1], ['type' => 'hue', 'group' => $chambre, 'scene' => 'Mqq8VMsmPQtzEQ0'], ['type' => 'domoticz', 'scene' => 14, 'command' => true, 'priority' => true], - // ['type' => 'insteon', 'command' => '0?1131=I=0=0'], + // ['type' => 'insteon', 'command' => '0?1131=I=0=0'], ['type' => 'function', 'function' => 'bedbrightness', 'args' => [255]], ['type' => 'scene', 'scene' => 'chambre/cheminee'], ], @@ -220,7 +220,7 @@ $scenes = [ ['type' => 'state', 'key' => 'chambre', 'value' => 1], ['type' => 'hue', 'group' => $chambre, 'scene' => 'XGuSVQ3RCd7JUBC'], ['type' => 'domoticz', 'scene' => 17, 'command' => true, 'priority' => true], - // ['type' => 'insteon', 'command' => '0?1131=I=0=0'], + // ['type' => 'insteon', 'command' => '0?1131=I=0=0'], ['type' => 'function', 'function' => 'bedbrightness', 'args' => [255]], ['type' => 'scene', 'scene' => 'chambre/cheminee'], ], @@ -229,7 +229,7 @@ $scenes = [ ['type' => 'state', 'key' => 'chambre', 'value' => 1], ['type' => 'hue', 'group' => $chambre, 'scene' => 'ZkiQbNQDXJz9-OC'], ['type' => 'domoticz', 'scene' => 18, 'command' => true, 'priority' => true], - // ['type' => 'insteon', 'command' => '0?1132=I=0=0'], + // ['type' => 'insteon', 'command' => '0?1132=I=0=0'], ['type' => 'function', 'function' => 'bedbrightness', 'args' => [255]], ['type' => 'scene', 'scene' => 'chambre/cheminee'], ], @@ -242,7 +242,7 @@ $scenes = [ ['type' => 'function', 'function' => 'chambreAuto', 'args' => [false]], ['type' => 'state', 'key' => 'chambre', 'value' => 0], ['type' => 'hue', 'group' => $chambre, 'scene' => array('on' => false, 'brightness' => 0)], - // ['type' => 'insteon', 'command' => '0?1332=I=0=0'], + // ['type' => 'insteon', 'command' => '0?1332=I=0=0'], ['type' => 'domoticz', 'scene' => 19, 'command' => false, 'priority' => true], ], @@ -274,7 +274,7 @@ $scenes = [ ['type' => 'hue', 'light' => $litvincent, 'scene' => array('on' => true, 'brightness' => 20, 'hue' => 0, 'saturation' => 255, 'transitionTime' => 1)], ], 'chambre/vincent/crepuscule' => [ - // ['type' => 'insteon', 'command' => '3?0262261ED00F1300=I=3'], + // ['type' => 'insteon', 'command' => '3?0262261ED00F1300=I=3'], ['type' => 'hue', 'light' => $litvincent, 'scene' => array('on' => true, 'brightness' => 60, 'hue' => '0', 'saturation' => 255, 'transitionTime' => 10)], ['type' => 'hue', 'light' => $litvincent, 'scene' => array('on' => false, 'brightness' => 0, 'transitionTime' => 10 * 60)], //['type' => 'insteon', 'command' => '3?0262261ED00F11FF=I=3'], @@ -346,7 +346,7 @@ $scenes = [ 'salon/cinemabase' => [ ['type' => 'scene', 'scene' => 'cuisine/tamise'], ['type' => 'ecomode', 'mode' => '0'], - // ['type' => 'insteon', 'command' => '0?1111=I=0=0'], + // ['type' => 'insteon', 'command' => '0?1111=I=0=0'], ], 'salon/cineclub' => [ ['type' => 'hue', 'group' => $salon, 'scene' => 'xpCjXtV3u7O1kYu'], @@ -361,13 +361,13 @@ $scenes = [ 'salon/tamise' => [ ['type' => 'ecomode', 'mode' => '0'], ['type' => 'hue', 'group' => $salon, 'scene' => 'RbjnIcLtcDuHbfU'], - // ['type' => 'insteon', 'command' => '0?1130=I=0=0'], + // ['type' => 'insteon', 'command' => '0?1130=I=0=0'], ['type' => 'function', 'function' => 'chemineeOn', 'args' => ['salon', 'fire', 0.8]], ['type' => 'hue', 'group' => $salon, 'scene' => 'RbjnIcLtcDuHbfU'], ], 'salon/lecturenocture' => [ ['type' => 'hue', 'group' => $salon, 'scene' => 'HZiYyM6hMUMkmiY'], - // ['type' => 'insteon', 'command' => '0?1113=I=0=0'], + // ['type' => 'insteon', 'command' => '0?1113=I=0=0'], ['type' => 'function', 'function' => 'chemineeOn', 'args' => ['salon', 'fire', 0.25]], ['type' => 'hue', 'group' => $salon, 'scene' => 'HZiYyM6hMUMkmiY'], ], @@ -389,8 +389,7 @@ $scenes = [ 'salon/fan/toggle' => [ ['type' => 'domoticz', 'device' => '478', 'command' => 'Toggle', 'priority' => true], ], - - 'wakeuppc' => [ + 'bureau/wakeuppc' => [ ['type' => 'function', 'function' => 'wakeupPC', 'args' => ['avion']], ], 'bureau/sleeppc' => [ @@ -487,7 +486,7 @@ $scenes = [ ['type' => 'function', 'function' => 'bureauAuto', 'args' => [false]], ['type' => 'hue', 'group' => $bureau, 'scene' => array('on' => false, 'brightness' => 0)], ['type' => 'state', 'key' => 'bureau_gradient', 'value' => 'off'], - ['type' => 'scene', 'scene' => 'bureau/sleepPC'], + ['type' => 'scene', 'scene' => 'bureau/sleeppc'], ], 'bureau/media/play' => [ ['type' => 'scene', 'scene' => 'bureau/screen/down'], @@ -518,7 +517,7 @@ $scenes = [ ['type' => 'domoticz', 'device' => '391', 'command' => 'Toggle', 'priority' => true], ], 'insteon/off' => [ - // ['type' => 'insteon', 'command' => '0?135=I=0=0'], + // ['type' => 'insteon', 'command' => '0?135=I=0=0'], ], 'home/off' => [ ['type' => 'scene', 'scene' => 'home/hueoff'], -- 2.39.5