2016-11-02 16:22:43 +00:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
2016-11-02 16:15:56 +00:00
|
|
|
# Send lora packet to node-red when being triggered by postgresql
|
|
|
|
# Nico Schottelius <nico.schottelius -at- ungleich.ch>
|
|
|
|
# 2016-11-02
|
|
|
|
# GPLv3+
|
|
|
|
|
2016-11-02 15:35:10 +00:00
|
|
|
|
2016-11-12 16:44:06 +00:00
|
|
|
import lorautil
|
2016-11-12 19:01:34 +00:00
|
|
|
import logging
|
2016-11-12 15:09:33 +00:00
|
|
|
|
2016-11-12 16:44:06 +00:00
|
|
|
log = logging.getLogger("notify")
|
|
|
|
log.setLevel(logging.DEBUG)
|
2016-11-02 16:10:07 +00:00
|
|
|
|
|
|
|
if __name__ == '__main__':
|
2016-11-12 16:44:06 +00:00
|
|
|
conns = lorautil.pg_conn_notify()
|
2016-11-02 16:10:07 +00:00
|
|
|
|
|
|
|
while True:
|
2016-11-12 19:02:18 +00:00
|
|
|
lorautil.pg_wait_for_pkg(conns, lorautil.nodered_send)
|