Access this instance at HomeyAPIV2.notifications
.
Extends
Classes
Instance Properties
homey
homey: HomeyAPIV3uri
uri: StringThe 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
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
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
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
isConnected
isConnected(): BooleanIf this manager's namespace is connected to Socket.io.
Returns
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
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
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
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 |