ManagerPresence

Access this instance at HomeyAPIV2.presence.

Extends

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>

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>

getAsleep

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

Scopes

homey.presence.readonly

HTTP

GET /api/manager/presence/:id/asleep

Parameters

Name Type Description
opts
object
id
string
}

Returns

Promise.<any>

getPresent

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

Scopes

homey.presence.readonly

HTTP

GET /api/manager/presence/:id/present

Parameters

Name Type Description
opts
object
id
string
}

Returns

Promise.<any>

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(event)

Parameters

Name Type Description
event
string

removeListener

removeListener(event, callback)

Shortcut to EventEmitter#off

Parameters

Name Type Description
event
string
callback
function

setAsleep

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

Scopes

homey.presence

HTTP

PUT /api/manager/presence/:id/asleep

Parameters

Name Type Description
opts
object
id
string
value
* <optional>
}

Returns

Promise.<any>

setAsleepMe

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

Scopes

homey.presence.self

HTTP

PUT /api/manager/presence/me/asleep

Parameters

Name Type Description
opts
object
opts
* <optional>
value
* <optional>
}

Returns

Promise.<any>

setPresent

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

Scopes

homey.presence

HTTP

PUT /api/manager/presence/:id/present

Parameters

Name Type Description
opts
object
id
string
value
* <optional>
}

Returns

Promise.<any>

setPresentMe

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

Scopes

homey.presence.self

HTTP

PUT /api/manager/presence/me/present

Parameters

Name Type Description
opts
object
opts
* <optional>
value
* <optional>
}

Returns

Promise.<any>