diff --git a/custom_components/nationalrailuk/client.py b/custom_components/nationalrailuk/client.py index 56207bb..d862c52 100644 --- a/custom_components/nationalrailuk/client.py +++ b/custom_components/nationalrailuk/client.py @@ -328,9 +328,6 @@ def process_data(self, json_message_in): ############################################################ # Assign outputs ############################################################ - if otherEnd: - train["otherEnd"] = otherEnd - train["scheduled"] = times["sheduled"] train["expected"] = times["estimated"] train["origin"] = service["origin"]["location"][0]["locationName"] @@ -343,7 +340,9 @@ def process_data(self, json_message_in): train["length"] = service["length"] train["callingPoints"] = callingPoints - status["trains"].append(train) + if otherEnd: + train["otherEnd"] = otherEnd + status["trains"].append(train) # with open("output_test.txt", "w") as convert_file: # convert_file.write(str(status["trains"]))