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