File tree Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change 62
62
}
63
63
64
64
display = supervisor .runtime .display
65
- if display is None :
66
- width_config = os .getenv ("CIRCUITPY_DISPLAY_WIDTH" )
67
- if width_config is None :
68
- request_display_config (720 , 400 )
69
- elif width_config in [x [0 ] for x in VALID_DISPLAY_SIZES ]:
70
- for display_size in VALID_DISPLAY_SIZES :
71
- if display_size [0 ] == width_config :
72
- request_display_config (* display_size )
73
- break
74
- else :
65
+ if (width_config := os .getenv ("CIRCUITPY_DISPLAY_WIDTH" )) is not None :
66
+ if width_config not in [x [0 ] for x in VALID_DISPLAY_SIZES ]:
75
67
raise ValueError (f"Invalid display size. Must be one of: { VALID_DISPLAY_SIZES } " )
68
+ for display_size in VALID_DISPLAY_SIZES :
69
+ if display_size [0 ] == width_config :
70
+ break
71
+ else :
72
+ display_size = (720 , 400 )
73
+ request_display_config (* display_size )
76
74
77
75
scale = 1
78
76
if display .width > 360 :
You can’t perform that action at this time.
0 commit comments