31
31
# SLEEP_TIME = 60 * 60 * 24 # seconds
32
32
33
33
# URL to fetch the data from
34
- JSON_GET_URL = "https://jwst.nasa.gov/content/webbLaunch/flightCurrentState2.0.json?unique={}"
34
+ JSON_GET_URL = (
35
+ "https://jwst.nasa.gov/content/webbLaunch/flightCurrentState2.0.json?unique={}"
36
+ )
35
37
36
38
# Whether to fetch live data or use cached
37
39
TEST_RUN = True
@@ -99,11 +101,17 @@ def make_name_text(text, anchor_point, anchored_position, bg_color=LBL_BACKGROUN
99
101
padding_right = 4 ,
100
102
padding_bottom = 3 ,
101
103
padding_top = 3 ,
102
- line_spacing = 1.0
104
+ line_spacing = 1.0 ,
103
105
)
104
106
105
107
106
- def make_value_text (anchor_point , anchored_position , custom_font = True , bg_color = 0x000000 , font_color = 0xFFFFF ):
108
+ def make_value_text (
109
+ anchor_point ,
110
+ anchored_position ,
111
+ custom_font = True ,
112
+ bg_color = 0x000000 ,
113
+ font_color = 0xFFFFF ,
114
+ ):
107
115
"""
108
116
Create label object for showing data values.
109
117
@@ -117,9 +125,17 @@ def make_value_text(anchor_point, anchored_position, custom_font=True, bg_color=
117
125
else :
118
126
_font = terminalio .FONT
119
127
return bitmap_label .Label (
120
- _font , text = "" , anchor_point = anchor_point , anchored_position = anchored_position ,
121
- line_spacing = 1.0 , padding_top = 3 , background_color = bg_color , color = font_color ,
122
- padding_right = 4 , padding_left = 4 , padding_bottom = 4
128
+ _font ,
129
+ text = "" ,
130
+ anchor_point = anchor_point ,
131
+ anchored_position = anchored_position ,
132
+ line_spacing = 1.0 ,
133
+ padding_top = 3 ,
134
+ background_color = bg_color ,
135
+ color = font_color ,
136
+ padding_right = 4 ,
137
+ padding_left = 4 ,
138
+ padding_bottom = 4 ,
123
139
)
124
140
125
141
@@ -132,11 +148,17 @@ def make_value_text(anchor_point, anchored_position, custom_font=True, bg_color=
132
148
# value text initializations
133
149
134
150
# top left. Hot side | Cold side temperature values
135
- top_left_value = make_value_text (anchor_point = (0 , 0 ), anchored_position = (0 , 6 ), bg_color = 0xBBBBBB , font_color = 0x000000 )
151
+ top_left_value = make_value_text (
152
+ anchor_point = (0 , 0 ),
153
+ anchored_position = (0 , 6 ),
154
+ bg_color = 0xBBBBBB ,
155
+ font_color = 0x000000 ,
156
+ )
136
157
137
158
# top right. Instrument temperature values
138
159
top_right_value = make_value_text (
139
- anchor_point = (1.0 , 0 ), anchored_position = (display .width - 6 , 6 ),
160
+ anchor_point = (1.0 , 0 ),
161
+ anchored_position = (display .width - 6 , 6 ),
140
162
)
141
163
142
164
# bottom left timestamp
@@ -159,7 +181,9 @@ def make_value_text(anchor_point, anchored_position, custom_font=True, bg_color=
159
181
# center. Instrument temp labels
160
182
inst_temp_labels = "NIRCam Bench\n NIRSpec Bench\n FGS Bench\n MIRI Bench\n FSM"
161
183
top_center_name = make_name_text (
162
- text = inst_temp_labels , anchor_point = (1.0 , 0.0 ), anchored_position = (top_right_value .x - 2 , 6 )
184
+ text = inst_temp_labels ,
185
+ anchor_point = (1.0 , 0.0 ),
186
+ anchored_position = (top_right_value .x - 2 , 6 ),
163
187
)
164
188
165
189
main_group .append (middle_left_name )
0 commit comments