diff --git a/CHANGELOG.md b/CHANGELOG.md index 7693f5829..3a4467268 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 diff --git a/public/shims/sense_hat/sense_hat_blob.py b/public/shims/sense_hat/sense_hat_blob.py index 301c735e3..0ec207f71 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(256) # 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