Skip to content

Commit

Permalink
Improve handling of updateVSSTree for Databroker
Browse files Browse the repository at this point in the history
  • Loading branch information
erikbosch authored and lukasmittag committed Feb 20, 2024
1 parent 599d428 commit 3b8bc86
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 5 additions & 3 deletions kuksa-client/kuksa_client/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ def subscriptionIdCompleter(self, text, line, begidx, endidx):
return basic_complete(text, line, begidx, endidx, self.pathCompletionItems)

COMM_SETUP_COMMANDS = "Communication Set-up Commands"
VSS_COMMANDS = "Kuksa Interaction Commands"
VSS_COMMANDS = "Kuksa Interaction Commands (Supported by both KUKSA Databroker and KUKSA Server)"
VSS_COMMANDS_SERVER = "Kuksa Interaction Commands (Only supported by KUKSA Server)"
INFO_COMMANDS = "Info Commands"

ap_connect = argparse.ArgumentParser()
Expand Down Expand Up @@ -526,13 +527,14 @@ def getMetaData(self, path):
return self.commThread.getMetaData(path)
return "{}"

@with_category(VSS_COMMANDS)
@with_category(VSS_COMMANDS_SERVER)
@with_argparser(ap_updateVSSTree)
def do_updateVSSTree(self, args):
"""Update VSS Tree Entry"""
if self.checkConnection():
resp = self.commThread.updateVSSTree(args.Json)
print(highlight(resp, lexers.JsonLexer(), formatters.TerminalFormatter()))
if resp is not None:
print(highlight(resp, lexers.JsonLexer(), formatters.TerminalFormatter()))

@with_category(VSS_COMMANDS)
@with_argparser(ap_updateMetaData)
Expand Down
4 changes: 4 additions & 0 deletions kuksa-client/kuksa_client/cli_backend/grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,10 @@ async def _grpcHandler(self, vss_client: kuksa_client.grpc.aio.VSSClient):

self.grpcConnected = False

# Update VSS Tree Entry
def updateVSSTree(self, jsonStr, timeout=5):
print("Command not supported by KUKSA Databroker or KUKSA gRPC!")

# Main loop for handling gRPC communication
async def mainLoop(self):
if self.insecure:
Expand Down

0 comments on commit 3b8bc86

Please sign in to comment.