Look at the code, I noticed when starting drive we use driving_interval() unconditionally:
%V{drive_state: %Drive{shift_state: shift_state}} when shift_state in ~w(D N R) ->
Logger.info("Start of drive initiated by: #{inspect(vehicle.drive_state)}")
{drive, data} = start_drive(create_position(vehicle, data), data)
{:next_state, {:driving, :available, drive}, data,
[
broadcast_summary(),
schedule_fetch(driving_interval(), data)
]}
But when updating a driving the time varies depending on if streaming is enabled or not.
def handle_event(
:internal,
{:update, {:online, vehicle}},
{:driving, :available, drv},
%Data{} = data
) do
interval = if streaming?(data), do: default_interval(), else: driving_interval()
I might be mistaken, but this looks wrong...
Fixing this is low priority I think compared with other issues, but just wanted to document it regardless.
Look at the code, I noticed when starting drive we use
driving_interval()unconditionally:But when updating a driving the time varies depending on if streaming is enabled or not.
I might be mistaken, but this looks wrong...
Fixing this is low priority I think compared with other issues, but just wanted to document it regardless.