()
| 68 | |
| 69 | |
| 70 | def main_cli(): |
| 71 | parser = argparse.ArgumentParser() |
| 72 | parser.add_argument( |
| 73 | "-l", "--list", help="List all compatible devices", action="store_true" |
| 74 | ) |
| 75 | parser.add_argument( |
| 76 | "--bootloader", |
| 77 | help="Jump to the bootloader to flash new firmware", |
| 78 | action="store_true", |
| 79 | ) |
| 80 | parser.add_argument( |
| 81 | "--sleep", |
| 82 | help="Simulate the host going to sleep or waking up", |
| 83 | action=argparse.BooleanOptionalAction, |
| 84 | ) |
| 85 | parser.add_argument( |
| 86 | "--is-sleeping", help="Check current sleep state", action="store_true" |
| 87 | ) |
| 88 | parser.add_argument( |
| 89 | "--brightness", help="Adjust the brightness. Value 0-255", type=int |
| 90 | ) |
| 91 | parser.add_argument( |
| 92 | "--get-brightness", help="Get current brightness", action="store_true" |
| 93 | ) |
| 94 | parser.add_argument( |
| 95 | "--animate", |
| 96 | action=argparse.BooleanOptionalAction, |
| 97 | help="Start/stop vertical scrolling", |
| 98 | ) |
| 99 | parser.add_argument( |
| 100 | "--get-animate", action="store_true", help="Check if currently animating" |
| 101 | ) |
| 102 | parser.add_argument( |
| 103 | "--pwm", |
| 104 | help="Adjust the PWM frequency. Value 0-255", |
| 105 | type=int, |
| 106 | choices=[29000, 3600, 1800, 900], |
| 107 | ) |
| 108 | parser.add_argument( |
| 109 | "--get-pwm", help="Get current PWM Frequency", action="store_true" |
| 110 | ) |
| 111 | parser.add_argument( |
| 112 | "--pattern", help="Display a pattern", type=str, choices=PATTERNS |
| 113 | ) |
| 114 | parser.add_argument( |
| 115 | "--image", |
| 116 | help="Display a PNG or GIF image in black and white only)", |
| 117 | type=argparse.FileType("rb"), |
| 118 | ) |
| 119 | parser.add_argument( |
| 120 | "--image-grey", |
| 121 | help="Display a PNG or GIF image in greyscale", |
| 122 | type=argparse.FileType("rb"), |
| 123 | ) |
| 124 | parser.add_argument( |
| 125 | "--camera", help="Stream from the webcam", action="store_true") |
| 126 | parser.add_argument("--video", help="Play a video", type=str) |
| 127 | parser.add_argument( |
no test coverage detected