mirror of
https://github.com/puzzle/lightning-beer-tap.git
synced 2025-12-18 23:54:24 +01:00
Implement flush function
This commit is contained in:
@@ -19,6 +19,7 @@ r_ch3 = 21
|
|||||||
# time constants in seconds
|
# time constants in seconds
|
||||||
t_large_beer = 5
|
t_large_beer = 5
|
||||||
t_small_beer = 2
|
t_small_beer = 2
|
||||||
|
t_flush = 20
|
||||||
|
|
||||||
# Syntax suger because of negative logic
|
# Syntax suger because of negative logic
|
||||||
S_ON = GPIO.LOW
|
S_ON = GPIO.LOW
|
||||||
@@ -48,6 +49,13 @@ def cli_args_parser():
|
|||||||
help="Test mode which tests all available channels"
|
help="Test mode which tests all available channels"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
parser.add_argument(
|
||||||
|
'-f',
|
||||||
|
'--flush',
|
||||||
|
action='store_true',
|
||||||
|
help="Flush tap for 20s!"
|
||||||
|
)
|
||||||
|
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'-m',
|
'-m',
|
||||||
'--memo',
|
'--memo',
|
||||||
@@ -117,6 +125,9 @@ if __name__ == "__main__":
|
|||||||
if args.test:
|
if args.test:
|
||||||
print("Test mode enabled")
|
print("Test mode enabled")
|
||||||
gpio_test()
|
gpio_test()
|
||||||
|
elif args.flush:
|
||||||
|
print("Choice: Flush tap")
|
||||||
|
draw_beer(t_flush)
|
||||||
elif args.products == "LARGE_BEER":
|
elif args.products == "LARGE_BEER":
|
||||||
print("Choice: Large beer")
|
print("Choice: Large beer")
|
||||||
draw_beer(t_large_beer)
|
draw_beer(t_large_beer)
|
||||||
|
|||||||
Reference in New Issue
Block a user