Update plugin.py
Browse files
plugin.py
CHANGED
@@ -202,49 +202,66 @@ class CanRunGAssistPlugin:
|
|
202 |
}
|
203 |
|
204 |
def detect_hardware(self, params: Dict[str, str]) -> Dict[str, Any]:
|
205 |
-
"""Provide
|
206 |
-
logging.info("Starting
|
207 |
|
208 |
-
|
209 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
210 |
|
211 |
🖥️ GRAPHICS CARD:
|
212 |
-
• GPU:
|
213 |
-
• VRAM:
|
214 |
-
• RTX Features: ✅ Supported
|
215 |
-
• DLSS Support: ✅ Available
|
216 |
-
• Driver Status: ✅ Compatible
|
217 |
|
218 |
🧠 PROCESSOR:
|
219 |
-
• CPU:
|
220 |
-
• Cores:
|
221 |
-
• Performance: ✅
|
222 |
|
223 |
💾 MEMORY:
|
224 |
-
• RAM:
|
225 |
-
• Speed:
|
226 |
-
• Gaming Performance: ✅ Excellent
|
227 |
|
228 |
🖥️ DISPLAY:
|
229 |
-
• Resolution:
|
230 |
-
• Refresh Rate:
|
231 |
-
• G-Sync/FreeSync: ✅ Supported
|
232 |
|
233 |
💾 STORAGE:
|
234 |
-
• Type:
|
235 |
-
• Performance: ✅ Fast Loading
|
236 |
|
237 |
🖥️ SYSTEM:
|
238 |
-
• OS:
|
239 |
-
• DirectX:
|
240 |
-
• G-Assist: ✅
|
241 |
|
242 |
-
Hardware detection completed successfully
|
243 |
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
248 |
|
249 |
def format_canrun_response(self, result) -> str:
|
250 |
"""Format CanRun result for G-Assist display with complete information."""
|
|
|
202 |
}
|
203 |
|
204 |
def detect_hardware(self, params: Dict[str, str]) -> Dict[str, Any]:
|
205 |
+
"""Provide comprehensive hardware detection with real system information."""
|
206 |
+
logging.info("Starting hardware detection with actual system data")
|
207 |
|
208 |
+
try:
|
209 |
+
# Get actual hardware specs from the CanRun engine
|
210 |
+
# Create event loop for async operation
|
211 |
+
loop = asyncio.new_event_loop()
|
212 |
+
asyncio.set_event_loop(loop)
|
213 |
+
|
214 |
+
# Get actual hardware specs using the engine's hardware detector
|
215 |
+
hardware_specs = loop.run_until_complete(self.canrun_engine.hardware_detector.get_hardware_specs())
|
216 |
+
loop.close()
|
217 |
+
|
218 |
+
# Format the hardware information in a readable way
|
219 |
+
hardware_message = f"""💻 SYSTEM HARDWARE DETECTION:
|
220 |
|
221 |
🖥️ GRAPHICS CARD:
|
222 |
+
• GPU: {hardware_specs.gpu_model}
|
223 |
+
• VRAM: {hardware_specs.gpu_vram_gb}GB
|
224 |
+
• RTX Features: {'✅ Supported' if hardware_specs.supports_rtx else '❌ Not Available'}
|
225 |
+
• DLSS Support: {'✅ Available' if hardware_specs.supports_dlss else '❌ Not Available'}
|
226 |
+
• Driver Status: {'✅ Compatible' if hardware_specs.nvidia_driver_version != 'Unknown' else '⚠️ Unknown Version'}
|
227 |
|
228 |
🧠 PROCESSOR:
|
229 |
+
• CPU: {hardware_specs.cpu_model}
|
230 |
+
• Cores: {hardware_specs.cpu_cores} Physical / {hardware_specs.cpu_threads} Logical
|
231 |
+
• Performance: {'✅ High-Performance' if hardware_specs.cpu_cores >= 6 else '⚠️ Mid-Range'}
|
232 |
|
233 |
💾 MEMORY:
|
234 |
+
• RAM: {hardware_specs.ram_total_gb}GB Total
|
235 |
+
• Speed: {hardware_specs.ram_speed_mhz}MHz
|
236 |
+
• Gaming Performance: {'✅ Excellent' if hardware_specs.ram_total_gb >= 16 else '⚠️ Adequate' if hardware_specs.ram_total_gb >= 8 else '❌ Below Recommended'}
|
237 |
|
238 |
🖥️ DISPLAY:
|
239 |
+
• Resolution: {hardware_specs.primary_monitor_resolution}
|
240 |
+
• Refresh Rate: {hardware_specs.primary_monitor_refresh_hz}Hz
|
241 |
+
• G-Sync/FreeSync: {'✅ Likely Supported' if hardware_specs.supports_rtx else '⚠️ Check Monitor Settings'}
|
242 |
|
243 |
💾 STORAGE:
|
244 |
+
• Type: {hardware_specs.storage_type}
|
245 |
+
• Performance: {'✅ Fast Loading' if 'SSD' in hardware_specs.storage_type else '⚠️ Standard'}
|
246 |
|
247 |
🖥️ SYSTEM:
|
248 |
+
• OS: {hardware_specs.os_version}
|
249 |
+
• DirectX: {hardware_specs.directx_version}
|
250 |
+
• G-Assist: ✅ Compatible (Plugin Working)
|
251 |
|
252 |
+
Hardware detection completed successfully using CanRun's privacy-aware detection system."""
|
253 |
|
254 |
+
return {
|
255 |
+
"success": True,
|
256 |
+
"message": hardware_message
|
257 |
+
}
|
258 |
+
except Exception as e:
|
259 |
+
logging.error(f"Error in hardware detection: {e}")
|
260 |
+
# Fall back to generic message if detection fails
|
261 |
+
return {
|
262 |
+
"success": False,
|
263 |
+
"message": f"Hardware detection failed: {str(e)}\n\nPlease check system compatibility and try again."
|
264 |
+
}
|
265 |
|
266 |
def format_canrun_response(self, result) -> str:
|
267 |
"""Format CanRun result for G-Assist display with complete information."""
|