mirror of
https://github.com/Noettore/lagomareGateKeeperBot.git
synced 2025-10-16 20:16:39 +02:00
Che schifo
This commit is contained in:
14
services/gates.py
Normal file
14
services/gates.py
Normal file
@@ -0,0 +1,14 @@
|
||||
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
|
Reference in New Issue
Block a user