Added support for new MeshCentral response type.

2b4ab2b122
This commit is contained in:
Daan Selen
2025-06-12 16:35:08 +02:00
parent 59fb1f104e
commit 871d36b334

View File

@@ -479,6 +479,16 @@ class Session(object):
raise exceptions.ServerError(res0["result"])
if details:
nodes = json.loads(res0["data"])
try:
raw_data = res0["data"]
if isinstance(raw_data, str):
nodes = json.loads(raw_data)
else:
nodes = raw_data
except Exception as e:
print(f"Failed to parse device data: {e}")
return
for node in nodes:
if node["node"].get("meshid", None):
node["node"]["mesh"] = mesh.Mesh(node["node"].get("meshid"), self)
@@ -1969,4 +1979,4 @@ class _FileExplorerWrapper:
return await self._files.__aenter__()
async def __aexit__(self, exc_t, exc_v, exc_tb):
return await self._files.__aexit__(exc_t, exc_v, exc_tb)
return await self._files.__aexit__(exc_t, exc_v, exc_tb)