Constructor
new Location(connection, locationId)
The constructor for Nello locations.
- Source:
Parameters:
Name |
Type |
Description |
connection |
Nello
|
Nello instance
|
locationId |
String
|
ID of the Nello location
|
Methods
addListener(url, methodsopt, sslopt)
This function adds a listener on an URL respectively a webhook to receive events.
- Source:
Parameters:
Name |
Type |
Attributes |
Default |
Description |
url |
String
|
|
|
URL of the webhook
|
methods |
Array
|
<optional>
|
['GET', 'POST', 'PUT', 'DELETE']
|
Allowed HTTP methods to the webhook
|
ssl |
Object
|
<optional>
|
|
SSL configuration data
Name |
Type |
Description |
key |
String
|
SSL Private key (either string to file or key itself)
|
cert |
String
|
SSL Certificate (either string to file or key itself)
|
ca |
String
|
SSL Certificate authority (either string to file or key itself)
|
|
addTimeWindow(data) → {Promise.<Object>}
This function adds a new time window.
- Source:
Parameters:
Name |
Type |
Description |
data |
Object
|
Data of the new time window
Name |
Type |
Description |
name |
String
|
Name of the new time window
|
ical |
String
|
ICal data of the new time window
|
|
Returns:
-
Type:
-
Promise.<Object>
addWebhook(url, sslopt, actionsopt, listenopt, methodsopt) → {Promise.<Object>}
This function adds / attaches a webhook.
- Source:
Parameters:
Name |
Type |
Attributes |
Default |
Description |
url |
String
|
|
|
URL of the webhook
|
ssl |
Object
|
<optional>
|
|
SSL configuration data
Name |
Type |
Description |
key |
String
|
SSL Private key (either string to file or key itself)
|
cert |
String
|
SSL Certificate (either string to file or key itself)
|
ca |
String
|
SSL Certificate authority (either string to file or key itself)
|
|
actions |
Array
|
<optional>
|
['swipe', 'geo', 'tw', 'deny']
|
Allowed nello actions to listen to
|
listen |
Boolean
|
<optional>
|
false
|
State whether listener shall be attached to webhook
|
methods |
Array
|
<optional>
|
['GET', 'POST', 'PUT', 'DELETE']
|
Allowed HTTP methods to the webhook
|
Returns:
-
Type:
-
Promise.<Object>
getTimeWindow(twId) → {Promise.<TimeWindowInfo>}
This function retrieves a single time window.
- Source:
Parameters:
Name |
Type |
Description |
twId |
String
|
ID of the time window
|
getTimeWindows(void) → {Promise.<Array.<TimeWindowInfo>>}
This function retrieves all time windows.
- Source:
Parameters:
Name |
Type |
Description |
void |
|
|
openDoor(void) → {Promise.<Boolean>}
This function opens the door.
- Source:
Parameters:
Name |
Type |
Description |
void |
|
|
Returns:
-
Type:
-
Promise.<Boolean>
removeAllTimeWindows(void) → {Promise.<Boolean>}
This function removes all time windows.
- Source:
Parameters:
Name |
Type |
Description |
void |
|
|
Returns:
-
Type:
-
Promise.<Boolean>
removeTimeWindow(twId) → {Promise.<Boolean>}
This function removes a specfic time window.
- Source:
Parameters:
Name |
Type |
Description |
twId |
String
|
ID of the time window
|
Returns:
-
Type:
-
Promise.<Boolean>
removeWebhook(void) → {Promise.<Boolean>}
This function removes a webhook.
- Source:
Parameters:
Name |
Type |
Description |
void |
|
|
Returns:
-
Type:
-
Promise.<Boolean>