diff --git a/scripts/btn_relay_labo.py b/scripts/btn_relay_labo.py index 99a51279b393796d0770ca6552a057530e61f23c..9d9abbe3f2674ab917824694cb291d1878a6e0bc 100644 --- a/scripts/btn_relay_labo.py +++ b/scripts/btn_relay_labo.py @@ -17,6 +17,8 @@ LAMPS= UUID(['ccc44227-d4fc-46eb-8578-159e2c47da03','ccc44227-d4fc-46eb-8578-15 'ccc44227-d4fc-46eb-8578-159e2c47da06','ccc44227-d4fc-46eb-8578-159e2c47da07','ccc44227-d4fc-46eb-8578-159e2c47da08']) SPOTS = UUID(['6265eb30-8c59-11e9-98b1-b827ebe99201',]) +AMBI = UUID(['e19d5ea8-c838-11ea-82a8-9cebe88e1963']) + # Edisio labo BTNS = UUID(['743034ca-c2f0-11e8-9485-a40074bcb601','743034ca-c2f0-11e8-9485-a40074bcb603','743034ca-c2f0-11e8-9485-a40074bcb605', @@ -77,8 +79,16 @@ def handle_msg(msg): # btn du milieu / on éteint tout if msg.source == BTNS[2]: - on_off_light(LAMPS) - #send(SHUTERS,'stop') + ALL = LAMPS + SPOTS + AMBI + r = search_for_light(ALL) + if r: + send(ALL,'turn_off') + else: + send(LAMPS,'turn_on') + + # Eclairage d'ambiance + if msg.source == BTNS[3]: + on_off_light(SPOTS+AMBI) if msg.source in AQUARA: if on_off_light(LAMPS): @@ -97,14 +107,14 @@ def handle_msg(msg): # "soirée TV" send([SHUTERS[0]],'down') send(LAMPS,'turn_off') - send(SPOTS,'turn_on') + send(SPOTS+AMBI,'turn_on') send([SHUTERS[1]],'down') if msg.source == SCEN[1]: # "Début journée" send([SHUTERS[0]],'up') send([LAMPS[3],],'turn_on') - send(SPOTS,'turn_off') + send(SPOTS+AMBI,'turn_off') send([SHUTERS[1]],'up') if msg.source == SCEN[2]: