def METHOD_NAME(api, pluginId, hostInfo):
    remote = plugin_remote.PluginRemote(
        peer, api, pluginId, hostInfo, transport.loop
    )
    wrapped = remote.setSystemState
    async def remoteSetSystemState(systemState):
        await wrapped(systemState)
        async def resolve():
            sdk = ScryptedStatic()
            sdk.api = api
            sdk.remote = remote
            sdk.systemManager = SystemManager(api, remote.systemState)
            sdk.deviceManager = DeviceManager(
                remote.nativeIds, sdk.systemManager
            )
            sdk.mediaManager = MediaManager(await api.getMediaManager())
            ret.set_result(sdk)
        asyncio.run_coroutine_threadsafe(resolve(), transport.loop)
    remote.setSystemState = remoteSetSystemState
    return remote