HomeyAPI~ManagerDevices

Since:
  • 1.0.0

Methods

async getDevices(optsopt) → {Promise.<Object.<string, HomeyAPI.ManagerDevices.Device>>}

Required OAuth scopes:
- homey.device.readonly

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

async getDevice(optsopt) → {Promise.<HomeyAPI.ManagerDevices.Device>}

Required OAuth scopes:
- homey.device.readonly

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

async updateDevice(optsopt) → {Promise.<HomeyAPI.ManagerDevices.Device>}

Required OAuth scopes:
- homey.device

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

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

Required OAuth scopes:
- homey.device

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

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

Required OAuth scopes:
- homey.device.control

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

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

Required OAuth scopes:
- homey.device.readonly

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

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

Required OAuth scopes:
- homey.device

Parameters:
Name Type Attributes Description
opts object <optional>
Named parameters
Properties
Name Type Description
id string
settings object
Returns:
Promise.<object> - returns an object containing the actual changed settings and an optional message

async getCapabilities(optsopt) → {Promise.<Array.<HomeyAPI.ManagerDevices.Capability>>}

Required OAuth scopes:
- homey.device.readonly

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

async getCapability(optsopt) → {Promise.<HomeyAPI.ManagerDevices.Capability>}

Required OAuth scopes:
- homey.device.readonly

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

destroy()

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

Events

device.create

Fired when a managed Device is created
Parameters:
Name Type Description
device HomeyAPI.ManagerDevices.Device The affected Device

device.update

Fired when a managed Device is changed
Parameters:
Name Type Description
device HomeyAPI.ManagerDevices.Device The affected Device

device.delete

Fired when a managed Device has been deleted
Parameters:
Name Type Description
device HomeyAPI.ManagerDevices.Device The affected Device

capability.create

Fired when a managed Capability is created
Parameters:
Name Type Description
capability HomeyAPI.ManagerDevices.Capability The affected Capability

capability.update

Fired when a managed Capability is changed
Parameters:
Name Type Description
capability HomeyAPI.ManagerDevices.Capability The affected Capability

capability.delete

Fired when a managed Capability has been deleted
Parameters:
Name Type Description
capability HomeyAPI.ManagerDevices.Capability The affected Capability

Classes

Error

Device

Capability