From caec4022450f091bfa0bca687f8008a80a0dd08a Mon Sep 17 00:00:00 2001 From: jkerdreu <jkerdreu@b32b6428-25c9-4566-ad07-03861ab6144f> Date: Tue, 8 Feb 2022 14:43:48 +0000 Subject: [PATCH] Added stuff git-svn-id: https://redmine.imt-atlantique.fr/svn/xaal/code/Python/branches/0.7@2840 b32b6428-25c9-4566-ad07-03861ab6144f --- scripts/btn_relay_labo.py | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/scripts/btn_relay_labo.py b/scripts/btn_relay_labo.py index b526e654..b21917a3 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') -- GitLab