local M = {}
M.type = "auxiliary"
M.relevantDevice = nil

-- Set the flash durations in seconds
local flashOnDuration = 0.40
local flashOffDuration = 0.40
local flashPauseDuration = 0.00

local flashTimer = 0
local flashCount = 0

local function updateGFX(dt)
  if electrics.values.taxitroublelights_toggle == 1 then
    flashTimer = flashTimer + dt

    if flashCount < 1 then
      if flashTimer < flashOnDuration then
        electrics.values.taxitroublelights = 1
      elseif flashTimer < flashOnDuration + flashOffDuration then
        electrics.values.taxitroublelights = 0
      else
        flashTimer = 0
        flashCount = flashCount + 1
      end
    elseif flashTimer < flashPauseDuration then
      electrics.values.taxitroublelights = 0
    else
      flashTimer = 0
      flashCount = 0
    end
  else
    electrics.values.taxitroublelights = 0
    flashTimer = 0  -- Reset the timer when not in trouble lights mode
    flashCount = 0  -- Reset the flash count when not in trouble lights mode
  end
end

M.updateGFX = updateGFX

return M