diff --git a/scripts/btn_relay_labo.py b/scripts/btn_relay_labo.py index b526e6542b38bf42f0affc370e5ccc815cc15fe8..b21917a326b6f05a4bd354d57ca544ebe24ba79a 100644 --- a/scripts/btn_relay_labo.py +++ b/scripts/btn_relay_labo.py @@ -30,6 +30,9 @@ SDB = UUID(['fb1f8648-20ba-11e9-b352-a4badbf92500','fb1f8648-20ba-11e9-b352-a4 SCEN = UUID(['00796898-20bb-11e9-b352-a4badbf92500','00796898-20bb-11e9-b352-a4badbf92501','00796898-20bb-11e9-b352-a4badbf92502']) +BTN_LUM = UUID(['ee220704-e54d-11eb-9dbb-a4badbf92500','ee249546-e54d-11eb-9dbb-a4badbf92500','ee25b43a-e54d-11eb-9dbb-a4badbf92500','ee25238a-e54d-11eb-9dbb-a4badbf92500','ee22bfaa-e54d-11eb-9dbb-a4badbf92500' ]) +BTN_SHUT = UUID(['ee23caee-e54d-11eb-9dbb-a4badbf92500','ee23caee-e54d-11eb-9dbb-a4badbf92501','ee23caee-e54d-11eb-9dbb-a4badbf92502' ]) + # Edisio bureau #BTNS = ['c4b33536-c314-11e8-a5d6-000673742b01','c4b33536-c314-11e8-a5d6-000673742b03','c4b33536-c314-11e8-a5d6-000673742b05', # 'c4b33536-c314-11e8-a5d6-000673742b07','c4b33536-c314-11e8-a5d6-000673742b08'] @@ -47,6 +50,7 @@ mon = None def send(targets,action,body=None): global mon engine = mon.dev.engine + print(f"{targets} {action}") engine.send_request(dev,targets,action,body) def search_for_light(lamps): @@ -122,7 +126,37 @@ def handle_msg(msg): send([SHUTERS[0]],'stop') send([SHUTERS[1]],'stop') send(SIRENS,'stop') - + + + + # ========= Commande éclairage séparé ===== + if msg.source == BTN_LUM[0]: + on_off_light([LAMPS[0]]) + + if msg.source == BTN_LUM[1]: + on_off_light([LAMPS[1]]) + + if msg.source == BTN_LUM[2]: + on_off_light([LAMPS[2]]) + + if msg.source == BTN_LUM[3]: + on_off_light([LAMPS[4]]) + + if msg.source == BTN_LUM[4]: + on_off_light([LAMPS[5]]) + + + + # ======== Commandes des volets ========= + if msg.source == BTN_SHUT[0]: + send(SHUTERS,'up') + + if msg.source == BTN_SHUT[1]: + send(SHUTERS,'down') + + if msg.source == BTN_SHUT[2]: + send(SHUTERS,'stop') + if msg.action == 'double_click': if msg.source in AQUARA: send([SHUTERS[0],],'stop')