Add config option for UA timer to hblink.cfg

This commit is contained in:
Simon G7RZU 2020-08-26 15:24:06 +01:00
parent 248453ddf3
commit 6fb3a86361
2 changed files with 6 additions and 4 deletions

View File

@ -122,11 +122,11 @@ def make_bridges(_rules):
ts1 = True
if e['SYSTEM'] == _confsystem and e['TS'] == 2:
ts2 = True
_tmout = CONFIG['SYSTEMS'][_confsystem]['DEFAULT_UA_TIMER']
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()})
_rules[_bridge].append({'SYSTEM': _confsystem, 'TS': 1, 'TGID': bytes_3(int(_bridge)),'ACTIVE': False,'TIMEOUT': _tmout * 60,'TO_TYPE': 'ON','OFF': [],'ON': [bytes_3(int(_bridge)),],'RESET': [], 'TIMER': time()})
if ts2 == False:
_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()})
_rules[_bridge].append({'SYSTEM': _confsystem, 'TS': 2, 'TGID': bytes_3(int(_bridge)),'ACTIVE': False,'TIMEOUT': _tmout * 60,'TO_TYPE': 'ON','OFF': [],'ON': [bytes_3(int(_bridge)),],'RESET': [], 'TIMER': time()})
return _rules

View File

@ -259,7 +259,9 @@ def build_config(_config_file):
'REG_ACL': config.get(section, 'REG_ACL'),
'SUB_ACL': config.get(section, 'SUB_ACL'),
'TG1_ACL': config.get(section, 'TGID_TS1_ACL'),
'TG2_ACL': config.get(section, 'TGID_TS2_ACL')
'TG2_ACL': config.get(section, 'TGID_TS2_ACL'),
'DEFAULT_UA_TIMER': config.getint(section, 'DEFAULT_UA_TIMER'),
'SINGLE_MODE': config.getboolean(section, 'SINGLE_MODE')
}})
CONFIG['SYSTEMS'][section].update({'PEERS': {}})