ManagerNotifications

Access this instance at HomeyAPIV2.notifications.

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>

deleteNotification

(async) deleteNotification(opts)

Scopes

homey.notifications

HTTP

DELETE /api/manager/notifications/notification/:id

Parameters

Name Type Description
opts
object
id
string
}

deleteNotifications

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

Scopes

homey.notifications

HTTP

DELETE /api/manager/notifications/notification

Parameters

Name Type Description
opts
object
ownerUri
string <optional>
}

Returns

Promise.<any>

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>

getNotification

(async) getNotification(opts): Promise.<HomeyAPIV2.ManagerNotifications.Notification>

Scopes

homey.notifications.readonly

HTTP

GET /api/manager/notifications/notification/:id

Parameters

Name Type Description
opts
object
id
string
}

Returns

getNotifications

(async) getNotifications(): Promise.<Object.<string, HomeyAPIV2.ManagerNotifications.Notification>>

Scopes

homey.notifications.readonly

HTTP

GET /api/manager/notifications/notification/

Returns

getOwners

(async) getOwners(): Promise.<any>

Scopes

homey.notifications.readonly

HTTP

GET /api/manager/notifications/owner

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

Parameters

Name Type Description
event
string <optional>

removeListener

removeListener(event, callback)

Shortcut to EventEmitter#off

Parameters

Name Type Description
event
string
callback
function

setNotificationRead

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

Scopes

homey.notifications.readonly

HTTP

POST /api/manager/notifications/notification/:id/read

Parameters

Name Type Description
opts
object
id
string
}

Returns

Promise.<any>

setOwnerEnabled

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

Scopes

homey.notifications

HTTP

PUT /api/manager/notifications/owner/:uri/enabled

Parameters

Name Type Description
opts
object
uri
string
enabled
boolean
}

Returns

Promise.<any>

setOwnerPush

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

Scopes

homey.notifications

HTTP

PUT /api/manager/notifications/owner/:uri/push

Parameters

Name Type Description
opts
object
uri
string
push
boolean
}

Returns

Promise.<any>

Events

notification.create

.on('notification.create')

Parameters

Name Type Description
notification
HomeyAPIV2.ManagerNotifications.Notification

notification.delete

.on('notification.delete')

Parameters

Name Type Description
notification
HomeyAPIV2.ManagerNotifications.Notification

notification.update

.on('notification.update')

Parameters

Name Type Description
notification
HomeyAPIV2.ManagerNotifications.Notification