Compare commits
2 commits
991c053977
...
0db20ca4db
Author | SHA1 | Date | |
---|---|---|---|
0db20ca4db | |||
c03d2e8fae |
3 changed files with 47 additions and 4 deletions
12
.env
12
.env
|
@ -1,5 +1,11 @@
|
|||
# Serial device
|
||||
SERIAL_DEV="/dev/cu.usbserial-A700e0gN"
|
||||
#SERIAL_DEV="/dev/ttyUSB0"
|
||||
SERIAL_SPEED = 9600
|
||||
#SERIAL_SPEED = 19200
|
||||
#SERIAL_SPEED = 115200
|
||||
|
||||
# Serial baud rate
|
||||
SERIAL_SPEED=9600
|
||||
#SERIAL_SPEED=19200
|
||||
#SERIAL_SPEED=115200
|
||||
|
||||
# FIFO filename
|
||||
FIFO="/tmp/mapid"
|
||||
|
|
|
@ -7,7 +7,8 @@ import mapid
|
|||
from serial.serialutil import SerialException
|
||||
|
||||
|
||||
FIFO = "/tmp/mapid"
|
||||
mapid.load_dotenv()
|
||||
FIFO = return os.environ.get("FIFO")
|
||||
|
||||
|
||||
def main():
|
||||
|
|
36
notification.sh
Executable file
36
notification.sh
Executable file
|
@ -0,0 +1,36 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
source "$(dirname $0)/.env"
|
||||
|
||||
|
||||
#FIFO=/tmp/mapid
|
||||
LINE1='Backup finished!'
|
||||
LINE2=''
|
||||
LED_BLINK=".5s"
|
||||
DISPLAY_DURATION="4s"
|
||||
|
||||
|
||||
if [[ ! -e $FIFO ]]; then
|
||||
echo "Error: $FIFO does not exist." >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
|
||||
echo >$FIFO "CLS"
|
||||
|
||||
if [[ -n $LINE1 ]]; then
|
||||
echo >$FIFO "LINE 1"
|
||||
echo >$FIFO "ECHO $LINE1"
|
||||
fi
|
||||
|
||||
if [[ -n $LINE2 ]]; then
|
||||
echo >$FIFO "LINE 2"
|
||||
echo >$FIFO "ECHO $LINE2"
|
||||
fi
|
||||
|
||||
echo >$FIFO "LCDON"
|
||||
echo >$FIFO "ON"
|
||||
gsleep $LED_BLINK
|
||||
echo >$FIFO "OFF"
|
||||
gsleep $DISPLAY_DURATION
|
||||
echo >$FIFO "LCDOFF"
|
Loading…
Reference in a new issue