ManagerZones

Access this instance at HomeyAPIV2.zones.

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>

createZone

(async) createZone(opts): Promise.<HomeyAPIV2.ManagerZones.Zone>

Scopes

homey.zone

HTTP

POST /api/manager/zones/zone

Parameters

Name Type Description
opts
object
zone
*
}

Returns

deleteZone

(async) deleteZone(opts)

Scopes

homey.zone

HTTP

DELETE /api/manager/zones/zone/: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>

getZone

(async) getZone(opts): Promise.<HomeyAPIV2.ManagerZones.Zone>

Scopes

homey.zone.readonly

HTTP

GET /api/manager/zones/zone/:id

Parameters

Name Type Description
opts
object
id
string
}

Returns

getZones

(async) getZones(): Promise.<Object.<string, HomeyAPIV2.ManagerZones.Zone>>

Scopes

homey.zone.readonly

HTTP

GET /api/manager/zones/zone

Returns

Promise.<Object.<string, HomeyAPIV2.ManagerZones.Zone>>

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

updateZone

(async) updateZone(opts): Promise.<HomeyAPIV2.ManagerZones.Zone>

Scopes

homey.zone

HTTP

PUT /api/manager/zones/zone/:id

Parameters

Name Type Description
opts
object
id
string
zone
*
}

Returns

Events

zone.create

.on('zone.create')

Parameters

Name Type Description
zone
HomeyAPIV2.ManagerZones.Zone

zone.delete

.on('zone.delete')

Parameters

Name Type Description
zone
HomeyAPIV2.ManagerZones.Zone

zone.update

.on('zone.update')

Parameters

Name Type Description
zone
HomeyAPIV2.ManagerZones.Zone