aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMalik Talha <talhamalik727x@gmail.com>2023-11-15 03:11:08 +0500
committerMalik Talha <talhamalik727x@gmail.com>2023-11-15 03:11:08 +0500
commit960330a92dcfe36f30a99d95a9e35eb860c1e6a1 (patch)
tree0af0f17d316e733ef8145947bdfda86bf24e49a4
parent9629533242da050b0d30173d6becea20191c0b2b (diff)
minor fix to datatypes while scaling existing kuksa values
Properly cast the datatypes while performing increase/decrease operations on an existing kuksa vss value. Bug-AGL: SPEC-4906 Signed-off-by: Malik Talha <talhamalik727x@gmail.com> Change-Id: I90f98a94d6d91102df46365179b5ffca89c233be
-rw-r--r--agl_service_voiceagent/servicers/voice_agent_servicer.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/agl_service_voiceagent/servicers/voice_agent_servicer.py b/agl_service_voiceagent/servicers/voice_agent_servicer.py
index 0027c96..0565655 100644
--- a/agl_service_voiceagent/servicers/voice_agent_servicer.py
+++ b/agl_service_voiceagent/servicers/voice_agent_servicer.py
@@ -369,7 +369,9 @@ class VoiceAgentServicer(voice_agent_pb2_grpc.VoiceAgentServiceServicer):
exec_status = voice_agent_pb2.EXEC_SUCCESS
elif "factor" in execution_item:
- factor = execution_item["factor"]
+ # incoming values are always str as kuksa expects str during subscribe we need to convert
+ # the value to int before performing any arithmetic operations and then convert back to str
+ factor = int(execution_item["factor"])
current_value = self.kuksa_client.get_value(signal)
if current_value:
current_value = int(current_value)