ui: show temperature status instead of numeric value

This commit is contained in:
1okko
2026-10-07 12:29:15 +08:00
parent 8d0bf5ee0a
commit 7de66e4b48
+2 -6
View File
@@ -140,16 +140,12 @@ class Sidebar(Widget, SidebarSP):
return self._ip
def _update_temperature_status(self, device_state):
# Show the max CPU temperature value instead of just GOOD/HIGH.
cpu_temps = device_state.cpuTempC
max_temp = max(cpu_temps) if cpu_temps else 0.0
temp_str = "{:.0f}°C".format(max_temp)
thermal_status = device_state.thermalStatus
if thermal_status == ThermalStatus.ok:
self._temp_status.update(tr_noop("TEMP"), temp_str, Colors.GOOD)
self._temp_status.update(tr_noop("TEMP"), tr_noop("GOOD"), Colors.GOOD)
else:
self._temp_status.update(tr_noop("TEMP"), temp_str, Colors.DANGER)
self._temp_status.update(tr_noop("TEMP"), tr_noop("HIGH"), Colors.DANGER)
def _update_connection_status(self, device_state):
last_ping = device_state.lastAthenaPingTime