From 1a719a7bcd38f58fcc1bd2a99630c6a92c00abb7 Mon Sep 17 00:00:00 2001 From: Simon Date: Mon, 5 Oct 2020 23:32:36 +0100 Subject: [PATCH] preparation to static tgs to mysql thread --- bridge_master.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/bridge_master.py b/bridge_master.py index daaa55b..8613ed3 100755 --- a/bridge_master.py +++ b/bridge_master.py @@ -205,6 +205,19 @@ def make_static_tg(tg,ts,system): bridgetemp.append(bridgesystem) BRIDGES[str(tg)] = bridgetemp + +def reset_static_tg(tg,ts,system): + _tmout = CONFIG['SYSTEMS'][system]['DEFAULT_UA_TIMER'] + if tg not in BRIDGES: + make_single_bridge(bytes_3(tg),system,ts) + bridgetemp = [] + for bridgesystem in BRIDGES[str(tg)]: + if bridgesystem['SYSTEM'] == system and bridgesystem['TS'] == ts: + bridgetemp.append({'SYSTEM': system, 'TS': ts, 'TGID': bytes_3(tg),'ACTIVE': False,'TIMEOUT': _tmout * 60,'TO_TYPE': 'ON','OFF': [],'ON': [bytes_3(tg),],'RESET': [], 'TIMER': time() + (_tmout * 60)}) + else: + bridgetemp.append(bridgesystem) + + BRIDGES[str(tg)] = bridgetemp def reset_default_reflector(reflector,system): bridge = '#'+str(reflector)