ManagerUsers

Access this instance at HomeyAPIV2.users.

Extends

Classes

Instance Properties

homey

homey: HomeyAPIV3

The Homey of the Manager.

Type

uri

uri: String

The URI of the Item, e.g. homey:manager:bar.

Type

  • String

Instance Methods

addListener

addListener(event, callback)

Parameters

Name Type Description
event
string
callback
function

connect

(async) connect(): Promise.<void>

Connect to this manager's Socket.io namespace.

Returns

Promise.<void>

createUser

(async) createUser(opts): Promise.<HomeyAPIV2.ManagerUsers.User>

Scopes

homey.user

HTTP

POST /api/manager/users/user

Parameters

Name Type Description
opts
object
user
*
}

Returns

deleteUser

(async) deleteUser(opts)

Scopes

homey.user

HTTP

DELETE /api/manager/users/user/:id

Parameters

Name Type Description
opts
object
id
string
}

deleteUserMe

(async) deleteUserMe(): Promise.<any>

Scopes

homey.user.self

HTTP

DELETE /api/manager/users/user/me

Returns

Promise.<any>

deleteUserMeProperties

(async) deleteUserMeProperties(opts): Promise.<any>

Scopes

homey.user.self

HTTP

DELETE /api/manager/users/user/me/properties/:id

Parameters

Name Type Description
opts
object
id
string
}

Returns

Promise.<any>

destroy

destroy()

Destroy this Manager by cleaning up all references, unbinding event listeners and disconnecting from the Socket.io namespace.

disconnect

(async) disconnect(): Promise.<void>

Disconnect from this manager's Socket.io namespace.

Returns

Promise.<void>

emit

emit(event, …data)

Parameters

Name Type Description
event
string
data
any <repeatable>

getState

(async) getState(): Promise.<any>

Scopes

USER_READONLY

HTTP

GET /api/manager/users/state

Returns

Promise.<any>

getUser

(async) getUser(opts): Promise.<HomeyAPIV2.ManagerUsers.User>

Scopes

homey.user.readonly

HTTP

GET /api/manager/users/user/:id

Parameters

Name Type Description
opts
object
id
string
}

Returns

getUserMe

(async) getUserMe(): Promise.<any>

Scopes

homey.user.self

HTTP

GET /api/manager/users/user/me

Returns

Promise.<any>

getUsers

(async) getUsers(): Promise.<Object.<string, HomeyAPIV2.ManagerUsers.User>>

Scopes

homey.user.readonly

HTTP

GET /api/manager/users/user

Returns

Promise.<Object.<string, HomeyAPIV2.ManagerUsers.User>>

isConnected

isConnected(): Boolean

If this manager's namespace is connected to Socket.io.

Returns

Boolean

login

(async) login(opts): Promise.<any>

Scopes

-

HTTP

POST /api/manager/users/login

Parameters

Name Type Description
opts
object
token
string <optional>
}

Returns

Promise.<any>

off

off(event, callback)

Parameters

Name Type Description
event
string
callback
function

on

on(event, callback)

Parameters

Name Type Description
event
string
callback
function

once

once(event, callback)

Parameters

Name Type Description
event
string
callback
function

removeAllListeners

removeAllListeners(eventopt)

Parameters

Name Type Description
event
string <optional>

removeListener

removeListener(event, callback)

Shortcut to EventEmitter#off

Parameters

Name Type Description
event
string
callback
function

swapOwner

(async) swapOwner(opts): Promise.<any>

Scopes

homey.user

HTTP

POST /api/manager/users/swap-owner

Parameters

Name Type Description
opts
object
newOwnerUserId
string
}

Returns

Promise.<any>

updateUser

(async) updateUser(opts): Promise.<HomeyAPIV2.ManagerUsers.User>

Scopes

homey.user

HTTP

PUT /api/manager/users/user/:id

Parameters

Name Type Description
opts
object
id
string
user
*
}

Returns

updateUserMe

(async) updateUserMe(opts): Promise.<any>

Scopes

homey.user.self

HTTP

PUT /api/manager/users/user/me

Parameters

Name Type Description
opts
object
email
* <optional>
name
* <optional>
}

Returns

Promise.<any>

updateUserMeProperties

(async) updateUserMeProperties(opts): Promise.<any>

Scopes

homey.user.self

HTTP

PUT /api/manager/users/user/me/properties/:id

Parameters

Name Type Description
opts
object
id
string
value
object
}

Returns

Promise.<any>

Events

user.create

.on('user.create')

Parameters

Name Type Description
user
HomeyAPIV2.ManagerUsers.User

user.delete

.on('user.delete')

Parameters

Name Type Description
user
HomeyAPIV2.ManagerUsers.User

user.update

.on('user.update')

Parameters

Name Type Description
user
HomeyAPIV2.ManagerUsers.User