Convert to dictionary for API response
(self, is_default: bool = False)
| 91 | return len(self.command_queue) >= QUEUE_MAX_SIZE |
| 92 | |
| 93 | def to_dict(self, is_default: bool = False) -> dict: |
| 94 | """Convert to dictionary for API response""" |
| 95 | d = { |
| 96 | "ref_id": self.ref_id, |
| 97 | "instance_id": self.instance_id, |
| 98 | "project_name": self.project_name, |
| 99 | "unity_version": self.unity_version, |
| 100 | "bridge_version": self.bridge_version, |
| 101 | "status": self.status.value, |
| 102 | "is_default": is_default, |
| 103 | "capabilities": self.capabilities, |
| 104 | "queue_size": self.queue_size, |
| 105 | } |
| 106 | if self.status_detail is not None: |
| 107 | d["status_detail"] = self.status_detail |
| 108 | return d |
| 109 | |
| 110 | def update_heartbeat(self) -> None: |
| 111 | """Update last heartbeat timestamp""" |
no outgoing calls