Squashed some timer bugs
This commit is contained in:
parent
f45d9cd829
commit
dd3eb5d96e
|
@ -328,23 +328,27 @@ class confbridgeIPSC(IPSC):
|
|||
for _system in BRIDGES[_bridge]:
|
||||
if _system['SYSTEM'] == self._system:
|
||||
|
||||
# TGID matches a rule source, reset its timer
|
||||
if _ts == _system['TS'] and _dst_group == _system['TGID'] and ((_system['TO_TYPE'] == 'ON' and (_system['ACTIVE'] == True)) or (_system['TO_TYPE'] == 'OFF' and _system['ACTIVE'] == False)):
|
||||
_system['TIMER'] = now + _system['TIMEOUT']
|
||||
self._logger.info('(%s) Transmission match for Bridge: %s. Reset timeout to %s', self._system, _bridge, _system['TIMER'])
|
||||
|
||||
# TGID matches an ACTIVATION trigger
|
||||
if _dst_group in _system['ON']:
|
||||
# Set the matching rule as ACTIVE
|
||||
_system['ACTIVE'] = True
|
||||
_system['TIMER'] = now + _system['TIMEOUT']
|
||||
self._logger.info('(%s) Bridge: %s, connection changed to state: %s', self._system, _bridge, _system['ACTIVE'])
|
||||
if _system['ACTIVE'] == False:
|
||||
_system['ACTIVE'] = True
|
||||
self._logger.info('(%s) Bridge: %s, connection changed to state: %s', self._system, _bridge, _system['ACTIVE'])
|
||||
# Reset the timer for the rule
|
||||
if _system['ACTIVE'] == True and _system['TO_TYPE'] == 'ON':
|
||||
_system['TIMER'] = now + _system['TIMEOUT']
|
||||
self._logger.info('(%s) Bridge: %s, timeout timer reset to: %s', self._system, _bridge, _system['TIMER'] - now)
|
||||
|
||||
# TGID matches an DE-ACTIVATION trigger
|
||||
if _dst_group in _system['OFF']:
|
||||
# Set the matching rule as ACTIVE
|
||||
_system['ACTIVE'] = False
|
||||
self._logger.info('(%s) Bridge: %s, connection changed to state: %s', self._system, _bridge, _system['ACTIVE'])
|
||||
if _system['ACTIVE'] == True:
|
||||
_system['ACTIVE'] = False
|
||||
self._logger.info('(%s) Bridge: %s, connection changed to state: %s', self._system, _bridge, _system['ACTIVE'])
|
||||
# Reset tge timer for the rule
|
||||
if _system['ACTIVE'] == False and _system['TO_TYPE'] == 'OFF':
|
||||
_system['TIMER'] = now + _system['TIMEOUT']
|
||||
self._logger.info('(%s) Bridge: %s, timeout timer reset to: %s', self._system, _bridge, _system['TIMER'] - now)
|
||||
|
||||
#
|
||||
# END IN-BAND SIGNALLING
|
||||
|
|
Loading…
Reference in New Issue