Skip to content

Commit

Permalink
Rename flag part 2
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasmittag committed Oct 4, 2024
1 parent 0232a52 commit 210f71d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions kuksa-client/kuksa_client/cli_backend/grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,15 +138,15 @@ def setValues(self, updates: Dict[str, Any], attribute="value", timeout=5):
if attribute in self.AttrDict:
field, _ = self.AttrDict[attribute]
entry_updates = []
v1 = True
try_v2 = False
for path, value in updates.items():

if field is kuksa_client.grpc.Field.VALUE:
entry = kuksa_client.grpc.DataEntry(
path=path,
value=kuksa_client.grpc.Datapoint(value=value),
)
v1 = False
try_v2 = True
elif field is kuksa_client.grpc.Field.ACTUATOR_TARGET:
entry = kuksa_client.grpc.DataEntry(
path=path,
Expand All @@ -164,7 +164,7 @@ def setValues(self, updates: Dict[str, Any], attribute="value", timeout=5):
entry_updates.append(
kuksa_client.grpc.EntryUpdate(entry=entry, fields=(field,))
)
requestArgs = {"updates": entry_updates, "v1": v1}
requestArgs = {"updates": entry_updates, "try_v2": try_v2}
return self._sendReceiveMsg(("set", requestArgs), timeout)
return json.dumps({"error": "Invalid Attribute"})

Expand Down Expand Up @@ -197,7 +197,7 @@ def subscribeMultiple(self, paths: Iterable[str], callback, attribute="value", t
]
requestArgs = {
"entries": entries,
"v1": False,
"try_v2": True,
"callback": callback_wrapper(callback),
}
return self._sendReceiveMsg(("subscribe", requestArgs), timeout)
Expand Down

0 comments on commit 210f71d

Please sign in to comment.