Skip to content

use of driving_interval inconsistant #5323

@brianmay

Description

@brianmay

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions