Format uid data
This commit is contained in:
@@ -25,7 +25,7 @@ class SerialReader:
|
||||
if self._run_event.is_set():
|
||||
self._run_event.clear()
|
||||
|
||||
def subscribe(self, listener : Callable) -> None:
|
||||
def subscribe(self, listener : Callable[[str], None]) -> None:
|
||||
self.__listeners.append(listener)
|
||||
|
||||
def _notify(self, data : str):
|
||||
@@ -38,7 +38,8 @@ class SerialReader:
|
||||
if line:
|
||||
print("Generic method")
|
||||
data = line.decode('utf-8', errors='ignore')
|
||||
self._notify(data)
|
||||
formatted_data = f'{{"uid": {data}}}'
|
||||
self._notify(formatted_data)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user