Access this instance at HomeyAPIV2.sessions
.
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
Promise.<void>
deleteSession
(async) deleteSession(opts)Scopes
homey.user.readonly
HTTP
DELETE /api/manager/sessions/session/: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> |
getSessionMe
(async) getSessionMe(): Promise.<any>Scopes
-
HTTP
GET /api/manager/sessions/session/me
Returns
Promise.<any>
getSessions
(async) getSessions(): Promise.<Object.<string, HomeyAPIV2.ManagerSessions.Session>>Scopes
homey.user.readonly
HTTP
GET /api/manager/sessions/session
Returns
Promise.<Object.<string, HomeyAPIV2.ManagerSessions.Session>>
isConnected
isConnected(): BooleanIf 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 |
Events
session.create
.on('session.create')Parameters
Name | Type | Description |
---|---|---|
session
|
HomeyAPIV2.ManagerSessions.Session |
session.delete
.on('session.delete')Parameters
Name | Type | Description |
---|---|---|
session
|
HomeyAPIV2.ManagerSessions.Session |
session.update
.on('session.update')Parameters
Name | Type | Description |
---|---|---|
session
|
HomeyAPIV2.ManagerSessions.Session |