From 97ea445cb08f60338e1d12d43c5e812665a4fd74 Mon Sep 17 00:00:00 2001 From: Marcel van der Veldt Date: Thu, 12 Jan 2023 12:00:40 +0100 Subject: [PATCH] expose diagnostics in the client (#167) --- matter_server/client/client.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/matter_server/client/client.py b/matter_server/client/client.py index f9285317..73c7a50a 100644 --- a/matter_server/client/client.py +++ b/matter_server/client/client.py @@ -29,7 +29,7 @@ SuccessResultMessage, ) from ..common.models.node import MatterAttribute, MatterNode -from ..common.models.server_information import ServerInfo +from ..common.models.server_information import ServerDiagnostics, ServerInfo from .const import MIN_SCHEMA_VERSION from .exceptions import ( CannotConnect, @@ -253,6 +253,11 @@ async def send_command_no_wait( ) await self._send_message(message) + async def get_diagnostics(self) -> ServerDiagnostics: + """Return a full dump of the server (for diagnostics).""" + data = await self.send_command(APICommand.SERVER_DIAGNOSTICS) + return dataclass_from_dict(ServerDiagnostics, data) + async def connect(self) -> None: """Connect to the websocket server.""" if self._ws_client is not None: