Fix display=None error
This commit is contained in:
parent
0f12a36ff6
commit
4cd27e78b6
1 changed files with 1 additions and 1 deletions
|
|
@ -61,7 +61,6 @@ color_palette = {
|
||||||
"arrow": os.getenv("FRUIT_JAM_OS_ARROW"),
|
"arrow": os.getenv("FRUIT_JAM_OS_ARROW"),
|
||||||
}
|
}
|
||||||
|
|
||||||
display = supervisor.runtime.display
|
|
||||||
if (width_config := os.getenv("CIRCUITPY_DISPLAY_WIDTH")) is not None:
|
if (width_config := os.getenv("CIRCUITPY_DISPLAY_WIDTH")) is not None:
|
||||||
if width_config not in [x[0] for x in VALID_DISPLAY_SIZES]:
|
if width_config not in [x[0] for x in VALID_DISPLAY_SIZES]:
|
||||||
raise ValueError(f"Invalid display size. Must be one of: {VALID_DISPLAY_SIZES}")
|
raise ValueError(f"Invalid display size. Must be one of: {VALID_DISPLAY_SIZES}")
|
||||||
|
|
@ -71,6 +70,7 @@ if (width_config := os.getenv("CIRCUITPY_DISPLAY_WIDTH")) is not None:
|
||||||
else:
|
else:
|
||||||
display_size = (720, 400)
|
display_size = (720, 400)
|
||||||
request_display_config(*display_size)
|
request_display_config(*display_size)
|
||||||
|
display = supervisor.runtime.display
|
||||||
|
|
||||||
scale = 1
|
scale = 1
|
||||||
if display.width > 360:
|
if display.width > 360:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue