<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>
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)
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