]> _ Git - tortuga-home.git/commitdiff
.
authorVincent <vincent@enhydra.fr>
Sat, 15 May 2021 06:40:53 +0000 (08:40 +0200)
committerVincent <vincent@enhydra.fr>
Sat, 15 May 2021 06:40:53 +0000 (08:40 +0200)
.htaccess
.idea/workspace.xml
js/cordova.js
js/home.js
scripts/setstate.php [new file with mode: 0644]
scripts/state.php

index 6fc10c45da295868117e0f9bcda538b52b267b54..7209fe2aad26c6e3544dfa1a75b49d5c617f5c3e 100644 (file)
--- a/.htaccess
+++ b/.htaccess
@@ -1,4 +1,4 @@
-Require ip 192.168.1.0/24 192.168.13.0/24 127.0.0.0/8 88.190.245.49
+Require ip 192.168.1.0/24 192.168.13.0/24 127.0.0.0/8 88.190.245.49 192.168.17.0/24
 <IfModule mod_rewrite.c>
         Options +FollowSymlinks
         RewriteEngine on
index c837fb1019e0e5de96a06e33af479ee83f3736f2..2b0e91794f1bb671e256936c1ff4c50f7d8fd7a2 100644 (file)
@@ -2,12 +2,12 @@
 <project version="4">
   <component name="ChangeListManager">
     <list default="true" id="352ce63a-b52a-41a2-979b-becda7920939" name="Default" comment=".">
+      <change afterPath="$PROJECT_DIR$/scripts/setstate.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/.htaccess" beforeDir="false" afterPath="$PROJECT_DIR$/.htaccess" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/js/cordova.js" beforeDir="false" afterPath="$PROJECT_DIR$/js/cordova.js" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/js/home.js" beforeDir="false" afterPath="$PROJECT_DIR$/js/home.js" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/js/jquery.min.js" beforeDir="false" afterPath="$PROJECT_DIR$/js/jquery.min.js" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/scripts/lib/weatherstation.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/weatherstation.php" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/style/weatherstation.css" beforeDir="false" afterPath="$PROJECT_DIR$/style/weatherstation.css" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/style/weatherstation.less" beforeDir="false" afterPath="$PROJECT_DIR$/style/weatherstation.less" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/scripts/state.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/state.php" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
         <option name="Make" enabled="true" />
       </method>
     </configuration>
-    <configuration default="true" type="ArquillianJUnit" factoryName="" nameIsGenerated="true">
-      <option name="arquillianRunConfiguration">
-        <value>
-          <option name="containerStateName" value="" />
-        </value>
-      </option>
-      <option name="TEST_OBJECT" value="class" />
-      <method v="2">
-        <option name="Make" enabled="true" />
-      </method>
-    </configuration>
     <configuration default="true" type="ArquillianTestNG" factoryName="">
       <option name="arquillianRunConfiguration">
         <value>
       <workItem from="1620155832676" duration="3040000" />
       <workItem from="1620387281761" duration="3893000" />
       <workItem from="1620391230238" duration="8835000" />
-      <workItem from="1620565702683" duration="5649000" />
-    </task>
-    <task id="LOCAL-00433" summary=".">
-      <created>1610528834225</created>
-      <option name="number" value="00433" />
-      <option name="presentableId" value="LOCAL-00433" />
-      <option name="project" value="LOCAL" />
-      <updated>1610528834226</updated>
+      <workItem from="1620565702683" duration="6590000" />
+      <workItem from="1621059599606" duration="1181000" />
     </task>
     <task id="LOCAL-00434" summary=".">
       <created>1610702549931</created>
       <option name="project" value="LOCAL" />
       <updated>1620207485516</updated>
     </task>
-    <option name="localTasksCounter" value="482" />
+    <task id="LOCAL-00482" summary=".">
+      <created>1620572516162</created>
+      <option name="number" value="00482" />
+      <option name="presentableId" value="LOCAL-00482" />
+      <option name="project" value="LOCAL" />
+      <updated>1620572516163</updated>
+    </task>
+    <option name="localTasksCounter" value="483" />
     <servers />
   </component>
   <component name="TypeScriptGeneratedFilesManager">
index 03dd9b010410661a03b3202dde6d267aac74d333..6c5bf51e2d2e1d2b7d4184fe99c9e596ad37288f 100644 (file)
@@ -71,7 +71,7 @@ function initCordova() {
 
     try {
         document.addEventListener('volumedownbutton', volumeDown, false);
-        document.addEventListener('volumedownbutton', volumeUp, false);
+        document.addEventListener('volumeupbutton', volumeUp, false);
     } catch (e) {
         console.log(e);
     }
index 0eb1ded515dea19b9f79c2666039511e5268ed3d..709ff2cb4ed42820bf9f86667d5e6657e47a8a5b 100644 (file)
@@ -21,6 +21,7 @@ var sleepDate;
 var videoPlaying = false;
 var lastOffScreen = 0;
 var maskRemoteShort = false;
+var power = false;
 
 $(function () {
     console.log('main jquery ready');
@@ -56,6 +57,11 @@ $(function () {
         runSSHQueue();
     }, 1500);
 
+    setInterval(function () {
+        checkPower();
+    }, 60000);
+    checkPower();
+
     console.log('menu init');
     menu = new MmenuLight(
         document.querySelector("#mainnav")
@@ -405,14 +411,18 @@ $(function () {
 
 });
 
-function volumeDown() {
+function checkPower() {
+    $.ajax('scripts/getstate.php?key=' + CONFIG.ROOM + '_power&default=0', function (data) {
+        power = (data == 1);
+    });
+}
 
-    return false;
+function volumeDown() {
+    $.get('scripts/volume.php?action=down');
 }
 
 function volumeUp() {
-
-    return false;
+    $.get('scripts/volume.php?action=up');
 }
 
 
@@ -637,6 +647,9 @@ function showScreenSaver() {
     if ($('main section:visible').data('section') === 'remote') {
         return;
     }
+    if(androidApp && !power){
+        return;
+    }
 
     if (!$(".screensaver").is(':visible')) {
         updateScreenSaver(true);
diff --git a/scripts/setstate.php b/scripts/setstate.php
new file mode 100644 (file)
index 0000000..04fa05a
--- /dev/null
@@ -0,0 +1,3 @@
+<?php
+require_once "import.php";
+setState($_GET['key'], $_GET['value']);
\ No newline at end of file
index f578f0e258f82e85dc260caf51d551387e4fb7b3..21be43c7aab99261210f8194121eae544f72a7b1 100644 (file)
@@ -1,3 +1,3 @@
 <?php
 include "import.php";
-echo getState($_GET['key']);
\ No newline at end of file
+echo getState($_GET['key'], $_GET['default'] ?? null);
\ No newline at end of file