   @dl_path '/root/upgrade.fw'
   @double_flash_error "A software update is already in progress. Please wait."
 
+  # =========ENTRY POINT=========
+  # RPC command triggered when
+  # user hits the "UPDATE" button
+  # =============================
   def check_update() do
     get_target()
     |> download_meta_data()

    :ok
  end

  def has_artifacts?(path \\ to_string(@dl_path)) do
    File.exists?(path)
  end

  def prevent_double_installation!() do
    if has_artifacts?() do
      FarmbotCore.Logger.error(3, @double_flash_error)
      raise @double_flash_error
    end
  end

  def get_target() do
    # Read value set by
    try do

        "none"
    end
  end
end
