]> _ Git - tortuga-home.git/commitdiff
.
authorVincent <vincent@enhydra.fr>
Thu, 19 Sep 2019 08:19:26 +0000 (10:19 +0200)
committerVincent <vincent@enhydra.fr>
Thu, 19 Sep 2019 08:19:26 +0000 (10:19 +0200)
.idea/workspace.xml
scripts/lib/scenes.php
scripts/pop.php
tools/pop/pop.py
tools/pop/scanner.py

index d2d68de582e0511376701722812bbfa3cac14c5c..658c4103b1d3f22e21d2b1f02e5b52374f361f78 100644 (file)
@@ -3,8 +3,10 @@
   <component name="ChangeListManager">
     <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$/scripts/lib/mediarasp.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/mediarasp.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/lib/scenes.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/scenes.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/scripts/pop.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/pop.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/tools/pop/pop.py" beforeDir="false" afterPath="$PROJECT_DIR$/tools/pop/pop.py" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/tools/pop/scanner.py" beforeDir="false" afterPath="$PROJECT_DIR$/tools/pop/scanner.py" afterDir="false" />
     </list>
     <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
     <option name="SHOW_DIALOG" value="false" />
       <workItem from="1568479123874" duration="780000" />
       <workItem from="1568479919445" duration="3458000" />
       <workItem from="1568537483035" duration="1960000" />
-      <workItem from="1568620913133" duration="2579000" />
-    </task>
-    <task id="LOCAL-00182" summary=".">
-      <created>1551428540065</created>
-      <option name="number" value="00182" />
-      <option name="presentableId" value="LOCAL-00182" />
-      <option name="project" value="LOCAL" />
-      <updated>1551428540066</updated>
+      <workItem from="1568620913133" duration="4827000" />
     </task>
     <task id="LOCAL-00183" summary=".">
       <created>1551519481665</created>
       <option name="project" value="LOCAL" />
       <updated>1568621038275</updated>
     </task>
-    <option name="localTasksCounter" value="231" />
+    <task id="LOCAL-00231" summary=".">
+      <created>1568792710779</created>
+      <option name="number" value="00231" />
+      <option name="presentableId" value="LOCAL-00231" />
+      <option name="project" value="LOCAL" />
+      <updated>1568792710779</updated>
+    </task>
+    <option name="localTasksCounter" value="232" />
     <servers />
   </component>
   <component name="TodoView">
index 8bc786d34dc7e952215c3e4de2b7a96bad44e00a..c1f24022775768b7782166bc2cda9c1332b6c16b 100644 (file)
@@ -528,17 +528,27 @@ $scenes = [
         ['type' => 'hue', 'light' => $sdb_ampli, 'scene' => ['on' => false]],
     ],
     'sdb/off' => [
+        ['type' => 'state', 'key' => 'sdb', 'value' => 0],
         ['type' => 'hue', 'group' => $sdb, 'scene' => ['on' => false, 'brightness' => 0, 'effect' => 'none']],
+        ['type' => 'function', 'function' => 'stopSqueezeboxPlayer', 'args' => [$squeezeboxPlayers['WC'], false]],
     ],
     'sdb/on' => [
+        ['type' => 'state', 'key' => 'sdb', 'value' => 1],
         ['type' => 'hue', 'group' => $sdb, 'scene' => ['effect' => 'none']],
         ['type' => 'hue', 'group' => $sdb, 'scene' => '0L4cGh7y29uBBez'],
     ],
+    'sdb/morning' => [
+        ['type' => 'state', 'key' => 'sdb', 'value' => 1],
+        ['type' => 'scene', 'scene' => 'sdb/on'],
+        ['type' => 'function', 'function' => 'squeezePlayByName', 'args' => ['France Info', $squeezeboxPlayers['Salle de bains'], 30]],
+    ],
     'sdb/nuit' => [
+        ['type' => 'state', 'key' => 'sdb', 'value' => 1],
         ['type' => 'hue', 'group' => $sdb, 'scene' => ['effect' => 'none']],
         ['type' => 'hue', 'group' => $sdb, 'scene' => 'ZTZBNRk6VZMlYvB'],
     ],
     'sdb/spa' => [
+        ['type' => 'state', 'key' => 'sdb', 'value' => 1],
         ['type' => 'hue', 'group' => $sdb, 'scene' => ['effect' => 'colorloop', 'on' => true, 'brightness' => 128]],
         ['type' => 'function', 'function' => 'squeezePlayByName', 'args' => ['Rivière', $squeezeboxPlayers['Salle de bains'], 65]],
     ],
@@ -664,6 +674,20 @@ function wcToggle()
     }
 }
 
+function sdbToggle()
+{
+    if (getState('sdb') == 1) {
+        execScene('sdb/off');
+    } else {
+        execScene('sdb/on');
+    }
+}
+
+function sdbMorning()
+{
+    execScene('sdb/on');
+}
+
 function wcOn($vmc = true)
 {
     $hour = getHour();
index 7a57f6839052df3816f284614e5b8f46391d1732..738dce5d7e7d1bce7166e1135f31da74783440b5 100644 (file)
@@ -5,12 +5,20 @@ $_GET['im'] = '5';
 include "import.php";
 
 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');
-       }
+    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
index 0a11e78f0bd9cab15aa2617595d98043b62c1a4d..37f190cc5157c0ace906d67d66420c1b789bd048 100644 (file)
@@ -7,8 +7,8 @@ import sys
 device = sys.argv[1]
 
 map = ['', '', 'tap', 'long', 'double']
-rooms = {'wc': 'wc'}
-macs = {'wc': 'a0:e6:f8:db:ff:2f'}
+rooms = {'wc': 'wc','sdb':'sdb'}
+macs = {'wc': 'a0:e6:f8:db:ff:2f','sdb':'a0:e6:f8:dc:01:d7'}
 
 mac = macs[device]
 room = rooms[device]
index 83bdb50c4a39f0d052196d20c9dc376830b55096..a7802933cfadd174607abb31fa3bc19aa139179f 100644 (file)
@@ -13,7 +13,7 @@ class ScanDelegate(DefaultDelegate):
             print "Received new data from", dev.addr
 
 scanner = Scanner().withDelegate(ScanDelegate())
-devices = scanner.scan(1)
+devices = scanner.scan(10)
 
 for dev in devices:
     print "Device %s (%s), RSSI=%d dB" % (dev.addr, dev.addrType, dev.rssi)