Add driver for grid projectors

This commit is contained in:
Tanner Collin 2021-03-07 17:24:46 -07:00
parent c3d83be3c4
commit 2c0c838bdb

View File

@ -19,6 +19,12 @@ def lights_on():
def lights_off(): def lights_off():
np_02B_api(settings.LIGHT_IP, settings.LIGHT_USER, settings.LIGHT_PASS, False) 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__': if __name__ == '__main__':
try: try:
@ -32,3 +38,15 @@ if __name__ == '__main__':
lights_off() lights_off()
except BaseException as e: except BaseException as e:
logging.error('Problem with lights: {} - {}'.format(e.__class__.__name__, str(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)))