My bad
This commit is contained in:
@@ -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__":
|
||||||
|
|||||||
@@ -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:
|
||||||
|
|||||||
Reference in New Issue
Block a user