Skip to content

Commit

Permalink
some mroe fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sadnub committed Feb 21, 2022
1 parent 3fbb2ef commit 1331c5b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name='meshctrl',
version='0.1.7',
version='0.1.8',
description='Python port of MeshCentral\'s Meshctrl.js program',
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down
11 changes: 4 additions & 7 deletions src/meshctrl/meshctrl.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ async def _websocket_call(self, data: dict) -> dict:

async with websockets.connect(uri) as websocket:

responseId = uuid.uuid4()
data["responseId"] = responseId
response_id = str(uuid.uuid4())
data["responseid"] = response_id

await websocket.send(
json.dumps(data)
Expand All @@ -29,14 +29,11 @@ async def _websocket_call(self, data: dict) -> dict:
async for message in websocket:
response = json.loads(message)

if response["responseId"] == responseId:
if response["responseId"] == response_id:
return response

def _send(self, data):
loop = asyncio.get_event_loop()
result = loop.run_until_complete(self._websocket_call(json.dumps(data)))
loop.close()
return result
return asyncio.run(self._websocket_call(data))

# pulls a list of groups in MeshCentral
def get_mesh_groups(self) -> dict:
Expand Down

0 comments on commit 1331c5b

Please sign in to comment.