mirror of
https://github.com/Noettore/lagomareGateKeeperBot.git
synced 2025-10-15 03:26:40 +02:00
14 lines
497 B
Python
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 |