include previous train state in on_train_changed_state
Posted: Wed Nov 08, 2017 6:31 pm
I need to remove a trains from a global list when they leave a stop (or are switched to manual).
Currently I have to trigger on the states on_the_path, no_path, no_schedule or manual_control producing quite some overhead, or keep all states stored in a trainID indexed table inside the mod.
Having the former state passed along as last_state similar to on_train_created(old_train_id_1) would make working with states a bit simpler.
Even more comfortable for finding stops a train just left would be to include the stop entity as last_stop similar to on_selected_entity_changed( last_entity).
Currently I have to trigger on the states on_the_path, no_path, no_schedule or manual_control producing quite some overhead, or keep all states stored in a trainID indexed table inside the mod.
Having the former state passed along as last_state similar to on_train_created(old_train_id_1) would make working with states a bit simpler.
Even more comfortable for finding stops a train just left would be to include the stop entity as last_stop similar to on_selected_entity_changed( last_entity).