From 23a73e15a3797f2e25d818e27f089341a0f642d5 Mon Sep 17 00:00:00 2001 From: jkerdreu <jkerdreu@b32b6428-25c9-4566-ad07-03861ab6144f> Date: Mon, 26 Sep 2022 09:06:58 +0000 Subject: [PATCH] - SYNC old stuff git-svn-id: https://redmine.imt-atlantique.fr/svn/xaal/code/Python/branches/0.7@2994 b32b6428-25c9-4566-ad07-03861ab6144f --- scripts/btn_relay_labo.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/scripts/btn_relay_labo.py b/scripts/btn_relay_labo.py index b21917a3..b15150b5 100644 --- a/scripts/btn_relay_labo.py +++ b/scripts/btn_relay_labo.py @@ -33,6 +33,10 @@ SCEN = UUID(['00796898-20bb-11e9-b352-a4badbf92500','00796898-20bb-11e9-b352-a4 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' ]) + +BTN_SCREEN = UUID(['ee22bfaa-e54d-11eb-9dbb-a4badbf92501',]) +SCREEN_POWER = UUID(['2d42a742-aa2f-11e9-ac3b-a4badbf92501',]) + # 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'] @@ -109,6 +113,7 @@ def handle_msg(msg): if msg.source == SCEN[0]: # "soirée TV" + send(SCREEN_POWER,'turn_on') send([SHUTERS[0]],'down') send(LAMPS,'turn_off') send(SPOTS+AMBI,'turn_on') @@ -157,6 +162,18 @@ def handle_msg(msg): if msg.source == BTN_SHUT[2]: send(SHUTERS,'stop') + # ======= TV + if msg.source in BTN_SCREEN: + tv = mon.devices.get_with_addr(SCREEN_POWER[0]) + if tv: + state = tv.attributes.get('power',None) + if state == True: + send(SCREEN_POWER,'turn_off') + elif state == False: + send(SCREEN_POWER,'turn_on') + else: + print('Unkown state for main screen') + if msg.action == 'double_click': if msg.source in AQUARA: send([SHUTERS[0],],'stop') -- GitLab