Compare commits

...

9 Commits

Author SHA1 Message Date
Josiah Baldwin
04c8f622de Bumped version 2025-06-14 12:53:26 -07:00
Josiah Baldwin
ccb5f1eb40 Removed catch with print statement 2025-06-14 12:50:22 -07:00
Josiah Baldwin
ce2cf2bfe1 Merge branch 'fix/device-details' into development 2025-06-14 12:47:45 -07:00
Josiah Baldwin
a3b4962e7f Update timeout for WS download, becaule it takes a little longer than http 2025-06-14 12:45:36 -07:00
Josiah Baldwin
5947e48c5b modified node parsing to accept ony number of nested strings 2025-06-14 12:42:59 -07:00
Daan Selen
31a8f00cd0 syntax fix 2025-06-12 16:58:19 +02:00
Daan Selen
871d36b334 Added support for new MeshCentral response type.
2b4ab2b122
2025-06-12 16:35:08 +02:00
Josiah Baldwin
59fb1f104e Bumped version 2025-04-01 12:17:38 -07:00
Josiah Baldwin
9bd3e10ed7 Merge pull request #45 from HuFlungDu/fix/device-open-url
Fixed weird issues in device_open_url
Fix #40
2025-04-01 12:08:43 -07:00
3 changed files with 27 additions and 3 deletions

View File

@@ -2,6 +2,23 @@
Changelog Changelog
========= =========
version 1.2.1
=============
Bugs:
* Fixed handling of meshcentral's list_devices return with details=True
version 1.2.0
=============
Bugs:
* Fixed agent sometimes being None causing an oxception
* Fixed bad code in device_open_url
Features:
* Changed websockets version to 15. This now uses the proxy implemention from that library, instead of the previous hack.
* Added lastaddr and lastconnect to list_devices API
version 1.1.2 version 1.1.2
============= =============
Bugs: Bugs:

View File

@@ -478,7 +478,14 @@ class Session(object):
if "result" in res0: if "result" in res0:
raise exceptions.ServerError(res0["result"]) raise exceptions.ServerError(res0["result"])
if details: if details:
nodes = json.loads(res0["data"]) nodes = res0["data"]
# Accept any number of nested strings, meshcentral is odd
while True:
try:
nodes = json.loads(nodes)
except TypeError:
break
for node in nodes: for node in nodes:
if node["node"].get("meshid", None): if node["node"].get("meshid", None):
node["node"]["mesh"] = mesh.Mesh(node["node"].get("meshid"), self) node["node"]["mesh"] = mesh.Mesh(node["node"].get("meshid"), self)
@@ -1969,4 +1976,4 @@ class _FileExplorerWrapper:
return await self._files.__aenter__() return await self._files.__aenter__()
async def __aexit__(self, exc_t, exc_v, exc_tb): 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)

View File

@@ -120,7 +120,7 @@ async def test_upload_download(env):
downfilestream.seek(0) downfilestream.seek(0)
start = time.perf_counter() start = time.perf_counter()
r = await files.download(f"{pwd}/test", downfilestream, skip_http_attempt=True, timeout=5) r = await files.download(f"{pwd}/test", downfilestream, skip_http_attempt=True, timeout=20)
print("\ninfo files_download: {}\n".format(r)) print("\ninfo files_download: {}\n".format(r))
assert r["result"] == True, "Download failed" assert r["result"] == True, "Download failed"
assert r["size"] == len(randdata), "Downloaded wrong number of bytes" assert r["size"] == len(randdata), "Downloaded wrong number of bytes"