Clean up output
We're printing "No tag read" many, many, MANY times each second to the log. Let's cut back a bit to make debugging easier. We should also print when we're clearing the cache in case we need to find that in the logs later. Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
This commit is contained in:
parent
b9eadf9112
commit
27d8399529
5
doors.py
5
doors.py
|
@ -120,6 +120,7 @@ def clear_cache():
|
||||||
|
|
||||||
today = datetime.date.today()
|
today = datetime.date.today()
|
||||||
if today.month != THIS_MONTH:
|
if today.month != THIS_MONTH:
|
||||||
|
print("Clearing key cache")
|
||||||
CACHED_KEYS.clear()
|
CACHED_KEYS.clear()
|
||||||
THIS_MONTH = today.month
|
THIS_MONTH = today.month
|
||||||
|
|
||||||
|
@ -158,9 +159,7 @@ RFID_SERIAL = serial.Serial(RFID_PATH, 2400, timeout=1)
|
||||||
|
|
||||||
def _do_read_rfid():
|
def _do_read_rfid():
|
||||||
string = RFID_SERIAL.read(12)
|
string = RFID_SERIAL.read(12)
|
||||||
if len(string) == 0:
|
if len(string) > 0:
|
||||||
print("No tag read")
|
|
||||||
else:
|
|
||||||
key = string[1:11].decode() #exclude start x0A and stop x0D bytes
|
key = string[1:11].decode() #exclude start x0A and stop x0D bytes
|
||||||
print("Read key: %s" % key)
|
print("Read key: %s" % key)
|
||||||
verify_key(key)
|
verify_key(key)
|
||||||
|
|
Loading…
Reference in New Issue