Skip to content

Commit 7712810

Browse files
feat: if temp and battery is not there logging it 0
1 parent 7b97d57 commit 7712810

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/utils.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,11 @@ def get_cpu_temp():
198198
return (current_temp, high_temp, critical_temp)
199199
else:
200200
# If no 'coretemp' sensors found, return 'N/A'
201-
return ("N/A", "N/A", "N/A")
201+
return (0, 0, 0)
202202

203203
except Exception as e:
204204
logger.warning(f"Error getting CPU temperature: {e}")
205-
return ("N/A", "N/A", "N/A")
205+
return (0, 0, 0)
206206

207207

208208
def get_top_processes(number=5):
@@ -394,7 +394,7 @@ def _get_system_info():
394394
'memory_percent': round(memory_info.percent, 2),
395395
'disk_percent': round(disk_info.percent, 2),
396396
'network_sent': network_sent,
397-
'battery_percent': round(battery_info.percent, 1) if battery_info else "N/A",
397+
'battery_percent': round(battery_info.percent, 1) if battery_info else 0,
398398
'network_received': network_received,
399399
"network_stats" : f"D: {network_received} MB / U: {network_sent} MB",
400400
'dashboard_memory_usage': get_flask_memory_usage(),

0 commit comments

Comments
 (0)