from lightbar.lightbar_controller import LightbarController
from lightbar.lightbar_server import LightbarServer

try:
    import lightbar_cfg
except Exception as e:
    print('[main] Could not import lightbar_cfg.py: {}'.format(str(e)))
    raise e

print('[main] Starting lightbar controller')
lightbar_controller = LightbarController(neopixel_count=lightbar_cfg.NEOPIXEL_COUNT)
lightbar_controller.start()

print('[main] Starting lightbar HTTP server')
api_server = LightbarServer()
api_server.run(port=lightbar_cfg.SERVER_PORT, debug=lightbar_cfg.SERVER_DEBUG)

print('[main] HTTP server shut down! End of main')
