summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxengineering <mail2xengineering@protonmail.com>2020-10-19 17:22:08 +0200
committerxengineering <mail2xengineering@protonmail.com>2020-10-19 17:22:08 +0200
commitdd41aae7363672316851ebbd35961ae2bc89ff4c (patch)
treed49971933ec11cc7b0e07898a35888a26d1f012d
parentcb0c3892122b054c58b9bc5836608ba6ba0e5ca9 (diff)
downloadiot-barcode-scanner-dd41aae7363672316851ebbd35961ae2bc89ff4c.tar
iot-barcode-scanner-dd41aae7363672316851ebbd35961ae2bc89ff4c.tar.zst
iot-barcode-scanner-dd41aae7363672316851ebbd35961ae2bc89ff4c.zip
Bugfix for Raspberry Pi
-rwxr-xr-xbarcode_scanner_daemon.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/barcode_scanner_daemon.py b/barcode_scanner_daemon.py
index 38f0514..09139f7 100755
--- a/barcode_scanner_daemon.py
+++ b/barcode_scanner_daemon.py
@@ -28,8 +28,9 @@ def main():
if event.type == evdev.ecodes.EV_KEY:
eventdata = evdev.categorize(event)
if eventdata.keystate:
- with open(fifo_path, "a") as fifo:
- fifo.append(eventdata.keycode)
+ with open(fifo_path, "w") as fifo:
+ fifo.write(eventdata.keycode)
+ fifo.flush()
except KeyboardInterrupt:
pass