ManagerLogic

Access this instance at HomeyAPIV2.logic.

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>

createVariable

(async) createVariable(opts): Promise.<HomeyAPIV2.ManagerLogic.Variable>

Scopes

homey.logic

HTTP

POST /api/manager/logic/variable/

Parameters

Name Type Description
opts
object
variable
*
}

Returns

deleteVariable

(async) deleteVariable(opts)

Scopes

homey.logic

HTTP

DELETE /api/manager/logic/variable/:id

Parameters

Name Type Description
opts
object
id
string
}

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>

getVariable

(async) getVariable(opts): Promise.<HomeyAPIV2.ManagerLogic.Variable>

Scopes

homey.logic.readonly

HTTP

GET /api/manager/logic/variable/:id

Parameters

Name Type Description
opts
object
id
string
}

Returns

getVariables

(async) getVariables(): Promise.<Object.<string, HomeyAPIV2.ManagerLogic.Variable>>

Scopes

homey.logic.readonly

HTTP

GET /api/manager/logic/variable

Returns

Promise.<Object.<string, HomeyAPIV2.ManagerLogic.Variable>>

isConnected

isConnected(): Boolean

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

Returns

Boolean

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

triggerWebhook

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

Scopes

-

HTTP

GET /api/manager/logic/webhook/:event

Parameters

Name Type Description
opts
object
event
string <optional>
tag
string <optional>
}

Returns

Promise.<any>

updateVariable

(async) updateVariable(opts): Promise.<HomeyAPIV2.ManagerLogic.Variable>

Scopes

homey.logic

HTTP

PUT /api/manager/logic/variable/:id

Parameters

Name Type Description
opts
object
id
string
variable
*
}

Returns

Events

variable.create

.on('variable.create')

Parameters

Name Type Description
variable
HomeyAPIV2.ManagerLogic.Variable

variable.delete

.on('variable.delete')

Parameters

Name Type Description
variable
HomeyAPIV2.ManagerLogic.Variable

variable.update

.on('variable.update')

Parameters

Name Type Description
variable
HomeyAPIV2.ManagerLogic.Variable