| Conditions | 1 |
| Total Lines | 23 |
| Code Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | import signal |
||
| 13 | def run(controller): |
||
| 14 | global driver |
||
| 15 | if driver is not None: return |
||
| 16 | |||
| 17 | driver = AccessoryDriver() |
||
| 18 | |||
| 19 | bridge = Bridge(driver, 'PyDMXControl') |
||
| 20 | bridge.set_info_service(manufacturer="PyDMXControl", |
||
| 21 | model="Central Controller", |
||
| 22 | serial_number="Chans: 1->{} (All)".format(controller.next_channel - 1)) |
||
| 23 | |||
| 24 | for fixture in controller.get_all_fixtures(): |
||
| 25 | bridge.add_accessory(RGBLight(fixture, driver)) |
||
| 26 | |||
| 27 | bridge.add_accessory(MasterLight(controller, driver)) |
||
| 28 | |||
| 29 | signal.signal(signal.SIGTERM, driver.signal_handler) |
||
| 30 | driver.add_accessory(accessory=bridge) |
||
| 31 | |||
| 32 | thread = Thread(target=driver.start) |
||
| 33 | thread.daemon = True |
||
| 34 | thread.start() |
||
| 35 | |||
| 36 | |||
| 41 |