HomeyAPI~ManagerUsers

Methods

async login(optsopt) → {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:
string - A Bearer token, to be used by the authorization header

async getUsers(optsopt) → {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:
Object.<string, HomeyAPI.ManagerUsers.User> - Successful response

async createUser(optsopt)

Required OAuth scopes:
- homey.user

Parameters:
Name Type Attributes Description
opts object <optional>
Named parameters
Properties
Name Type Description
user HomeyAPI.ManagerUsers.User

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

Required OAuth scopes:
- homey.user.self

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

async updateUserMe(optsopt) → {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:
HomeyAPI.ManagerUsers.User - Successful response

async deleteUserMe(optsopt)

Required OAuth scopes:
- homey.user.self

Parameters:
Name Type Attributes Description
opts object <optional>
Named parameters

async getUser(optsopt) → {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:
HomeyAPI.ManagerUsers.User - Successful response

async updateUser(optsopt) → {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:
HomeyAPI.ManagerUsers.User - Successful response

async deleteUser(optsopt)

Required OAuth scopes:
- homey.user

Parameters:
Name Type Attributes Description
opts object <optional>
Named parameters
Properties
Name Type Description
id string

async updateUserMeProperties(optsopt)

Required OAuth scopes:
- homey.user.self

Parameters:
Name Type Attributes Description
opts object <optional>
Named parameters
Properties
Name Type Description
id string
value object

async deleteUserMeProperties(optsopt)

Required OAuth scopes:
- homey.user.self

Parameters:
Name Type Attributes Description
opts object <optional>
Named parameters
Properties
Name Type Description
id string

async swapOwner(optsopt)

Required OAuth scopes:
- homey.user

Parameters:
Name Type Attributes Description
opts object <optional>
Named parameters
Properties
Name Type Description
newOwnerUserId string

async getState(optsopt) → {object}

Gets this manager's state

Required OAuth scopes:
- homey.user.readonly

Parameters:
Name Type Attributes Description
opts object <optional>
Named parameters
Returns:
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