def flow(flow, *args): B.turn_on() print('flowing', flow) try: method = getattr(flows, flow) flow = method(*args) except AttributeError as e: print(e) exit(1) B.start_flow(flow)
#!/usr/bin/env python3 from time import sleep from bulb_ip import B B.turn_on() for i in (range(0, 101)): try: B.set_brightness(i) print('good ', i) except BulbException as e: print('error', i, e) sleep(5)