mirror of
https://github.com/puzzle/lightning-beer-tap.git
synced 2025-12-18 23:54:24 +01:00
Fix startupscript
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -2,6 +2,7 @@
|
|||||||
/websocket_bridge/build/
|
/websocket_bridge/build/
|
||||||
!gradle/wrapper/gradle-wrapper.jar
|
!gradle/wrapper/gradle-wrapper.jar
|
||||||
nohup.out
|
nohup.out
|
||||||
|
websocket-bridge-0.0.1-SNAPSHOT.jar
|
||||||
|
|
||||||
### STS ###
|
### STS ###
|
||||||
.apt_generated
|
.apt_generated
|
||||||
|
|||||||
@@ -35,9 +35,9 @@ def cli_args_parser():
|
|||||||
|
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'-p',
|
'-p',
|
||||||
'--product',
|
'--products',
|
||||||
action='store',
|
action='store',
|
||||||
dest='product',
|
dest='products',
|
||||||
help="Product description, beer size [small, large]"
|
help="Product description, beer size [small, large]"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -107,6 +107,8 @@ if __name__ == "__main__":
|
|||||||
"""
|
"""
|
||||||
# parse arguments
|
# parse arguments
|
||||||
args = cli_args_parser()
|
args = cli_args_parser()
|
||||||
|
|
||||||
|
print(args.products)
|
||||||
|
|
||||||
# Setup all gpio pins
|
# Setup all gpio pins
|
||||||
__setup_GPIO()
|
__setup_GPIO()
|
||||||
@@ -115,10 +117,10 @@ if __name__ == "__main__":
|
|||||||
if args.test:
|
if args.test:
|
||||||
print("Test mode enabled")
|
print("Test mode enabled")
|
||||||
gpio_test()
|
gpio_test()
|
||||||
elif args.product == "large":
|
elif args.products == "LARGE_BEER":
|
||||||
print("Choice: Large beer")
|
print("Choice: Large beer")
|
||||||
draw_beer(t_large_beer)
|
draw_beer(t_large_beer)
|
||||||
elif args.product == "small":
|
elif args.products == "SMALL_BEER":
|
||||||
print("Choice: Small beer")
|
print("Choice: Small beer")
|
||||||
draw_beer(t_small_beer)
|
draw_beer(t_small_beer)
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -3,14 +3,18 @@
|
|||||||
# Java call parameters
|
# Java call parameters
|
||||||
WEBAPP="wss://ln-self-order-pos-dev.ose3.puzzle.ch/websocket/invoice?access_token="
|
WEBAPP="wss://ln-self-order-pos-dev.ose3.puzzle.ch/websocket/invoice?access_token="
|
||||||
OPTS="-Xms128M -Xmx128M -jar"
|
OPTS="-Xms128M -Xmx128M -jar"
|
||||||
JARPATH="websocket_bridge/build/libs/"
|
|
||||||
JARFILE="websocket-bridge-0.0.1-SNAPSHOT.jar"
|
JARFILE="websocket-bridge-0.0.1-SNAPSHOT.jar"
|
||||||
|
JARPATH="websocket_bridge/build/libs/"
|
||||||
TOPIC="/topic/invoice"
|
TOPIC="/topic/invoice"
|
||||||
COMMAND="./beerme.py"
|
COMMAND="./gpio_handler/beerme.py"
|
||||||
|
|
||||||
# Enable dashboard
|
# Enable dashboard
|
||||||
source dashboard/dashboard.sh
|
source dashboard/dashboard.sh
|
||||||
|
|
||||||
# Enable websocket bridge
|
if [ ! -f $JARFILE ]; then
|
||||||
java $OPTS $JARPATH$JARFILE --url=$WEBAPP --topic=$TOPIC --command=$COMMAND
|
cp "$JARPATH$JARFILE" .
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Enable websocket bridge
|
||||||
|
nohup java $OPTS $JARFILE --url=$WEBAPP --topic=$TOPIC --command=$COMMAND &
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user