Mesh / object mode with Pie menu? The following command in edit or object mode is the same to create a new mesh cube:

bpy.ops.mesh.primitive_cube_add


I structured my pie this way but nothing happens - only when I am in edit mode.
I assume because mesh.primitive_cube_add is a mesh object? But it is the same readout in the console, when in object mode I press shift A and select the cube.

import bpy
from bpy.types import Menu

class NewPie(Menu):
    bl_label = "Select Mode"
    bl_idname = "mypie"
    def draw(self, context):
        layout = self.layout

        pie = layout.menu_pie()
        pie.operator("mesh.primitive_cube_add")

def register():
    bpy.utils.register_class(NewPie)

    wm = bpy.context.window_manager
    km = wm.keyconfigs.addon.keymaps.new(name="Mesh")
    kmi = km.keymap_items.new("wm.call_menu_pie", "E", "PRESS", shift=True, ctrl=True).properties.name="mypie"

def unregister():
    bpy.utils.unregister_class(NewPie)


if __name__ == "__main__":
    register()

    bpy.ops.wm.call_menu_pie(name="NewPie")
You have to add the shortcut to the Object Mode shortcuts so it would be captured when you are in object mode, so the register function would be like this :

def register():
    bpy.utils.register_class(NewPie)
    #Add shortcuts
    wm = bpy.context.window_manager
    #Edit Mode    
    km = wm.keyconfigs.addon.keymaps.new(name="Mesh")
    kmi = km.keymap_items.new("wm.call_menu_pie", "E", "PRESS",shift=True, ctrl=True).properties.name="mypie"
    #Object Mode
    km = wm.keyconfigs.addon.keymaps.new(name="Object Mode")
    kmi = km.keymap_items.new("wm.call_menu_pie", "E", "PRESS", shift=True, ctrl=True).properties.name="mypie"