Display an equlizer looking animation with random values.
(dev)
| 56 | |
| 57 | |
| 58 | def random_eq(dev): |
| 59 | """Display an equlizer looking animation with random values.""" |
| 60 | while True: |
| 61 | if is_thread_stopped() or is_dev_disconnected(dev.device): |
| 62 | reset_thread() |
| 63 | return |
| 64 | # Lower values more likely, makes it look nicer |
| 65 | weights = [i * i for i in range(33, 0, -1)] |
| 66 | population = list(range(1, 34)) |
| 67 | vals = random.choices(population, weights=weights, k=9) |
| 68 | eq(dev, vals) |
| 69 | time.sleep(0.2) |
| 70 | |
| 71 | |
| 72 | def clock(dev): |
no test coverage detected