From 23bd5dae4f36da8e39059048638b3ebe1fb39251 Mon Sep 17 00:00:00 2001 From: aristocratos Date: Sat, 31 Oct 2020 11:42:14 +0100 Subject: [PATCH] Fixed: Wrong coretemp mapping when missing package id 0 --- bpytop.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bpytop.py b/bpytop.py index 73feb78..c12eed4 100755 --- a/bpytop.py +++ b/bpytop.py @@ -2750,7 +2750,7 @@ class CpuCollector(Collector): cpu_type = "intel" if entry.label.startswith("Package") else "ryzen" temp = round(entry.current) elif (entry.label.startswith(("Core", "Tccd", "CPU")) or (name.lower().startswith("cpu") and not entry.label)) and hasattr(entry, "current") and round(entry.current) > 0: - if (cpu_type == "intel" and entry.label.startswith("Core")) or (cpu_type == "ryzen" and entry.label.startswith("Tccd")): + if entry.label.startswith(("Core", "Tccd")): entry_int = int(entry.label.replace("Core", "").replace("Tccd", "")) if entry_int in core_dict: continue @@ -2769,6 +2769,8 @@ class CpuCollector(Collector): temp = round(entry.current) cores.append(round(entry.current)) if core_dict: + if not temp: + temp = core_dict.get(0, 0) cls.cpu_temp[0].append(temp) if cpu_type == "ryzen": ccds: int = len(core_dict)