From ae14afdd3d45ec37634e738c6d0bf76f7cda722a Mon Sep 17 00:00:00 2001 From: Jamie Benstead Date: Wed, 16 Jul 2025 18:18:41 +0100 Subject: [PATCH 1/3] Modify function to append dummy clear value if not provided --- public/shims/sense_hat/sense_hat_blob.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/public/shims/sense_hat/sense_hat_blob.py b/public/shims/sense_hat/sense_hat_blob.py index 301c735e3..c58ca6776 100644 --- a/public/shims/sense_hat/sense_hat_blob.py +++ b/public/shims/sense_hat/sense_hat_blob.py @@ -673,7 +673,14 @@ def max_raw(self): @property def colour_raw(self): - return _ish.colourRead() + """ + Ensure a 4 length tuple is returned even if simulation only provides 3 values + """ + data = _ish.colourRead() + if len(data) == 3: + data.append(255) # Append dummy Clear value + return tuple(data) + @property def red_raw(self): @@ -1507,7 +1514,7 @@ def get_compass(self): # but the emulator cannot do fusionPose as we derive everything from the orientation. # Therefore, we a shortcut and read directly from our internal module that applies compass tilt compensation algorithm # and returns the heading in radians. - + deg = math.degrees(_ish.headingRead()) return deg + 360 if deg < 0 else deg From f8f72033011dcde947a0b22fc41bed183d772dbd Mon Sep 17 00:00:00 2001 From: Jamie Benstead Date: Wed, 16 Jul 2025 18:23:11 +0100 Subject: [PATCH 2/3] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c5a1f0b50..2f662aaca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - Enabled `hyphens: auto` globally (with exceptions) to prevent overflow with longer words (#1215) - Removed fixed size from `ProjectBar` to prevent overflow when text wraps (#1221) - Added missing translation strings (#1222) +- Changed `colour_raw` to now correctly return a 4-tuple (R, G, B, Clear) in simulation ## Changed From 8fcf6e4e9c683f31f07999faa9a232e611019af9 Mon Sep 17 00:00:00 2001 From: Jamie Benstead Date: Mon, 21 Jul 2025 17:07:54 +0100 Subject: [PATCH 3/3] Update to max value --- public/shims/sense_hat/sense_hat_blob.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/shims/sense_hat/sense_hat_blob.py b/public/shims/sense_hat/sense_hat_blob.py index c58ca6776..0ec207f71 100644 --- a/public/shims/sense_hat/sense_hat_blob.py +++ b/public/shims/sense_hat/sense_hat_blob.py @@ -678,7 +678,7 @@ def colour_raw(self): """ data = _ish.colourRead() if len(data) == 3: - data.append(255) # Append dummy Clear value + data.append(256) # Append dummy Clear value return tuple(data)