diff --git a/apps/ad_toolbox b/apps/ad_toolbox index 1a148d4..54c525c 160000 --- a/apps/ad_toolbox +++ b/apps/ad_toolbox @@ -1 +1 @@ -Subproject commit 1a148d4e3fd4ac2e343c46913f5504405a6029d8 +Subproject commit 54c525c8432c18d49b1e54bfb7220dac6dd8242b diff --git a/apps/vertex2.py b/apps/vertex2.py index f83a931..2c45e0b 100644 --- a/apps/vertex2.py +++ b/apps/vertex2.py @@ -358,7 +358,7 @@ class Vertex2(SmartObject): return with self._spam_lock: if self._spam_timer is not None: - self.cancel_timer(self._spam_timer) + self.cancel_timer(self._spam_timer, silent=True) self._spam_timer = None self._spam_deadline = None self._spam_last_interrupt = None @@ -399,7 +399,7 @@ class Vertex2(SmartObject): if self.no_signal_spam_sensor.get_state() != state: self.no_signal_spam_sensor.set_state(state=state) if self._spam_timer is not None: - self.cancel_timer(self._spam_timer) + self.cancel_timer(self._spam_timer, silent=True) self._spam_deadline = at + 4 self._spam_timer = self.run_in( self._expire_no_signal_spam, max(0, self._spam_deadline - now), @@ -553,7 +553,7 @@ class Vertex2(SmartObject): with processing_lock: self._command_processing_deadline = None if self._command_processing_handle is not None: - self.cancel_timer(self._command_processing_handle) + self.cancel_timer(self._command_processing_handle, silent=True) self._command_processing_handle = None def terminate(self): @@ -735,7 +735,7 @@ class Vertex2(SmartObject): with self._command_processing_lock: self._command_processing_deadline = None if self._command_processing_handle is not None: - self.cancel_timer(self._command_processing_handle) + self.cancel_timer(self._command_processing_handle, silent=True) self._command_processing_handle = None if self.command_processing_sensor is not None: self.command_processing_sensor.set_state(state='off') @@ -767,7 +767,7 @@ class Vertex2(SmartObject): if only_if_active and self._command_processing_deadline is None: return if self._command_processing_handle is not None: - self.cancel_timer(self._command_processing_handle) + self.cancel_timer(self._command_processing_handle, silent=True) self._command_processing_deadline = time.monotonic() + self.command_processing_timeout if self.command_processing_sensor.get_state() != 'on': self.command_processing_sensor.set_state(state='on') diff --git a/tests/test_vertex2.py b/tests/test_vertex2.py index 52b26f4..eabc3ad 100644 --- a/tests/test_vertex2.py +++ b/tests/test_vertex2.py @@ -65,7 +65,7 @@ class PowerTests(unittest.TestCase): connection.shutdown.assert_called_once_with(socket.SHUT_RDWR) app.turn_off.assert_called_once_with('switch.vertex2') self.assertFalse(app._vertex2_powered()) - app.cancel_timer.assert_called_once_with('timer') + app.cancel_timer.assert_called_once_with('timer', silent=True) self.assertIsNone(app._command_processing_deadline) app.command_processing_sensor.set_state.assert_called_once_with(state='off') app.unreachable_sensor.set_state.assert_called_once_with(state='off') @@ -486,8 +486,8 @@ class SpamSensorTests(unittest.TestCase): self.assertTrue(app._interrupt_stop.is_set()) self.assertIsNone(app._spam_timer) self.assertIsNone(app._spam_deadline) - app.cancel_timer.assert_any_call('spam_timer') - app.cancel_timer.assert_any_call('timer') + app.cancel_timer.assert_any_call('spam_timer', silent=True) + app.cancel_timer.assert_any_call('timer', silent=True) app.no_signal_spam_sensor.set_state.assert_not_called() # An already queued expiry callback must also leave the state alone. app._expire_no_signal_spam({'deadline': 110})