diff --git a/asyncua/client/client.py b/asyncua/client/client.py index 113a1b296..d20f3fb86 100644 --- a/asyncua/client/client.py +++ b/asyncua/client/client.py @@ -520,11 +520,11 @@ async def _monitor_server_loop(self): _ = await self.nodes.server_state.read_value() except ConnectionError as e: _logger.info("connection error in watchdog loop %s", e, exc_info=True) - await self.uaclient.inform_subscriptions(ua.StatusCodes.BadShutdown) + await self.uaclient.inform_subscriptions(ua.StatusCode(ua.StatusCodes.BadShutdown)) raise except Exception: _logger.exception("Error in watchdog loop") - await self.uaclient.inform_subscriptions(ua.StatusCodes.BadShutdown) + await self.uaclient.inform_subscriptions(ua.StatusCode(ua.StatusCodes.BadShutdown)) raise async def _renew_channel_loop(self): diff --git a/tests/test_connections.py b/tests/test_connections.py index 8b2785301..df6aff299 100644 --- a/tests/test_connections.py +++ b/tests/test_connections.py @@ -70,7 +70,7 @@ def status_change_notification(self, status: ua.StatusChangeNotification): # check if connection is alive await cl.check_connection() # check if the status_change_notification was triggered - assert myhandler.status == ua.StatusCodes.BadShutdown + assert myhandler.status.value == ua.StatusCodes.BadShutdown # check if exception is correct rethrown on second call with pytest.raises(ConnectionError): await cl.check_connection()