forked from platypush/platypush
Merge branch 'master' into docs
This commit is contained in:
commit
8a0ca64e4d
2 changed files with 23 additions and 0 deletions
23
platypush/backend/sensor/ir/zeroborg/scan.py
Normal file
23
platypush/backend/sensor/ir/zeroborg/scan.py
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
import time
|
||||||
|
|
||||||
|
import platypush.plugins.gpio.zeroborg.lib as ZeroBorg
|
||||||
|
|
||||||
|
no_msg_timeout = 0.37
|
||||||
|
last_msg = None
|
||||||
|
last_msg_timestamp = None
|
||||||
|
auto_mode = False
|
||||||
|
|
||||||
|
ZB = ZeroBorg.ZeroBorg()
|
||||||
|
ZB.Init()
|
||||||
|
|
||||||
|
while True:
|
||||||
|
ZB.GetIrMessage()
|
||||||
|
if ZB.HasNewIrMessage():
|
||||||
|
message = ZB.GetIrMessage()
|
||||||
|
print('Received message: {}'.format(message))
|
||||||
|
|
||||||
|
last_msg = message
|
||||||
|
last_msg_timestamp = time.time()
|
||||||
|
|
||||||
|
# vim:sw=4:ts=4:et:
|
||||||
|
|
Loading…
Reference in a new issue