From 5bbee94765d08fd158b20718261588a332dba77c Mon Sep 17 00:00:00 2001 From: Joan Date: Wed, 21 Jan 2026 18:34:25 +0100 Subject: [PATCH] Fix TypeError when HDD temperature data contains None values --- matrix.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/matrix.py b/matrix.py index b63e5d0..42252ba 100644 --- a/matrix.py +++ b/matrix.py @@ -371,7 +371,7 @@ class Matrix64Display(SampleBase): graphics.DrawLine(canvas, 28, 0, 28, 25, line_color) if self.hdd_temps and len(self.hdd_temps) > 1: - temps = [str(int(t[0])) for t in self.hdd_temps[1:] if t] + temps = [str(int(t[0])) for t in self.hdd_temps[1:] if t and t[0] is not None] if len(temps) >= 2: graphics.DrawText(canvas, data_font, 34, 8, hdd_color, " ".join(temps[:2])) if len(temps) >= 4: @@ -411,7 +411,7 @@ class Matrix64Display(SampleBase): graphics.DrawLine(canvas, 0, 10, 63, 10, line_color) if self.hdd_temps and len(self.hdd_temps) > 1: - temps = [(i+1, int(t[0])) for i, t in enumerate(self.hdd_temps[1:7]) if t] + temps = [(i+1, int(t[0])) for i, t in enumerate(self.hdd_temps[1:7]) if t and t[0] is not None] y = 22 for idx, (num, temp_val) in enumerate(temps[:3]):