Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve handling of updateVSSTree for Databroker #18

Merged
merged 2 commits into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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