My bad
This commit is contained in:
@@ -38,8 +38,7 @@ class SerialReader:
|
||||
if line:
|
||||
print("Generic method")
|
||||
data = line.decode('utf-8', errors='ignore')
|
||||
formatted_data = f'{{"uid": {data}}}'
|
||||
self._notify(formatted_data)
|
||||
self._notify(data)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
@@ -19,7 +19,8 @@ class RfidReader(SerialReader):
|
||||
hex_value = data[5:11].decode(errors='ignore')
|
||||
try:
|
||||
res = int(hex_value, 16)
|
||||
self._notify(str(res))
|
||||
formatted_res = f'{{"uid": {data}}}'
|
||||
self._notify(formatted_res)
|
||||
except ValueError:
|
||||
print("Invalid hex:", hex_value)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user