This commit is contained in:
2025-12-30 15:34:31 +01:00
parent 38781cde9c
commit 21bebea92d
2 changed files with 3 additions and 3 deletions

View File

@@ -38,8 +38,7 @@ class SerialReader:
if line: if line:
print("Generic method") print("Generic method")
data = line.decode('utf-8', errors='ignore') data = line.decode('utf-8', errors='ignore')
formatted_data = f'{{"uid": {data}}}' self._notify(data)
self._notify(formatted_data)
if __name__ == "__main__": if __name__ == "__main__":

View File

@@ -19,7 +19,8 @@ class RfidReader(SerialReader):
hex_value = data[5:11].decode(errors='ignore') hex_value = data[5:11].decode(errors='ignore')
try: try:
res = int(hex_value, 16) res = int(hex_value, 16)
self._notify(str(res)) formatted_res = f'{{"uid": {data}}}'
self._notify(formatted_res)
except ValueError: except ValueError:
print("Invalid hex:", hex_value) print("Invalid hex:", hex_value)
else: else: