]> _ Git - tortuga-home.git/commitdiff
.
authorVincent <vincent@enhydra.fr>
Sat, 6 Jun 2020 10:47:27 +0000 (12:47 +0200)
committerVincent <vincent@enhydra.fr>
Sat, 6 Jun 2020 10:47:27 +0000 (12:47 +0200)
.idea/workspace.xml
tools/pop/pop.py
tools/pop/startpopdaemon

index 8d706cc37ab93c3d80deaa6ea92d98ca35115c4f..3dde7a4976530bb906c40a8d6e53e870c39f3c49 100644 (file)
@@ -3,14 +3,8 @@
   <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$/config/sdb.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/sdb.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/lib/domoticz.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/domoticz.php" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/scripts/lib/flowerpower.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/flowerpower.php" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/scripts/lib/lib.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/lib.php" 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$/tools/pop/pop.py" beforeDir="false" afterPath="$PROJECT_DIR$/tools/pop/pop.py" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/tools/pop/startpopdaemon" beforeDir="false" afterPath="$PROJECT_DIR$/tools/pop/startpopdaemon" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
       <workItem from="1590315129913" duration="3707000" />
       <workItem from="1590912219927" duration="2795000" />
       <workItem from="1591437119712" duration="23000" />
-      <workItem from="1591437163856" duration="499000" />
-    </task>
-    <task id="LOCAL-00273" summary=".">
-      <created>1578556621586</created>
-      <option name="number" value="00273" />
-      <option name="presentableId" value="LOCAL-00273" />
-      <option name="project" value="LOCAL" />
-      <updated>1578556621586</updated>
+      <workItem from="1591437163856" duration="1334000" />
+      <workItem from="1591438704520" duration="1634000" />
     </task>
     <task id="LOCAL-00274" summary=".">
       <created>1578556780231</created>
       <option name="project" value="LOCAL" />
       <updated>1590317532388</updated>
     </task>
-    <option name="localTasksCounter" value="322" />
+    <task id="LOCAL-00322" summary=".">
+      <created>1591437757807</created>
+      <option name="number" value="00322" />
+      <option name="presentableId" value="LOCAL-00322" />
+      <option name="project" value="LOCAL" />
+      <updated>1591437757808</updated>
+    </task>
+    <option name="localTasksCounter" value="323" />
     <servers />
   </component>
   <component name="TypeScriptGeneratedFilesManager">
       <screen x="0" y="0" width="2560" height="1040" />
     </state>
     <state x="960" y="247" key="#com.intellij.openapi.updateSettings.impl.PluginUpdateInfoDialog/0.0.2560.1040@0.0.2560.1040" timestamp="1585852940968" />
-    <state x="935" y="114" width="1170" height="972" key="CommitChangelistDialog2" timestamp="1590317522596">
+    <state x="935" y="114" width="1170" height="972" key="CommitChangelistDialog2" timestamp="1591437749116">
       <screen x="0" y="0" width="2560" height="1040" />
     </state>
-    <state x="935" y="114" key="CommitChangelistDialog2/0.0.2560.1040@0.0.2560.1040" timestamp="1590317522596" />
+    <state x="935" y="114" key="CommitChangelistDialog2/0.0.2560.1040@0.0.2560.1040" timestamp="1591437749116" />
     <state x="1060" y="275" key="FileChooserDialogImpl" timestamp="1590912263817">
       <screen x="0" y="0" width="2560" height="1040" />
     </state>
index 88a2b29c7ee55eece65e58e92cbcf653d3f30c53..81f927a4e8d65e14bbfa8e223cb20f6db5e3a8c2 100644 (file)
@@ -7,12 +7,13 @@ import sys
 device = sys.argv[1]
 
 map = ['', '', 'tap', 'long', 'double']
-rooms = {'wc': 'wc', 'sdb':'sdb'}
-macs = {'wc': 'a0:e6:f8:db:ff:2f','sdb':'a0:e6:f8:dc:01:d7'}
+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]
 
+
 class MyDelegate(btle.DefaultDelegate):
     def __init__(self):
         btle.DefaultDelegate.__init__(self)
@@ -34,28 +35,30 @@ print("Connecting to " + mac + " (" + device + ")")
 
 while True:
     # Initialisation  -------
+    print("Connecting")
     try:
         p = btle.Peripheral(mac, btle.ADDR_TYPE_PUBLIC)
-    except btle.BTLEDisconnectError:
-        continue
+        p.setDelegate(MyDelegate())
 
-    p.setDelegate(MyDelegate())
+        # Setup to turn notifications on, e.g.
+        svc = p.getServiceByUUID("0000fe61-0000-1000-8000-00805f9b34fb")
+        ch = svc.getCharacteristics()[0]
 
-    # Setup to turn notifications on, e.g.
-    svc = p.getServiceByUUID("0000fe61-0000-1000-8000-00805f9b34fb")
-    ch = svc.getCharacteristics()[0]
+        # Main loop --------
+        p.writeCharacteristic(ch.valHandle + 1, b'\x02\x00')
 
-    # Main loop --------
-    p.writeCharacteristic(ch.valHandle+1, b'\x02\x00')
+        while True:
+            try:
+                if p.waitForNotifications(30.0):
+                    # handleNotification() was called
+                    continue
 
-    while True:
-        try:
-            if p.waitForNotifications(1.0):
-                # handleNotification() was called
-                continue
+                print("Waiting...")
+                # Perhaps do something else here
+            except:
+                print("Disconnected... Waiting for reconnection...")
+                break
 
-            print("Waiting...")
-            # Perhaps do something else here
-        except:
-            print("Disconnected... Waiting for reconnection...")
-            break
+    except btle.BTLEDisconnectError:
+        print("Disconnect error")
+        continue
index aafdab7ebc98af9d410d3f8d552c92a5781a1cc8..b3fbae3eb9f836653bb4430d60dcf9e9c4fab69e 100644 (file)
@@ -1,2 +1,2 @@
 #!/bin/sh
-/sbin/start-stop-daemon --start --quiet --user root --chuid root --name pop-$1 --make-pidfile --pidfile /var/run/pop-$1.pid  --background --startas /bin/bash -- -c "exec /var/www/home/tools/pop/pop.py $1 >> /var/log/pop/$1.log"
\ No newline at end of file
+/sbin/start-stop-daemon --start --quiet --user root --chuid root --name pop-$1 --make-pidfile --pidfile /var/run/pop-$1.pid  --background --startas /bin/bash -- -c "exec /var/www/home/tools/pop/pop.py $1 >> /var/log/pop/$1.log 2>&1"
\ No newline at end of file