Fixed logic for adding UA systems to rules
This commit is contained in:
parent
de0ee31001
commit
248453ddf3
@ -111,21 +111,23 @@ def make_bridges(_rules):
|
|||||||
_system['TIMER'] = time() + _system['TIMEOUT']
|
_system['TIMER'] = time() + _system['TIMEOUT']
|
||||||
else:
|
else:
|
||||||
_system['TIMER'] = time()
|
_system['TIMER'] = time()
|
||||||
|
|
||||||
for _confsystem in CONFIG['SYSTEMS']:
|
for _confsystem in CONFIG['SYSTEMS']:
|
||||||
if _confsystem == 'OBP-BM':
|
if _confsystem == 'OBP-BM':
|
||||||
continue
|
continue
|
||||||
ts1 = False
|
ts1 = False
|
||||||
ts2 = False
|
ts2 = False
|
||||||
for i,e in enumerate(_rules[_bridge]):
|
for i,e in enumerate(_rules[_bridge]):
|
||||||
if e['SYSTEM'] == _confsystem and e['TS'] == 1:
|
if e['SYSTEM'] == _confsystem and e['TS'] == 1:
|
||||||
ts1 = True
|
ts1 = True
|
||||||
if e['SYSTEM'] == _confsystem and e['TS'] == 2:
|
if e['SYSTEM'] == _confsystem and e['TS'] == 2:
|
||||||
ts2 = True
|
ts2 = True
|
||||||
if ts1 == False:
|
|
||||||
_rules[_bridge].append({'SYSTEM': _confsystem, 'TS': 1, 'TGID': bytes_3(int(_bridge)),'ACTIVE': False,'TIMEOUT': 240,'TO_TYPE': 'ON','OFF': [],'ON': [bytes_3(int(_bridge)),],'RESET': [], 'TIMER': time()})
|
if ts1 == False:
|
||||||
if ts2 == False:
|
_rules[_bridge].append({'SYSTEM': _confsystem, 'TS': 1, 'TGID': bytes_3(int(_bridge)),'ACTIVE': False,'TIMEOUT': 240,'TO_TYPE': 'ON','OFF': [],'ON': [bytes_3(int(_bridge)),],'RESET': [], 'TIMER': time()})
|
||||||
_rules[_bridge].append({'SYSTEM': _confsystem, 'TS': 2, 'TGID': bytes_3(int(_bridge)),'ACTIVE': False,'TIMEOUT': 240,'TO_TYPE': 'ON','OFF': [],'ON': [bytes_3(int(_bridge)),],'RESET': [], 'TIMER': time()})
|
if ts2 == False:
|
||||||
break
|
_rules[_bridge].append({'SYSTEM': _confsystem, 'TS': 2, 'TGID': bytes_3(int(_bridge)),'ACTIVE': False,'TIMEOUT': 240,'TO_TYPE': 'ON','OFF': [],'ON': [bytes_3(int(_bridge)),],'RESET': [], 'TIMER': time()})
|
||||||
|
|
||||||
return _rules
|
return _rules
|
||||||
|
|
||||||
#Make a single bridge - used for on-the-fly UA bridges
|
#Make a single bridge - used for on-the-fly UA bridges
|
||||||
|
Loading…
x
Reference in New Issue
Block a user