Files
lagomareGateKeeperBot/services/gates.py
2025-08-21 23:28:34 +02:00

14 lines
497 B
Python

from models import Credential, Status
class GatesService:
def open_gate(self, gate: str, credentials: Credential) -> bool:
if gate not in self._gates:
return False
if self._gates[gate].status == Status.DISABLED:
return False
try:
api = AVConnectAPI(credentials)
return api.exec_gate_macro(self._gates[gate].id)
except Exception as e:
print(f"Failed to open gate {gate}: {e}")
return False