UNPKG

nuki-web-api

Version:

Node.js implementation (using promises) of the Nuki Web API

3,551 lines (1,161 loc) 50.9 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width,initial-scale=1"> <title>Nuki - Documentation</title> <script src="scripts/prettify/prettify.js"></script> <script src="scripts/prettify/lang-css.js"></script> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css"> <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css"> <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css"> </head> <body> <input type="checkbox" id="nav-trigger" class="nav-trigger" /> <label for="nav-trigger" class="navicon-button x"> <div class="navicon"></div> </label> <label for="nav-trigger" class="overlay"></label> <nav> <li class="nav-link nav-home-link"><a href="index.html">Home</a></li><li class="nav-heading">Classes</li><li class="nav-heading"><span class="nav-item-type type-class">C</span><span class="nav-item-name"><a href="Nuki.html">Nuki</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Nuki.html#.module.exports.getAccount">module.exports.getAccount</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Nuki.html#.module.exports.getBrand">module.exports.getBrand</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Nuki.html#.module.exports.getModel">module.exports.getModel</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Nuki.html#.module.exports.getNotification">module.exports.getNotification</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Nuki.html#.module.exports.getSmartlock">module.exports.getSmartlock</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Nuki.html#.module.exports.getSmartlockAuth">module.exports.getSmartlockAuth</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Nuki.html#.module.exports.getSmartlockAuths">module.exports.getSmartlockAuths</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Nuki.html#.module.exports.getSmartlockLogs">module.exports.getSmartlockLogs</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Nuki.html#.module.exports.getSmartlocks">module.exports.getSmartlocks</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Nuki.html#.module.exports.getSmartlockUsers">module.exports.getSmartlockUsers</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Nuki.html#.module.exports.getSubscription">module.exports.getSubscription</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Nuki.html#.module.exports.setAction">module.exports.setAction</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Nuki.html#.module.exports.updateSmartlock">module.exports.updateSmartlock</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Nuki.html#_req">_req</a></span></li> </nav> <div id="main"> <h1 class="page-title">Nuki</h1> <section> <header> <h2> Nuki </h2> <div class="class-description">Nuki Web</div> </header> <article> <div class="container-overview"> <div class="section-method"> <h2>Constructor</h2> <h4 class="name" id="Nuki"><span class="type-signature"></span>new Nuki<span class="signature">(token, options<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="Nuki.html">Nuki</a>}</span></h4> <div class="description"> Based on Nuki Web API v.1.1.1 as of 30.08.2018 </div> <dl class="details"> <dt class="tag-version">Version:</dt> <dd class="tag-version"><ul class="dummy"><li>2.0.0</li></ul></dd> <dt class="tag-author">Author:</dt> <dd class="tag-author"> <ul> <li><a href="mailto:zefau@mailbox.rg">Zefau</a></li> </ul> </dd> <dt class="tag-license">License:</dt> <dd class="tag-license"><ul class="dummy"><li>MIT</li></ul></dd> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Nuki.js.html">Nuki.js</a>, <a href="Nuki.js.html#line24">line 24</a> </li></ul></dd> <dt class="tag-see">See:</dt> <dd class="tag-see"> <ul> <li><a href="https://developer.nuki.io/page/nuki-web-api-111/3/">https://developer.nuki.io/page/nuki-web-api-111/3/</a></li> </ul> </dd> </dl> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>token</code></td> <td class="type"> <span class="param-type"><code>String</code></span> </td> <td class="attributes"> </td> <td class="description last"> Token for authentication </td> </tr> <tr> <td class="name"><code>options</code></td> <td class="type"> <span class="param-type"><code>Object</code></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"> Further options <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>url</code></td> <td class="type"> <span class="param-type"><code>String</code></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"> Override default API url (which is https://api.nuki.io) </td> </tr> </tbody> </table> </td> </tr> </tbody> </table> <div class="section-returns"> <h5>Returns:</h5> <dl class="param-type"> <dt> Type: </dt> <dd> <span class="param-type"><code><a href="Nuki.html">Nuki</a></code></span> </dd> </dl> </div> </div> </div> <h3 class="subsection-title">Methods</h3> <div class="section-method"> <h4 class="name" id=".module.exports.getAccount"><span class="type-signature">(static) </span>module.exports.getAccount<span class="signature">(void)</span><span class="type-signature"> &rarr; {Promise}</span></h4> <div class="description"> Get an account </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Account.js.html">Account.js</a>, <a href="Account.js.html#line12">line 12</a> </li></ul></dd> <dt class="tag-see">See:</dt> <dd class="tag-see"> <ul> <li><a href="https://api.nuki.io/#!/Account/get">https://api.nuki.io/#!/Account/get</a></li> </ul> </dd> </dl> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>void</code></td> <td class="type"> </td> <td class="description last"> </td> </tr> </tbody> </table> <div class="section-returns"> <h5>Returns:</h5> <dl class="param-type"> <dt> Type: </dt> <dd> <span class="param-type"><code>Promise</code></span> </dd> </dl> </div> </div> <div class="section-method"> <h4 class="name" id=".module.exports.getBrand"><span class="type-signature">(static) </span>module.exports.getBrand<span class="signature">(brandId<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise}</span></h4> <div class="description"> Get a list of ntercom brands for all of your openers </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="OpenerIntercomBrand.js.html">OpenerIntercomBrand.js</a>, <a href="OpenerIntercomBrand.js.html#line12">line 12</a> </li></ul></dd> <dt class="tag-see">See:</dt> <dd class="tag-see"> <ul> <li><a href="https://api.nuki.io/#!/OpenerIntercomBrand">https://api.nuki.io/#!/OpenerIntercomBrand</a></li> </ul> </dd> </dl> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>brandId</code></td> <td class="type"> <span class="param-type"><code>Integer</code></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"> The brand id </td> </tr> </tbody> </table> <div class="section-returns"> <h5>Returns:</h5> <dl class="param-type"> <dt> Type: </dt> <dd> <span class="param-type"><code>Promise</code></span> </dd> </dl> </div> </div> <div class="section-method"> <h4 class="name" id=".module.exports.getModel"><span class="type-signature">(static) </span>module.exports.getModel<span class="signature">(intercomId<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise}</span></h4> <div class="description"> Get a list of intercom models for all of your openers </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="OpenerIntercomModel.js.html">OpenerIntercomModel.js</a>, <a href="OpenerIntercomModel.js.html#line12">line 12</a> </li></ul></dd> <dt class="tag-see">See:</dt> <dd class="tag-see"> <ul> <li><a href="https://api.nuki.io/#!/OpenerIntercomModel">https://api.nuki.io/#!/OpenerIntercomModel</a></li> </ul> </dd> </dl> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>intercomId</code></td> <td class="type"> <span class="param-type"><code>Integer</code></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"> The intercom id </td> </tr> </tbody> </table> <div class="section-returns"> <h5>Returns:</h5> <dl class="param-type"> <dt> Type: </dt> <dd> <span class="param-type"><code>Promise</code></span> </dd> </dl> </div> </div> <div class="section-method"> <h4 class="name" id=".module.exports.getNotification"><span class="type-signature">(static) </span>module.exports.getNotification<span class="signature">(notificationId<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise}</span></h4> <div class="description"> Get a list of notifications for all of your smartlocks </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Notification.js.html">Notification.js</a>, <a href="Notification.js.html#line12">line 12</a> </li></ul></dd> <dt class="tag-see">See:</dt> <dd class="tag-see"> <ul> <li><a href="https://api.nuki.io/#!/Notification">https://api.nuki.io/#!/Notification</a></li> </ul> </dd> </dl> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>notificationId</code></td> <td class="type"> <span class="param-type"><code>Integer</code></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"> The notification id </td> </tr> </tbody> </table> <div class="section-returns"> <h5>Returns:</h5> <dl class="param-type"> <dt> Type: </dt> <dd> <span class="param-type"><code>Promise</code></span> </dd> </dl> </div> </div> <div class="section-method"> <h4 class="name" id=".module.exports.getSmartlock"><span class="type-signature">(static) </span>module.exports.getSmartlock<span class="signature">(smartlockId)</span><span class="type-signature"> &rarr; {Promise}</span></h4> <div class="description"> This function returns a specific lock. </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Smartlock.js.html">Smartlock.js</a>, <a href="Smartlock.js.html#line37">line 37</a> </li></ul></dd> <dt class="tag-see">See:</dt> <dd class="tag-see"> <ul> <li><a href="https://api.nuki.io/#!/Smartlock/get_0">https://api.nuki.io/#!/Smartlock/get_0</a></li> </ul> </dd> </dl> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>smartlockId</code></td> <td class="type"> <span class="param-type"><code>Integer</code></span> </td> <td class="description last"> The smartlock id </td> </tr> </tbody> </table> <div class="section-returns"> <h5>Returns:</h5> <dl class="param-type"> <dt> Type: </dt> <dd> <span class="param-type"><code>Promise</code></span> </dd> </dl> </div> </div> <div class="section-method"> <h4 class="name" id=".module.exports.getSmartlockAuth"><span class="type-signature">(static) </span>module.exports.getSmartlockAuth<span class="signature">(smartlockId, userId<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise}</span></h4> <div class="description"> Get a list of smartlock authorizations </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="SmartlockAuth.js.html">SmartlockAuth.js</a>, <a href="SmartlockAuth.js.html#line50">line 50</a> </li></ul></dd> <dt class="tag-see">See:</dt> <dd class="tag-see"> <ul> <li><a href="https://api.nuki.io/#!/SmartlockAuth/get_0">https://api.nuki.io/#!/SmartlockAuth/get_0</a></li> </ul> </dd> </dl> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>smartlockId</code></td> <td class="type"> <span class="param-type"><code>Integer</code></span> </td> <td class="attributes"> </td> <td class="description last"> The smartlock id </td> </tr> <tr> <td class="name"><code>userId</code></td> <td class="type"> <span class="param-type"><code>String</code></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"> The smartlock auth unique id </td> </tr> </tbody> </table> <div class="section-returns"> <h5>Returns:</h5> <dl class="param-type"> <dt> Type: </dt> <dd> <span class="param-type"><code>Promise</code></span> </dd> </dl> </div> </div> <div class="section-method"> <h4 class="name" id=".module.exports.getSmartlockAuths"><span class="type-signature">(static) </span>module.exports.getSmartlockAuths<span class="signature">(parameters<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise}</span></h4> <div class="description"> Get a list of smartlock authorizations for your smartlocks </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="SmartlockAuth.js.html">SmartlockAuth.js</a>, <a href="SmartlockAuth.js.html#line13">line 13</a> </li></ul></dd> <dt class="tag-see">See:</dt> <dd class="tag-see"> <ul> <li><a href="https://api.nuki.io/#!/SmartlockAuth/get">https://api.nuki.io/#!/SmartlockAuth/get</a></li> </ul> </dd> </dl> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>parameters</code></td> <td class="type"> <span class="param-type"><code>Object</code></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"> Parameters to use <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>accountUserId</code></td> <td class="type"> <span class="param-type"><code>Integer</code></span> </td> <td class="description last"> Filter for account users </td> </tr> </tbody> </table> </td> </tr> </tbody> </table> <div class="section-returns"> <h5>Returns:</h5> <dl class="param-type"> <dt> Type: </dt> <dd> <span class="param-type"><code>Promise</code></span> </dd> </dl> </div> </div> <div class="section-method"> <h4 class="name" id=".module.exports.getSmartlockLogs"><span class="type-signature">(static) </span>module.exports.getSmartlockLogs<span class="signature">(smartlockId<span class="signature-attributes">opt</span>, parameters<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise}</span></h4> <div class="description"> Get a list of smartlock logs for all of your smartlocks </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="SmartlockLog.js.html">SmartlockLog.js</a>, <a href="SmartlockLog.js.html#line19">line 19</a> </li></ul></dd> <dt class="tag-see">See:</dt> <dd class="tag-see"> <ul> <li><a href="https://api.nuki.io/#!/SmartlockLog/get">https://api.nuki.io/#!/SmartlockLog/get</a></li> </ul> </dd> </dl> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>smartlockId</code></td> <td class="type"> <span class="param-type"><code>Integer</code></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"> The smartlock id </td> </tr> <tr> <td class="name"><code>parameters</code></td> <td class="type"> <span class="param-type"><code>Object</code></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"> Parameters to use <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>accountUserId</code></td> <td class="type"> <span class="param-type"><code>Integer</code></span> </td> <td class="description last"> Filter for account users </td> </tr> <tr> <td class="name"><code>fromDate</code></td> <td class="type"> <span class="param-type"><code>String</code></span> </td> <td class="description last"> Filter for start date (RFC3339) </td> </tr> <tr> <td class="name"><code>toDate</code></td> <td class="type"> <span class="param-type"><code>String</code></span> </td> <td class="description last"> Filter for end date (RFC3339) </td> </tr> <tr> <td class="name"><code>action</code></td> <td class="type"> <span class="param-type"><code>Integer</code></span> </td> <td class="description last"> Filter for action </td> </tr> <tr> <td class="name"><code>id</code></td> <td class="type"> <span class="param-type"><code>Integer</code></span> </td> <td class="description last"> Filter for older logs </td> </tr> <tr> <td class="name"><code>limit</code></td> <td class="type"> <span class="param-type"><code>Integer</code></span> </td> <td class="description last"> Filter for amount of logs </td> </tr> </tbody> </table> </td> </tr> </tbody> </table> <div class="section-returns"> <h5>Returns:</h5> <dl class="param-type"> <dt> Type: </dt> <dd> <span class="param-type"><code>Promise</code></span> </dd> </dl> </div> </div> <div class="section-method"> <h4 class="name" id=".module.exports.getSmartlocks"><span class="type-signature">(static) </span>module.exports.getSmartlocks<span class="signature">(parameters<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise}</span></h4> <div class="description"> This function returns a list of locks. </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Smartlock.js.html">Smartlock.js</a>, <a href="Smartlock.js.html#line14">line 14</a> </li></ul></dd> <dt class="tag-see">See:</dt> <dd class="tag-see"> <ul> <li><a href="https://api.nuki.io/#!/Smartlock/get">https://api.nuki.io/#!/Smartlock/get</a></li> </ul> </dd> </dl> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>parameters</code></td> <td class="type"> <span class="param-type"><code>Object</code></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"> Parameters to use <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>authId</code></td> <td class="type"> <span class="param-type"><code>Integer</code></span> </td> <td class="description last"> Filter for authId </td> </tr> <tr> <td class="name"><code>type</code></td> <td class="type"> <span class="param-type"><code>Integer</code></span> </td> <td class="description last"> Filter for type </td> </tr> </tbody> </table> </td> </tr> </tbody> </table> <div class="section-returns"> <h5>Returns:</h5> <dl class="param-type"> <dt> Type: </dt> <dd> <span class="param-type"><code>Promise</code></span> </dd> </dl> </div> </div> <div class="section-method"> <h4 class="name" id=".module.exports.getSmartlockUsers"><span class="type-signature">(static) </span>module.exports.getSmartlockUsers<span class="signature">(parameters<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise}</span></h4> <div class="description"> Synonym for getSmartlockAuths() </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="SmartlockAuth.js.html">SmartlockAuth.js</a>, <a href="SmartlockAuth.js.html#line38">line 38</a> </li></ul></dd> <dt class="tag-see">See:</dt> <dd class="tag-see"> <ul> <li>getSmartlockAuths()</li> </ul> </dd> </dl> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>parameters</code></td> <td class="type"> <span class="param-type"><code>Object</code></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"> Parameters to use <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>accountUserId</code></td> <td class="type"> <span class="param-type"><code>Integer</code></span> </td> <td class="description last"> Filter for account users </td> </tr> </tbody> </table> </td> </tr> </tbody> </table> <div class="section-returns"> <h5>Returns:</h5> <dl class="param-type"> <dt> Type: </dt> <dd> <span class="param-type"><code>Promise</code></span> </dd> </dl> </div> </div> <div class="section-method"> <h4 class="name" id=".module.exports.getSubscription"><span class="type-signature">(static) </span>module.exports.getSubscription<span class="signature">(subscriptionId<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise}</span></h4> <div class="description"> Get a list of subscriptions for all of your smartlocks </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Subscription.js.html">Subscription.js</a>, <a href="Subscription.js.html#line12">line 12</a> </li></ul></dd> <dt class="tag-see">See:</dt> <dd class="tag-see"> <ul> <li><a href="https://api.nuki.io/#!/Subscription">https://api.nuki.io/#!/Subscription</a></li> </ul> </dd> </dl> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>subscriptionId</code></td> <td class="type"> <span class="param-type"><code>Integer</code></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"> The subscription id </td> </tr> </tbody> </table> <div class="section-returns"> <h5>Returns:</h5> <dl class="param-type"> <dt> Type: </dt> <dd> <span class="param-type"><code>Promise</code></span> </dd> </dl> </div> </div> <div class="section-method"> <h4 class="name" id=".module.exports.setAction"><span class="type-signature">(static) </span>module.exports.setAction<span class="signature">(smartlockId, action)</span><span class="type-signature"> &rarr; {Promise}</span></h4> <div class="description"> This function applies an action on your smartolock, e.g. lock, unlock or unlatch. </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Smartlock.js.html">Smartlock.js</a>, <a href="Smartlock.js.html#line96">line 96</a> </li></ul></dd> <dt class="tag-see">See:</dt> <dd class="tag-see"> <ul> <li><a href="https://api.nuki.io/#!/Smartlock/post_0">https://api.nuki.io/#!/Smartlock/post_0</a></li> </ul> </dd> </dl> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>smartlockId</code></td> <td class="type"> <span class="param-type"><code>Integer</code></span> </td> <td class="description last"> The smartlock id </td> </tr> <tr> <td class="name"><code>action</code></td> <td class="type"> <span class="param-type"><code>Object</code></span> | <span class="param-type"><code>Integer</code></span> </td> <td class="description last"> Action to be applied, if {Object} is provided, the indizes command and option have to be supplied, otherwise {Integer} for a shortcut of action.command <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>command</code></td> <td class="type"> <span class="param-type"><code>Integer</code></span> </td> <td class="attributes"> </td> <td class="description last"> The action - 1: unlock, 2: lock, 3: unlatch, 4: lockngo, 5: lockngo with unlatch </td> </tr> <tr> <td class="name"><code>option</code></td> <td class="type"> <span class="param-type"><code>Integer</code></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"> The option mask: 0: none, 2: force, 4: full lock </td> </tr> </tbody> </table> </td> </tr> </tbody> </table> <div class="section-returns"> <h5>Returns:</h5> <dl class="param-type"> <dt> Type: </dt> <dd> <span class="param-type"><code>Promise</code></span> </dd> </dl> </div> </div> <div class="section-method"> <h4 class="name" id=".module.exports.updateSmartlock"><span class="type-signature">(static) </span>module.exports.updateSmartlock<span class="signature">(smartlockId, update)</span><span class="type-signature"> &rarr; {Promise}</span></h4> <div class="description"> This function updates a smartlock. </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Smartlock.js.html">Smartlock.js</a>, <a href="Smartlock.js.html#line63">line 63</a> </li></ul></dd> <dt class="tag-see">See:</dt> <dd class="tag-see"> <ul> <li><a href="https://api.nuki.io/#!/Smartlock/post">https://api.nuki.io/#!/Smartlock/post</a></li> </ul> </dd> </dl> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>smartlockId</code></td> <td class="type"> <span class="param-type"><code>Integer</code></span> </td> <td class="description last"> The smartlock id </td> </tr> <tr> <td class="name"><code>update</code></td> <td class="type"> <span class="param-type"><code>Object</code></span> | <span class="param-type"><code>Boolean</code></span> </td> <td class="description last"> Values to be updated, if {Object} is provided, either or both the indizes name and favorite have to be supplied, otherwise {Boolean} for a shortcut to favorite <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>name</code></td> <td class="type"> <span class="param-type"><code>String</code></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"> The new name of the smartlock </td> </tr> <tr> <td class="name"><code>favorite</code></td> <td class="type"> <span class="param-type"><code>Boolean</code></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"> True if the smartlock is favorite </td> </tr> </tbody> </table> </td> </tr> </tbody> </table> <div class="section-returns"> <h5>Returns:</h5> <dl class="param-type"> <dt> Type: </dt> <dd> <span class="param-type"><code>Promise</code></span> </dd> </dl> </div> </div> <div class="section-method"> <h4 class="name" id="_req"><span class="type-signature"></span>_req<span class="signature">(paths, parameters<span class="signature-attributes">opt</span>, method<span class="signature-attributes">opt</span>, body<span class="signature-attributes">opt</span>, options<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;Object>}</span></h4> <div class="description"> This function requests an action. </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Nuki.js.html">Nuki.js</a>, <a href="Nuki.js.html#line50">line 50</a> </li></ul></dd> </dl> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th>Default</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>paths</code></td> <td class="type"> <span class="param-type"><code>String</code></span> | <span class="param-type"><code>Array</code></span> </td> <td class="attributes"> </td> <td class="default"> </td> <td class="description last"> Paths to attach to URL </td> </tr> <tr> <td class="name"><code>parameters</code></td> <td class="type"> <span class="param-type"><code>Object</code></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> {} </td> <td class="description last"> Parameters to attach to URL ({key: value} turns to ?key=value respectively &key=value) </td> </tr> <tr> <td class="name"><code>method</code></td> <td class="type"> <span class="param-type"><code>String</code></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> GET </td> <td class="description last"> Method to use [GET, POST, PUT, DELETE] </td> </tr> <tr> <td class="name"><code>body</code></td> <td class="type"> <span class="param-type"><code>String</code></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> {} </td> <td class="description last"> Body data to send </td> </tr> <tr> <td class="name"><code>options</code></td> <td class="type"> <span class="param-type"><code>String</code></span> </td> <td class="attributes"> &lt;optional><br>