HomeyAPI~ManagerUsers

Methods

async login(optsopt) → {Promise.<string>}

Exchange a delegation token for a session bearer token
Parameters:
Name Type Attributes Description
opts object <optional>
Named parameters
Properties
Name Type Description
token string
Returns:
Promise.<string> - A Bearer token, to be used by the authorization header

async getUsers(optsopt) → {Promise.<Object.<string, HomeyAPI.ManagerUsers.User>>}

Required OAuth scopes:
- homey.user.readonly

Parameters:
Name Type Attributes Description
opts object <optional>
Named parameters
Properties
Name Type Attributes Description
filter HomeyAPI.ManagerUsers.User <optional>
A response filter (Using a filter will bypass all caches, use sparingely)
Returns:
Promise.<Object.<string, HomeyAPI.ManagerUsers.User>> - Successful response

async createUser(optsopt) → {Promise.<void>}

Required OAuth scopes:
- homey.user

Parameters:
Name Type Attributes Description
opts object <optional>
Named parameters
Properties
Name Type Description
user HomeyAPI.ManagerUsers.User
Returns:
Promise.<void> - Successful response

async getUserMe(optsopt) → {Promise.<HomeyAPI.ManagerUsers.User>}

Required OAuth scopes:
- homey.user.self

Parameters:
Name Type Attributes Description
opts object <optional>
Named parameters
Returns:
Promise.<HomeyAPI.ManagerUsers.User> - Successful response

async updateUserMe(optsopt) → {Promise.<HomeyAPI.ManagerUsers.User>}

Required OAuth scopes:
- homey.user.self

Parameters:
Name Type Attributes Description
opts object <optional>
Named parameters
Properties
Name Type Attributes Description
name object <optional>
email object <optional>
Returns:
Promise.<HomeyAPI.ManagerUsers.User> - Successful response

async deleteUserMe(optsopt) → {Promise.<void>}

Required OAuth scopes:
- homey.user.self

Parameters:
Name Type Attributes Description
opts object <optional>
Named parameters
Returns:
Promise.<void> - Successful response

async getUser(optsopt) → {Promise.<HomeyAPI.ManagerUsers.User>}

Required OAuth scopes:
- homey.user.readonly

Parameters:
Name Type Attributes Description
opts object <optional>
Named parameters
Properties
Name Type Description
id string
Returns:
Promise.<HomeyAPI.ManagerUsers.User> - Successful response

async updateUser(optsopt) → {Promise.<HomeyAPI.ManagerUsers.User>}

Required OAuth scopes:
- homey.user

Parameters:
Name Type Attributes Description
opts object <optional>
Named parameters
Properties
Name Type Description
id string
user HomeyAPI.ManagerUsers.User
Returns:
Promise.<HomeyAPI.ManagerUsers.User> - Successful response

async deleteUser(optsopt) → {Promise.<void>}

Required OAuth scopes:
- homey.user

Parameters:
Name Type Attributes Description
opts object <optional>
Named parameters
Properties
Name Type Description
id string
Returns:
Promise.<void> - Successful response

async updateUserMeProperties(optsopt) → {Promise.<void>}

Required OAuth scopes:
- homey.user.self

Parameters:
Name Type Attributes Description
opts object <optional>
Named parameters
Properties
Name Type Description
id string
value object
Returns:
Promise.<void> - Successful response

async deleteUserMeProperties(optsopt) → {Promise.<void>}

Required OAuth scopes:
- homey.user.self

Parameters:
Name Type Attributes Description
opts object <optional>
Named parameters
Properties
Name Type Description
id string
Returns:
Promise.<void> - Successful response

async swapOwner(optsopt) → {Promise.<void>}

Required OAuth scopes:
- homey.user

Parameters:
Name Type Attributes Description
opts object <optional>
Named parameters
Properties
Name Type Description
newOwnerUserId string
Returns:
Promise.<void> - Successful response

async getState(optsopt) → {Promise.<object>}

Gets this manager's state

Required OAuth scopes:
- homey.user.readonly

Parameters:
Name Type Attributes Description
opts object <optional>
Named parameters
Returns:
Promise.<object> - The state of this manager

destroy()

Unsubscribes to realtime events, clear all caches, and remove all event listeners for this manager and it's managed objects

Events

user.create

Fired when a managed User is created
Parameters:
Name Type Description
user HomeyAPI.ManagerUsers.User The affected User

user.update

Fired when a managed User is changed
Parameters:
Name Type Description
user HomeyAPI.ManagerUsers.User The affected User

user.delete

Fired when a managed User has been deleted
Parameters:
Name Type Description
user HomeyAPI.ManagerUsers.User The affected User

state

Emits when the state of the manager changes
Parameters:
Name Type Description
state object The new state

Classes

Error

User