aboutsummaryrefslogtreecommitdiffstats
path: root/extras/Kuksa_Instance.py
diff options
context:
space:
mode:
authorsuchinton2001 <suchinton.2001@gmail.com>2023-10-30 18:58:40 +0530
committersuchinton2001 <suchinton.2001@gmail.com>2023-11-02 03:44:53 +0530
commitf9aef30f5e78f0f4e179948946d043c4725712d5 (patch)
treed9edbcda6ac219155e9ef5642001395d694f1e9a /extras/Kuksa_Instance.py
parentedfd96499fdbcf869c5182f2cfa89703cfb0dfd0 (diff)
agl-demo-control-panel: Improve gRPC Mode
V1: - Remove redundant calls to set instance - Start client as soon as connection is established V2: - Enable Subscriptions in gRPC mode - Fix UI stutter by blocking signals for specific widgets - Fix Vehicle Simulator, no longer run thread as a daemon SPEC-4905 Signed-off-by: suchinton2001 <suchinton.2001@gmail.com> Change-Id: Iea3b9ce0532c1ebae530aed9dddd92d72ff4dd7b
Diffstat (limited to 'extras/Kuksa_Instance.py')
-rw-r--r--extras/Kuksa_Instance.py18
1 files changed, 14 insertions, 4 deletions
diff --git a/extras/Kuksa_Instance.py b/extras/Kuksa_Instance.py
index cda539e..6add5af 100644
--- a/extras/Kuksa_Instance.py
+++ b/extras/Kuksa_Instance.py
@@ -17,7 +17,6 @@
from typing import Optional
import kuksa_client as kuksa
import threading
-import time
class KuksaClientSingleton:
@@ -73,6 +72,7 @@ class KuksaClientSingleton:
raise Exception("This class is a singleton!")
self.client = None
+ self.kuksa_config = None
KuksaClientSingleton._instance = self
@@ -89,9 +89,10 @@ class KuksaClientSingleton:
"""
if self.client:
self.client.stop()
-
- self.client = kuksa.KuksaClientThread(config)
- self.client.authorize(token)
+ self.kuksa_config = config
+ self.token = token
+ self.client = kuksa.KuksaClientThread(self.kuksa_config)
+ self.client.authorize(self.token)
self.client.start()
def get_client(self):
@@ -114,6 +115,15 @@ class KuksaClientSingleton:
dict: The configuration for KuksaClientThread.
"""
return self.kuksa_config
+
+ def get_token(self):
+ """
+ Returns the path to the token file.
+
+ Returns:
+ str: The path to the token file.
+ """
+ return self.token
def status(self):
"""