From 97441a50de2941bd27d1acf16ba682c666208721 Mon Sep 17 00:00:00 2001 From: Albert Valiev Date: Mon, 16 May 2022 12:01:29 +0100 Subject: [PATCH] Fix for get_agent_by_id returning wrong class object --- aos/devices.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aos/devices.py b/aos/devices.py index 08577c6..8245558 100644 --- a/aos/devices.py +++ b/aos/devices.py @@ -211,8 +211,8 @@ def iter_all(self) -> Generator[SystemAgent, None, None]: for s in system_agents.get("items", []): yield SystemAgent.from_json(s) - def get_agent_by_id(self, system_id: str) -> Optional[System]: - return System.from_json( + def get_agent_by_id(self, system_id: str) -> Optional[SystemAgent]: + return SystemAgent.from_json( self.rest.json_resp_get(f"/api/system-agents/{system_id}") )