 crypto = require 'crypto'
 config = require './config'
 PlatformAPI = require 'pinejs-client-js/request'
+fs = Promise.promisifyAll(require('fs'))
 
 PLATFORM_ENDPOINT = url.resolve(config.apiEndpoint, '/ewa/')
 resinAPI = new PlatformAPI(PLATFORM_ENDPOINT)

		if userConfig.uuid? and userConfig.registered_at?
			return userConfig
		registerDevice(userConfig.apiKey, userConfig.userId, userConfig.applicationId, userConfig.deviceType, userConfig.uuid)
		.then (uuid) ->
			userConfig.uuid = uuid
			return userConfig
	.then ->
		console.log('Finishing bootstrapping')
		Promise.all([

			device_type: deviceType
		customOptions:
			apikey: apiKey
	).then (data) ->
		_.pick(data, 'id', 'uuid')

module.exports = ->
	# Load config file
