File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -327,13 +327,14 @@ def device_state_attributes(self):
327327 elif self ._kind == "spacex_next_launch_rocket" :
328328 core_counter = 1
329329 for this_core in launch_data ["cores_detail" ]:
330- self .attrs ["core_" + str (core_counter ) + "_serial" ] = this_core .get (
331- "details" ,{}).get ("serial" )
330+ if this_core .get ("details" ):
331+ self .attrs ["core_" + str (core_counter ) + "_serial" ] = this_core ["details" ].get ("serial" )
332+ self .attrs ["core_" + str (core_counter ) + "_block" ] = this_core ["details" ].get ("block" )
333+
332334 self .attrs ["core_" + str (core_counter ) + "_flight" ] = this_core .get (
333335 "flight"
334336 )
335- self .attrs ["core_" + str (core_counter ) + "_block" ] = this_core .get (
336- "details" ,{}).get ("block" )
337+
337338 self .attrs [
338339 "core_" + str (core_counter ) + "_landing_intent"
339340 ] = this_core .get ("landing_attempt" )
You can’t perform that action at this time.
0 commit comments