use layers

This commit is contained in:
j 2017-10-16 21:31:13 +02:00
parent 02b06c6581
commit 6f2b4fba8a

View file

@ -46,13 +46,15 @@ LIGHTS = {
def switch(state): def switch(state):
lights, fade = LIGHTS[state] lights, fade = LIGHTS[state]
lb = lanbox.LanboxMethods() lb = lanbox.Lanbox()
#lb.getChannels(lights) #lb.getChannels(lights)
lb.fadeTo(lights, fade) #lb.fadeTo(lights, fade)
lb.layerGo(state + 1)
if __name__ == '__main__': if __name__ == '__main__':
path = sys.argv[1] path = sys.argv[1]
no_sleep = len(sys.argv) > 2
n = int(os.path.getctime(path) - 1495280000) n = int(os.path.getctime(path) - 1495280000)
info = ox.avinfo(path) info = ox.avinfo(path)
@ -66,6 +68,7 @@ if __name__ == '__main__':
light = seq() light = seq()
if pos + sleep > duration: if pos + sleep > duration:
break break
time.sleep(sleep) if not no_sleep:
time.sleep(sleep)
switch(light) switch(light)
pos += sleep pos += sleep