   defp handle_gcode(:report_params_complete, _),   do: {:reply, :report_params_complete}
   defp handle_gcode(:noop, %Context{} = _ctx),     do: nil
 
+  defp handle_gcode(:idle, %Context{} = ctx) do 
+    :ok = Farmbot.BotState.set_busy(ctx, false)
+    {:status, :idle}
+  end
   defp handle_gcode({:debug_message, message}, %Context{} = _ctx) do
     debug_log "R99 #{message}"
     nil

  @spec handle_gcode(any, Context.t) :: {:status, any} | {:reply, any} | nil

  defp handle_gcode(:report_emergency_lock, _),    do: {:status, :locked}
  defp handle_gcode(:idle, %Context{} = _ctx),     do: {:status, :idle}
  defp handle_gcode(:busy, %Context{} = _ctx),     do: {:status, :busy}
  defp handle_gcode(:done, %Context{} = _ctx),     do: {:status, :done}
  defp handle_gcode(:received, %Context{} = _ctx), do: {:status, :received}


  defp handle_done(current, context) do
    debug_log "replying to #{inspect current.from} with: #{inspect current.reply}"
    :ok = Farmbot.BotState.set_busy(context, false)
    if current.callback do
      Process.cancel_timer(current.timer)
      handshake = generate_handshake()
