]> _ Git - tortuga-home.git/commitdiff
. master
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 27 Mar 2026 09:26:17 +0000 (10:26 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 27 Mar 2026 09:26:17 +0000 (10:26 +0100)
13 files changed:
.idea/workspace.xml
config/global.php
scripts/cron/cron.php
scripts/homeassistant_device_event.php
scripts/lib/automodes.php
scripts/lib/homeassistant.php
scripts/lib/scenes.php
scripts/lib/squeezebox.php
scripts/nightmode.php
scripts/pop.php [deleted file]
scripts/vmcoff.php [deleted file]
scripts/wc.php [deleted file]
scripts/wcvmc.php [deleted file]

index e799e473a47d073294bebaab47bbe482fe79760d..7d373bfdf7eceda3ed3b0c6f338cc842ce40a4dd 100644 (file)
@@ -4,7 +4,19 @@
     <option name="autoReloadType" value="SELECTIVE" />
   </component>
   <component name="ChangeListManager">
-    <list default="true" id="352ce63a-b52a-41a2-979b-becda7920939" name="Default" comment="." />
+    <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/global.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/global.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/scripts/cron/cron.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/cron/cron.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/scripts/homeassistant_device_event.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/homeassistant_device_event.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/scripts/lib/automodes.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/automodes.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/scripts/lib/homeassistant.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/homeassistant.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/squeezebox.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/squeezebox.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/scripts/nightmode.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/nightmode.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/scripts/pop.php" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/scripts/wcvmc.php" beforeDir="false" />
+    </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
     <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
     <option name="hideEmptyMiddlePackages" value="true" />
     <option name="showLibraryContents" value="true" />
   </component>
-  <component name="PropertiesComponent">{
-  &quot;keyToString&quot;: {
-    &quot;RunOnceActivity.OpenProjectViewOnStart&quot;: &quot;true&quot;,
-    &quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
-    &quot;RunOnceActivity.TerminalTabsStorage.copyFrom.TerminalArrangementManager&quot;: &quot;true&quot;,
-    &quot;RunOnceActivity.TerminalTabsStorage.copyFrom.TerminalArrangementManager.252&quot;: &quot;true&quot;,
-    &quot;RunOnceActivity.git.unshallow&quot;: &quot;true&quot;,
-    &quot;RunOnceActivity.typescript.service.memoryLimit.init&quot;: &quot;true&quot;,
-    &quot;SHELLCHECK.PATH&quot;: &quot;C:\\Users\\vince\\AppData\\Roaming\\JetBrains\\IntelliJIdea2025.1\\plugins\\Shell Script\\shellcheck.exe&quot;,
-    &quot;Shell Script.Docker terminal.executor&quot;: &quot;Run&quot;,
-    &quot;Shell Script.Update DNS.executor&quot;: &quot;Run&quot;,
-    &quot;WebServerToolWindowFactoryState&quot;: &quot;true&quot;,
-    &quot;WebServerToolWindowPanel.toolwindow.highlight.mappings&quot;: &quot;true&quot;,
-    &quot;WebServerToolWindowPanel.toolwindow.highlight.symlinks&quot;: &quot;true&quot;,
-    &quot;WebServerToolWindowPanel.toolwindow.show.date&quot;: &quot;false&quot;,
-    &quot;WebServerToolWindowPanel.toolwindow.show.permissions&quot;: &quot;false&quot;,
-    &quot;WebServerToolWindowPanel.toolwindow.show.size&quot;: &quot;false&quot;,
-    &quot;deletionFromPopupRequiresConfirmation&quot;: &quot;false&quot;,
-    &quot;git-widget-placeholder&quot;: &quot;master&quot;,
-    &quot;ignore.virus.scanning.warn.message&quot;: &quot;true&quot;,
-    &quot;junie.onboarding.icon.badge.shown&quot;: &quot;true&quot;,
-    &quot;kotlin-language-version-configured&quot;: &quot;true&quot;,
-    &quot;last_opened_file_path&quot;: &quot;D:/Works/tortuga-home/images&quot;,
-    &quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
-    &quot;node.js.detected.package.tslint&quot;: &quot;true&quot;,
-    &quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
-    &quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;,
-    &quot;nodejs_package_manager_path&quot;: &quot;npm&quot;,
-    &quot;project.structure.last.edited&quot;: &quot;Project&quot;,
-    &quot;project.structure.proportion&quot;: &quot;0.0&quot;,
-    &quot;project.structure.side.proportion&quot;: &quot;0.2&quot;,
-    &quot;ruby.rails.projectView.checked&quot;: &quot;true&quot;,
-    &quot;settings.editor.selected.configurable&quot;: &quot;preferences.pluginManager&quot;,
-    &quot;vue.rearranger.settings.migration&quot;: &quot;true&quot;
+  <component name="PropertiesComponent"><![CDATA[{
+  "keyToString": {
+    "RunOnceActivity.OpenProjectViewOnStart": "true",
+    "RunOnceActivity.ShowReadmeOnStart": "true",
+    "RunOnceActivity.TerminalTabsStorage.copyFrom.TerminalArrangementManager": "true",
+    "RunOnceActivity.TerminalTabsStorage.copyFrom.TerminalArrangementManager.252": "true",
+    "RunOnceActivity.git.unshallow": "true",
+    "RunOnceActivity.typescript.service.memoryLimit.init": "true",
+    "SHELLCHECK.PATH": "C:\\Users\\vince\\AppData\\Roaming\\JetBrains\\IntelliJIdea2025.1\\plugins\\Shell Script\\shellcheck.exe",
+    "Shell Script.Docker terminal.executor": "Run",
+    "Shell Script.Update DNS.executor": "Run",
+    "WebServerToolWindowFactoryState": "true",
+    "WebServerToolWindowPanel.toolwindow.highlight.mappings": "true",
+    "WebServerToolWindowPanel.toolwindow.highlight.symlinks": "true",
+    "WebServerToolWindowPanel.toolwindow.show.date": "false",
+    "WebServerToolWindowPanel.toolwindow.show.permissions": "false",
+    "WebServerToolWindowPanel.toolwindow.show.size": "false",
+    "codeWithMe.voiceChat.enabledByDefault": "false",
+    "deletionFromPopupRequiresConfirmation": "false",
+    "git-widget-placeholder": "master",
+    "ignore.virus.scanning.warn.message": "true",
+    "junie.onboarding.icon.badge.shown": "true",
+    "kotlin-language-version-configured": "true",
+    "last_opened_file_path": "D:/Works/tortuga-home/images",
+    "node.js.detected.package.eslint": "true",
+    "node.js.detected.package.tslint": "true",
+    "node.js.selected.package.eslint": "(autodetect)",
+    "node.js.selected.package.tslint": "(autodetect)",
+    "nodejs_package_manager_path": "npm",
+    "project.structure.last.edited": "Project",
+    "project.structure.proportion": "0.0",
+    "project.structure.side.proportion": "0.2",
+    "ruby.rails.projectView.checked": "true",
+    "settings.editor.selected.configurable": "preferences.pluginManager",
+    "vue.rearranger.settings.migration": "true"
   }
-}</component>
+}]]></component>
   <component name="RecentsManager">
     <key name="CopyFile.RECENT_KEYS">
       <recent name="D:\Works\tortuga-home\images" />
       <workItem from="1774028822942" duration="792000" />
       <workItem from="1774430967346" duration="6359000" />
       <workItem from="1774441121722" duration="7518000" />
+      <workItem from="1774603188976" duration="327000" />
     </task>
     <task id="LOCAL-00502" summary=".">
       <created>1641726946298</created>
       <option name="project" value="LOCAL" />
       <updated>1687259667913</updated>
     </task>
-    <option name="localTasksCounter" value="647" />
+    <option name="localTasksCounter" value="648" />
     <servers />
   </component>
   <component name="TypeScriptGeneratedFilesManager">
index 6d2f9fa34f0e31062f75e787b6792fd3847b4ff3..d9ac8e77f86fb78ca37c38845f14cf0a26dbb329 100644 (file)
@@ -22,7 +22,6 @@ $squeezeboxPlayers = array(
     'Cuisine' => '00:04:20:2a:05:2e',
     'Lit Jérôme' => 'b8:27:eb:62:d3:ce',
     'Lit Vincent' => 'b8:27:eb:40:0e:e9',
-    'WC' => 'b8:27:eb:f6:1d:30',
     'Salon' => '00:04:20:17:82:8b',
     'Bureau' => 'dc:a6:32:50:70:42',
 );
@@ -59,7 +58,6 @@ $squeezeboxPlayersByRoom = [
     'salon' => ['Salon'],
     'cuisine' => ['Cuisine'],
     'sdb' => ['Salle de bains'],
-    'wc' => ['WC'],
 ];
 
 $devices = [
@@ -71,7 +69,6 @@ $devices = [
     'chambre' => ['id' => 'chambre', 'host' => '192.168.13.65', 'user' => 'pi', 'password' => 'atacama'],
     'salon' => ['id' => 'salon', 'host' => '192.168.13.66', 'shield' => '192.168.13.40', 'user' => 'pi', 'password' => 'atacama'],
     'bureau' => ['id' => 'bureau', 'shield' => '192.168.13.41'],
-    'wc' => ['id' => 'wc', 'host' => '192.168.13.67', 'user' => 'pi', 'password' => 'raspberry'],
     'cuisine' => ['id' => 'cuisine', 'host' => '192.168.13.68', 'shield' => '192.168.13.31', 'user' => 'pi', 'password' => 'atacama'],
     'bureausun' => ['id' => 'bureausun', 'host' => '192.168.13.70', 'shield' => '192.168.13.41', 'user' => 'pi', 'password' => 'atacama'],
     'lit' => ['id' => 'lit', 'host' => '192.168.13.69', 'user' => 'pi', 'password' => 'atacama'],
index dfce43465c0c2869046e5415a82cd7e43fae8f21..05095306fd824e1e25003cd95ad0b1dd27abaac7 100644 (file)
@@ -80,10 +80,6 @@ function cronRooms($cronmin)
 
     _logSection('Cuisine');
     updateCuisine();
-    if ($cronmin % 2) {
-        _logSection('WC VMC');
-        checkWCVMC();
-    }
 }
 
 function cronPing($cronmin)
index d67aafd843f930c5c40b1f3d9daedd45e21bd717..e0ba0eda3b37b853989703e8be80b4e4d6e29376 100644 (file)
@@ -5,8 +5,7 @@ $_GET['im'] = '5';
 if ($_GET['state'] === 'None') {
     exit;
 }
-const HA_SWITCH_BUREAU = 'event.double_interrupeur_cour_action';
-const HA_SWITCH_WC = 'event.interrupteur_wc_action';
+
 const HA_CUBE_BUREAU = 'event.cube_bureau_action';
 const HA_SWITCH_BEDROOM = 'binary_sensor.switch_bedroom';
 const HA_CUBE_BATHROOM = 'sensor.0x00158d0005c19a86_action';
@@ -20,10 +19,6 @@ switch ($_GET['id']) {
         $action = 'projSensor';
         $forceConfig = 'salon';
         break;
-    case HA_SWITCH_WC:
-        $action = 'wcSwitch';
-        $forceConfig = 'wc';
-        break;
     case HA_CUBE_BUREAU:
         $forceConfig = 'bureau';
         $action = 'cubeBureau';
@@ -68,27 +63,6 @@ function getCubeFace($id = null)
     return (int)haGetState($id);
 }
 
-function wcSwitch()
-{
-    switch ($_GET['state']) {
-        case '1_double':
-        case '2_double':
-        case 'double':
-            execScene('wc/spa', true);
-            setState('wc', 1);
-            break;
-
-        case 'hold':
-        case 'single':
-            wcToggle();
-            wcToggle();
-            break;
-        default:
-            break;
-    }
-}
-
-
 function cubeBureau()
 {
     if (gloria()) {
index 2f7f0264aab61078153f9a781e366bb8a511fe42..fbae4ddd5620e1df9d878411e308da87f00e6262 100644 (file)
@@ -33,7 +33,6 @@ function autoRooms()
         }
         updateCuisine();
     }
-    checkWCVMC();
 }
 
 function updateBureauAuto()
index cea97cd47b304ab69a1622d92836d5eda6dfe3d5..653bdd893f09cecd447d0eeef95ceb036dfd7fe6 100644 (file)
@@ -5,7 +5,6 @@ const HA_URL = 'http://192.168.13.8:8123/';
 const HA_COCODRILO_KEY = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiI0NjNhOWVhNzIyYzY0ZGRlODhkODY3ZDdhZDc2N2NmOSIsImlhdCI6MTc0OTA0MDkxNCwiZXhwIjoyMDY0NDAwOTE0fQ.0cwLyGhpd0XK4NaO2cK0686SNRor7jAQqdEDb9vos6Q';
 const HA_COCODRILO_URL = 'http://cocodrilo.enhydra.fr:18832/';
 
-const HA_WC_VMC = 'switch.0x847127fffe280f20';
 const HA_SDB_AMPLI = 'switch.0xa4c138168147c1b6';
 const HA_ECO_BASIC = 'switch.ecomode_basic';
 const HA_ECO_SUPER = 'switch.ecomode_super';
index 5095edf0feaeb611205d0b2da928f366a7d7771c..bb293f2f6dd64a73d663693e338c67ae1bb9076b 100644 (file)
@@ -7,7 +7,6 @@ $cheminee = array('salon' => 1, 'chambre' => 6);
 $chambre = 2;
 $salon = 3;
 $cuisine = 8;
-$wc = 9;
 $bureau = 13;
 $sdb = 14;
 $cour = 11;
@@ -631,21 +630,6 @@ $scenes = [
     'home/hueoff' => [
         ['type' => 'hue', 'group' => 17, 'scene' => ['on' => false, 'effect' => 'none']],
     ],
-    'wc/on' => [
-        ['type' => 'function', 'function' => 'wcOn'],
-    ],
-
-//    'wc/nightambiance' => [
-//        ['type' => 'hue', 'group' => $wc, 'scene' => ['effect' => 'none']],
-//        ['type' => 'scene', 'scene' => 'wc/night'],
-//        ['type' => 'function', 'function' => 'squeezePlayByName', 'args' => ['Nuit d\'été', $squeezeboxPlayers['WC'], 100, false]],
-//    ],
-
-    'wc/spa' => [
-        ['type' => 'hue', 'group' => $wc, 'scene' => ['effect' => 'colorloop', 'on' => true, 'brightness' => 128]],
-        ['type' => 'function', 'function' => 'squeezePlayByName', 'args' => ['Rivière', $squeezeboxPlayers['WC'], 100]],
-        ['type' => 'function', 'function' => 'wcVMCOff'],
-    ],
 
     'sdb/ampli/on' => [
         ['type' => 'ha', 'device' => HA_SDB_AMPLI, 'priority' => true],
@@ -954,44 +938,6 @@ function bedbrightness($brightness)
     sshCommand($cmd, 'litjerome');
 }
 
-
-function wcVMCOn()
-{
-    setState('lastVMCOn', time());
-    // Start VMC
-    haAction(HA_WC_VMC);
-}
-
-function wcVMCOff($timeout = 'auto')
-{
-    if ($timeout === 'auto') {
-        $d = time() - getState('lastVMCOn');
-        if ($d <= 120) {
-            $timeout = 1200;
-        } else if ($d <= 300) {
-            $timeout = 1800;
-        } else {
-            $timeout = 3200;
-        }
-    }
-    $t = time() + $timeout;
-    $max = max(getState('wcVMCOff', -1), $t);
-    setState('wcVMCOff', $max);
-    if ($max <= time()) {
-        execScene('wc/vmc/off');
-    }
-}
-
-function checkWCVMC()
-{
-    $offtime = getState('wcVMCOff', -1);
-    $time = time();
-    if ($offtime == -1 || $offtime > $time || getState('lastVMCOn') > $offtime) {
-        return;
-    }
-    execScene('wc/vmc/off');
-}
-
 function delayHttpCall($url, $params, $delay)
 {
     try {
index c00c648d834e0a61ce926f5efdc3d8e72b664b45..d900db979896b59ca2496b303b14eece466ae571 100644 (file)
@@ -148,7 +148,6 @@ function squeezePlayByName($musicName, $player, $volume = null, $playIfSync = tr
     $player = _player($player);
 
     $sdb = $player === 'Salle de bains' || $player == $squeezeboxPlayers['Salle de bains'];
-    $wc = $player === 'WC' || $player == $squeezeboxPlayers['WC'];
 
     $currentMusicKey = 'squeezeplaybyname_' . $player;
     $s = getSqueezePlayerStatusName($player);
@@ -161,25 +160,11 @@ function squeezePlayByName($musicName, $player, $volume = null, $playIfSync = tr
     global $allmusics;
     $m = $allmusics[$musicName];
 
-    if ($wc) {
-        squeezeRequest('pause', $player);
-        if ($currentMusic !== $musicName) {
-            setState($currentMusicKey, $musicName);
-            foreach ($m['commands'] as $command) {
-                echo $player . ':' . $command . '<br />';
-                squeezeRequest($command, $player);
-            }
-        } else {
-            squeezeRequest('button jump_fwd', $player);
-        }
-    } else {
-        squeezeRequest('pause', $player);
-        foreach ($m['commands'] as $command) {
-            echo $player . ':' . $command . '<br />';
-            squeezeRequest($command, $player);
-        }
+    squeezeRequest('pause', $player);
+    foreach ($m['commands'] as $command) {
+        echo $player . ':' . $command . '<br />';
+        squeezeRequest($command, $player);
     }
-
     _squeezePlay($player, $volume);
 }
 
index bc694feba0a2e50ae3c8273d23dcaf7d3360275d..4e8ee5221d1b5f436a4963001bf2ed29b743849d 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 require_once "import.php";
-$devices = ['entree', 'cuisine', 'salon', 'wc', 'bureau', 'chambre', 'sdb'];
+$devices = ['entree', 'cuisine', 'salon', 'bureau', 'chambre', 'sdb'];
 foreach ($devices as $device) {
     echo $device . ' : ' . getNightMode($device) . "<br>";
 }
\ No newline at end of file
diff --git a/scripts/pop.php b/scripts/pop.php
deleted file mode 100644 (file)
index faa7dff..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-<?php
-
-define('TIMELIMIT', 1);
-$_GET['im'] = '5';
-include "import.php";
-
-if (getState('guest', '0') === '1' && $_GET['action'] == 'long') {
-    $_GET['action'] = 'tap';
-}
-
-if ($_GET['button'] == 'wc') {
-    if ($_GET['action'] == 'tap') {
-        wcToggle();
-    } else if ($_GET['action'] == 'double') {
-        execScene('wc/spa');
-        setState('wc', 1);
-    } else if ($_GET['action'] == 'long') {
-        execScene('home/alert');
-    }
-} elseif ($_GET['button'] == 'sdb') {
-    if ($_GET['action'] == 'tap') {
-        sdbToggle();
-    } else if ($_GET['action'] == 'double') {
-        execScene('sdb/morning');
-    } else if ($_GET['action'] == 'long') {
-        execScene('home/alert');
-    }
-}
\ No newline at end of file
diff --git a/scripts/vmcoff.php b/scripts/vmcoff.php
deleted file mode 100644 (file)
index 5c6ea72..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<?php
-
-include "import.php";
-
-$rand = rand(100000, 1000000);
-setState('wcTimeout', $rand);
-sleep($_GET['delay']);
-if (getState('wcTimeout') == $rand) {
-    execScene('wc/vmc/off');
-}
\ No newline at end of file
diff --git a/scripts/wc.php b/scripts/wc.php
deleted file mode 100644 (file)
index f7d677d..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-<?php
-include "import.php";
-wcToggle();
\ No newline at end of file
diff --git a/scripts/wcvmc.php b/scripts/wcvmc.php
deleted file mode 100644 (file)
index 6450f2e..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-<?php
-include "import.php";
-checkWCVMC();
\ No newline at end of file