From fbd214ed34cd55dd6a7117d14c81bc0711720a52 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Wed, 25 Mar 2026 16:55:26 +0100 Subject: [PATCH] . --- .idea/workspace.xml | 5 +++-- scripts/cron/cron.php | 2 -- scripts/lib/automodes.php | 1 - scripts/lib/homeassistant.php | 1 - scripts/lib/scenes.php | 38 ++--------------------------------- 5 files changed, 5 insertions(+), 42 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 87cedeb..b0c0e8b 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -6,6 +6,7 @@ + diff --git a/scripts/cron/cron.php b/scripts/cron/cron.php index 9accfcf..dfce434 100644 --- a/scripts/cron/cron.php +++ b/scripts/cron/cron.php @@ -80,8 +80,6 @@ function cronRooms($cronmin) _logSection('Cuisine'); updateCuisine(); - _logSection('Planetarium'); - checkPlanetarium(); if ($cronmin % 2) { _logSection('WC VMC'); checkWCVMC(); diff --git a/scripts/lib/automodes.php b/scripts/lib/automodes.php index 204e919..2f7f026 100644 --- a/scripts/lib/automodes.php +++ b/scripts/lib/automodes.php @@ -33,7 +33,6 @@ function autoRooms() } updateCuisine(); } - checkPlanetarium(); checkWCVMC(); } diff --git a/scripts/lib/homeassistant.php b/scripts/lib/homeassistant.php index 16ac759..cea97cd 100644 --- a/scripts/lib/homeassistant.php +++ b/scripts/lib/homeassistant.php @@ -12,7 +12,6 @@ const HA_ECO_SUPER = 'switch.ecomode_super'; const HA_HOTTE = 'switch.hotte'; const HA_BAR = 'switch.bar'; const HA_GROW_LAMPS = 'switch.0x00124b0025e24358'; -const HA_PLANETARIUM = 'switch.0xa4c138788071821e'; const HA_OFFICE_CURTAIN = 'input_boolean.rideaux_bureau'; const HA_OFFICE_SCREEN = 'cover.office_screen'; diff --git a/scripts/lib/scenes.php b/scripts/lib/scenes.php index fbd345b..95290fd 100644 --- a/scripts/lib/scenes.php +++ b/scripts/lib/scenes.php @@ -52,7 +52,7 @@ $scenes = [ 'chambre/bed' => [ ['type' => 'scene', 'scene' => 'chambre/bed/base'], ['type' => 'scene', 'scene' => 'chambre/nightlights'], - ['type' => 'scene', 'scene' => 'chambre/planetarium/on'], // Planétarium on + ['type' => 'scene', 'scene' => 'chambre/planetarium/on'], ['type' => 'scene', 'scene' => 'sdb/nuit'], ['type' => 'scene', 'scene' => 'chambre/cheminee/smallfire'], ], @@ -77,8 +77,7 @@ $scenes = [ ['type' => 'function', 'function' => 'bedbrightness', 'args' => [$bedlowscreenbrightness]], ['type' => 'scene', 'scene' => 'chambre/rideaux/close'], ['type' => 'scene', 'scene' => 'sdb/off'], - ['type' => 'scene', 'scene' => 'chambre/planetarium/on'], // Planétarium on - ['type' => 'delay', 'scene' => 'chambre/planetarium/off', 'delay' => 3600], // Planétarium off dans une heure + ['type' => 'scene', 'scene' => 'chambre/planetarium/on'], ], 'chambre/sleep' => [ ['type' => 'scene', 'scene' => 'chambre/cheminee/smallfire'], @@ -213,12 +212,6 @@ $scenes = [ 'chambre/toggle' => [ ['type' => 'function', 'function' => 'chambreToggle'], ], - 'chambre/planetarium/off' => [ - ['type' => 'function', 'function' => 'planetarium', 'args' => [false]], - ], - 'chambre/planetarium/on' => [ - ['type' => 'function', 'function' => 'planetarium', 'args' => [true]], - ], 'chambre/vincent/lecture' => [ ['type' => 'hue', 'light' => $litvincent, 'scene' => array('on' => true, 'brightness' => 35, 'colorTemp' => 346, 'transitionTime' => 10)], ], @@ -959,33 +952,6 @@ function wcOn($vmc = true) } } -function planetarium($on) -{ - setState('planetarium', $on ? '1' : '0'); - checkPlanetarium(false); -} - -function checkPlanetarium($periodicOffCheck = true) -{ - $on = getState('planetarium') == '1'; - $h = date('G'); - if ($h >= 2 && $h <= 20) { - $on = false; - } - if ($on) { - if ($periodicOffCheck) { - $min = intval(date('i')); - if ($min % 30 == 0) { - haAction(HA_PLANETARIUM, 'turn_off'); - sleep(5); - } - } - haAction(HA_PLANETARIUM); - } else { - haAction(HA_PLANETARIUM, 'turn_off'); - } -} - function cheminee($lightId, $room = 'salon', $program = 'fire', $brightness = 1) { $start = time(); -- 2.39.5