def __HandleNormalCard(self, uid, currentReader): if not currentReader.isNewCard(uid): Logger.debug("Skipping detected card for reader {}".format(currentReader.id)) return cards = Cards() card = cards.getCardFromUID(uid) if card is None: return Logger.debug("Reader {} detected new card: {}".format(currentReader.id, card)) dataDict = { "scope": "READER", "command": "card", "key": currentReader.id, "value": card } data = json.dumps(dataDict) data += "\r\n" if not self._connection.send(data): Logger.error("Error while sending new card to server") self.__Connect() # card could not be sent due to connection issues currentReader.clearCardFromHold(uid)