diff --git a/arduino_timetable/timetable.py b/arduino_timetable/timetable.py index 5ba7644..8465583 100644 --- a/arduino_timetable/timetable.py +++ b/arduino_timetable/timetable.py @@ -74,7 +74,7 @@ def parse_time_table(timetable, available_commands=None): # add a ScheduledCommand to the resulting list tc = ScheduledCommand(delta, raw_command, cmd) timed_commands.append(tc) - return timed_commands + return sorted(timed_commands, key=lambda tc: tc.delta) def parse_excel_file(path, available_commands=None): @@ -122,7 +122,7 @@ def parse_excel_file(path, available_commands=None): # add a ScheduledCommand to the resulting list tc = ScheduledCommand(delta, raw_command, cmd) timed_commands.append(tc) - return timed_commands + return sorted(timed_commands, key=lambda tc: tc.delta) def parse_time_cell(excel_cell):