This commit is contained in:
2026-08-07 23:41:13 +02:00
parent 0bcc83871d
commit c5934d05c6
2 changed files with 48 additions and 3 deletions
+4 -2
View File
@@ -29,7 +29,7 @@ class DoorController:
if not mock_factory:
import paho.mqtt.client as mqtt
self._mqtt = mqtt.Client(mqtt.CallbackAPIVersion.VERSION2)
self._mqtt.connect(mqtt_host, mqtt_port)
self._mqtt.connect(mqtt_host, mqtt_port) #TODO: add login with username+pw, tls
self._mqtt.loop_start()
logger.info("Mqtt client connect to %s:%s", mqtt_host, mqtt_port)
@@ -102,11 +102,13 @@ def checkAccess(key: str, db: Session):
current_time = datetime.now()
card = db.exec(select(Card).where(Card.key == key)).one()
if not card.enabled:
logger.info("Card Inactive!")
return False
for auth in card.group.accessauths:
logger.info(f"checking auth: {auth.name}")
if not auth.is_active:
return False
logger.info("AA inactive!")
continue
if auth.type == "timetable":
for timetable in auth.timetables:
logger.info(f" checking timetable {timetable.id}")