What changed, and why it matters
This is a tiny code cleanup commit in a single display driver file. It adds the Python dataclass decorator to a class and renames one method parameter from 'state' to 'enabled' to match the rest of the code. There is no visible security relevance.
No security action needed. Treat as routine maintenance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit modifies src/seedsigner/hardware/displays/ili9341.py. It imports dataclass, decorates ILI9341 with @dataclass, and renames the invert() parameter from ‘state’ to ‘enabled’ along with its internal uses. No functional behavior changes are apparent; this is a refactoring/bugfix-level cleanup.
Changed components
src/seedsigner/hardware/displays/ili9341.pyInspect captured patch +6 / −3
diff --git a/src/seedsigner/hardware/displays/ili9341.py b/src/seedsigner/hardware/displays/ili9341.py
index 93492e6..23d1bb5 100644
--- a/src/seedsigner/hardware/displays/ili9341.py
+++ b/src/seedsigner/hardware/displays/ili9341.py
@@ -29,6 +29,8 @@ import time
# import numpy as np
import array
+from dataclasses import dataclass
+
from PIL import Image
from PIL import ImageDraw
@@ -131,6 +133,7 @@ def image_to_data(image):
return arr.tobytes()
+@dataclass
class ILI9341(BaseDisplayDriver):
"""Representation of an ILI9341 TFT LCD."""
@@ -300,15 +303,15 @@ class ILI9341(BaseDisplayDriver):
self.reset()
self._init()
- def invert(self, state: bool = True):
+ def invert(self, enabled: bool = True):
"""Sets display inversion to the specified state. If not provided, state
is True, which inverts the display. If state is False, the display turns
back into normal mode."""
- if state:
+ if enabled:
self.command(ILI9341_INVON)
else:
self.command(ILI9341_INVOFF)
- self.inverted = state
+ self.inverted = enabled
return self
def set_window(self, x0=0, y0=0, x1=None, y1=None):
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.