Skip to content

Commit

Permalink
fixup! #4041 Create an enum for valid device rotations
Browse files Browse the repository at this point in the history
  • Loading branch information
bieleluk committed Aug 27, 2024
1 parent e81e46e commit 5d07343
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions core/src/storage/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,16 +103,14 @@ def get_rotation() -> DisplayRotation:
return DisplayRotation.North # Default to North if no rotation is set

value = int.from_bytes(rotation, "big")
if value == 0:
rotation = DisplayRotation.North
elif value == 90:
if value == 90:
rotation = DisplayRotation.East
elif value == 180:
rotation = DisplayRotation.South
elif value == 270:
rotation = DisplayRotation.West
else:
raise ValueError(f"Unsupported display rotation: {rotation}")
rotation = DisplayRotation.North

return rotation

Expand Down

0 comments on commit 5d07343

Please sign in to comment.