From 2c0c838bdb69be300b32bd6d2fbafcfe56c4cc1c Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Sun, 7 Mar 2021 17:24:46 -0700 Subject: [PATCH] Add driver for grid projectors --- server/power.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/server/power.py b/server/power.py index 8ed7a69..bddf530 100644 --- a/server/power.py +++ b/server/power.py @@ -19,6 +19,12 @@ def lights_on(): def lights_off(): np_02B_api(settings.LIGHT_IP, settings.LIGHT_USER, settings.LIGHT_PASS, False) +def grid_on(): + np_02B_api(settings.GRID_IP, settings.GRID_USER, settings.GRID_PASS, True) + +def grid_off(): + np_02B_api(settings.GRID_IP, settings.GRID_USER, settings.GRID_PASS, False) + if __name__ == '__main__': try: @@ -32,3 +38,15 @@ if __name__ == '__main__': lights_off() except BaseException as e: logging.error('Problem with lights: {} - {}'.format(e.__class__.__name__, str(e))) + + try: + print('Turning grid on...') + grid_on() + + print('Waiting three seconds...') + time.sleep(3) + + print('Turning grid off...') + grid_off() + except BaseException as e: + logging.error('Problem with grid: {} - {}'.format(e.__class__.__name__, str(e)))