diff --git a/hb_confbridge.py b/hb_confbridge.py index fc5688f..309a02a 100755 --- a/hb_confbridge.py +++ b/hb_confbridge.py @@ -379,12 +379,12 @@ class routerSYSTEM(HBSYSTEM): self._logger.info('(%s) Bridge: %s, connection changed to state: %s', self._system, _bridge, _system['ACTIVE']) # Cancel the timer if we've enabled an "OFF" type timeout if _system['TO_TYPE'] == 'OFF': - _system['TIMER'] = now + _system['TIMER'] = pkt_time self._logger.info('(%s) Bridge: %s set to "OFF" with an on timer rule: timeout timer cancelled', self._system, _bridge) # 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) + _system['TIMER'] = pkt_time + _system['TIMEOUT'] + self._logger.info('(%s) Bridge: %s, timeout timer reset to: %s', self._system, _bridge, _system['TIMER'] - pkt_time) # TGID matches an DE-ACTIVATION trigger if (_dst_id in _system['OFF'] or _dst_id in _system['RESET']) and _slot == _system['TS']: @@ -395,15 +395,15 @@ class routerSYSTEM(HBSYSTEM): self._logger.info('(%s) Bridge: %s, connection changed to state: %s', self._system, _bridge, _system['ACTIVE']) # Cancel the timer if we've enabled an "ON" type timeout if _system['TO_TYPE'] == 'ON': - _system['TIMER'] = now + _system['TIMER'] = pkt_time self._logger.info('(%s) Bridge: %s set to ON with and "OFF" timer rule: timeout timer cancelled', self._system, _bridge) # Reset the 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) + _system['TIMER'] = pkt_time + _system['TIMEOUT'] + self._logger.info('(%s) Bridge: %s, timeout timer reset to: %s', self._system, _bridge, _system['TIMER'] - pkt_time) # Cancel the timer if we've enabled an "ON" type timeout if _system['ACTIVE'] == True and _system['TO_TYPE'] == 'ON' and _dst_group in _system['OFF']: - _system['TIMER'] = now + _system['TIMER'] = pkt_time self._logger.info('(%s) Bridge: %s set to ON with and "OFF" timer rule: timeout timer cancelled', self._system, _bridge) #