Skip to content

Commit

Permalink
First attempt at queue system
Browse files Browse the repository at this point in the history
  • Loading branch information
codetheweb committed Mar 21, 2019
1 parent 9c69003 commit cc36945
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 97 deletions.
136 changes: 42 additions & 94 deletions docs/index.html
Expand Up @@ -3,12 +3,12 @@
<head>
<meta charset='utf-8' />
<title>tuyapi 4.0.3 | Documentation</title>
<meta name='viewport' content='width=device-width,initial-scale=1'>
<link href='assets/bass.css' type='text/css' rel='stylesheet' />
<link href='assets/style.css' type='text/css' rel='stylesheet' />
<link href='assets/github.css' type='text/css' rel='stylesheet' />
<link href='assets/split.css' type='text/css' rel='stylesheet' />
<meta name='description' content='An easy-to-use API for devices that use Tuya&#39;s cloud services'>
<meta name='viewport' content='width=device-width,initial-scale=1'>
<link href='assets/bass.css' rel='stylesheet' />
<link href='assets/style.css' rel='stylesheet' />
<link href='assets/github.css' rel='stylesheet' />
<link href='assets/split.css' rel='stylesheet' />
</head>
<body class='documentation m0'>
<div class='flex'>
Expand Down Expand Up @@ -192,10 +192,7 @@ <h3 class='fl m0' id='tuyadevice'>
you're experiencing problems when only passing
one, try passing both if possible.</p>



<div class='pre p1 fill-light mt0'>new TuyaDevice(options: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a>)</div>



<p>
Expand Down Expand Up @@ -355,10 +352,7 @@ <h3 class='fl m0' id='tuyadevice'>
<p>Gets a device's current status.
Defaults to returning only the value of the first DPS index.</p>



<div class='pre p1 fill-light mt0'>get(options: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a>?): <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a>&#x3C;(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean">Boolean</a> | <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a>)></div>




Expand Down Expand Up @@ -456,6 +450,8 @@ <h3 class='fl m0' id='tuyadevice'>





</section>

</div>
Expand All @@ -475,10 +471,7 @@ <h3 class='fl m0' id='tuyadevice'>

<p>Sets a property on a device.</p>



<div class='pre p1 fill-light mt0'>set(options: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a>): <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a>&#x3C;<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean">Boolean</a>></div>




Expand Down Expand Up @@ -605,6 +598,8 @@ <h3 class='fl m0' id='tuyadevice'>





</section>

</div>
Expand All @@ -625,10 +620,7 @@ <h3 class='fl m0' id='tuyadevice'>
<p>Connects to the device. Can be called even
if device is already connected.</p>



<div class='pre p1 fill-light mt0'>connect(): <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a>&#x3C;<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean">Boolean</a>></div>




Expand Down Expand Up @@ -663,6 +655,8 @@ <h3 class='fl m0' id='tuyadevice'>





</section>

</div>
Expand All @@ -683,10 +677,7 @@ <h3 class='fl m0' id='tuyadevice'>
<p>Disconnects from the device, use to
close the socket and exit gracefully.</p>



<div class='pre p1 fill-light mt0'>disconnect()</div>




Expand All @@ -709,6 +700,8 @@ <h3 class='fl m0' id='tuyadevice'>








Expand All @@ -731,10 +724,7 @@ <h3 class='fl m0' id='tuyadevice'>

<p>Returns current connection status to device.</p>



<div class='pre p1 fill-light mt0'>isConnected(): <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean">Boolean</a></div>




Expand Down Expand Up @@ -772,6 +762,8 @@ <h3 class='fl m0' id='tuyadevice'>





</section>

</div>
Expand All @@ -790,10 +782,7 @@ <h3 class='fl m0' id='tuyadevice'>





<div class='pre p1 fill-light mt0'>resolveId(options: any)</div>




Expand Down Expand Up @@ -833,6 +822,8 @@ <h3 class='fl m0' id='tuyadevice'>





</section>

</div>
Expand All @@ -854,10 +845,7 @@ <h3 class='fl m0' id='tuyadevice'>
If you didn't pass an ID or IP to the constructor,
you must call this before anything else.</p>



<div class='pre p1 fill-light mt0'>find(options: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a>?): <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a>&#x3C;(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean">Boolean</a> | <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a>)></div>




Expand Down Expand Up @@ -947,6 +935,8 @@ <h3 class='fl m0' id='tuyadevice'>





</section>

</div>
Expand All @@ -966,10 +956,7 @@ <h3 class='fl m0' id='tuyadevice'>

<p>Toggles a boolean property.</p>



<div class='pre p1 fill-light mt0'>toggle(property: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">Number</a>): <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a>&#x3C;<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean">Boolean</a>></div>




Expand Down Expand Up @@ -1018,6 +1005,8 @@ <h3 class='fl m0' id='tuyadevice'>





</section>

</div>
Expand All @@ -1028,8 +1017,11 @@ <h3 class='fl m0' id='tuyadevice'>





</section>




<div class='keyline-top-not py2'>
Expand All @@ -1046,50 +1038,6 @@ <h2 id='events' class='mt0'>
</section>
</div>

<section class='p2 mb2 clearfix bg-white minishadow'>


<div class='clearfix'>

<h3 class='fl m0' id='events'>
Events
</h3>


</div>


<p>Events that TuyAPI emits.</p>




























</section>



<section class='p2 mb2 clearfix bg-white minishadow'>
Expand All @@ -1109,10 +1057,7 @@ <h3 class='fl m0' id='eventtuyadeviceerror'>
result of a connection timeout.
Also emitted on parsing errors.</p>



<div class='pre p1 fill-light mt0'>TuyaDevice#error</div>




Expand Down Expand Up @@ -1150,8 +1095,11 @@ <h3 class='fl m0' id='eventtuyadeviceerror'>





</section>




<section class='p2 mb2 clearfix bg-white minishadow'>
Expand All @@ -1169,10 +1117,7 @@ <h3 class='fl m0' id='eventtuyadevicedata'>

<p>Emitted when data is returned from device.</p>



<div class='pre p1 fill-light mt0'>TuyaDevice#data</div>




Expand Down Expand Up @@ -1218,8 +1163,11 @@ <h3 class='fl m0' id='eventtuyadevicedata'>





</section>




<section class='p2 mb2 clearfix bg-white minishadow'>
Expand All @@ -1241,10 +1189,7 @@ <h3 class='fl m0' id='eventtuyadevicedisconnected'>
at the same time if, for example, the device
goes off the network.</p>



<div class='pre p1 fill-light mt0'>TuyaDevice#disconnected</div>




Expand All @@ -1267,11 +1212,14 @@ <h3 class='fl m0' id='eventtuyadevicedisconnected'>








</section>




<section class='p2 mb2 clearfix bg-white minishadow'>
Expand All @@ -1293,10 +1241,7 @@ <h3 class='fl m0' id='eventtuyadeviceconnected'>
so don't use this as a trigger for your
initialization code.</p>



<div class='pre p1 fill-light mt0'>TuyaDevice#connected</div>




Expand All @@ -1319,11 +1264,14 @@ <h3 class='fl m0' id='eventtuyadeviceconnected'>








</section>




<section class='p2 mb2 clearfix bg-white minishadow'>
Expand All @@ -1342,10 +1290,7 @@ <h3 class='fl m0' id='parse'>
<p>Static wrapper for lower-level MessageParser
functions to easily parse packets.</p>



<div class='pre p1 fill-light mt0'>parse(data: <a href="https://nodejs.org/api/buffer.html">Buffer</a>): <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></div>




Expand Down Expand Up @@ -1405,8 +1350,11 @@ <h3 class='fl m0' id='parse'>





</section>




<section class='p2 mb2 clearfix bg-white minishadow'>
Expand All @@ -1425,10 +1373,7 @@ <h3 class='fl m0' id='encode'>
<p>Static wrapper for lower-level MessageParser
functions to easily encode packets</p>



<div class='pre p1 fill-light mt0'>encode(options: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a>): <a href="https://nodejs.org/api/buffer.html">Buffer</a></div>




Expand Down Expand Up @@ -1509,8 +1454,11 @@ <h3 class='fl m0' id='encode'>





</section>



</div>
</div>
Expand Down

0 comments on commit cc36945

Please sign in to comment.