Skip to content

Commit

Permalink
Update usage example and bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
codetheweb committed Jul 17, 2018
1 parent b9c7d1b commit 9b31d7c
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 316 deletions.
19 changes: 9 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,18 @@ const TuyaDevice = require('tuyapi');

let tuya = new TuyaDevice({
id: 'xxxxxxxxxxxxxxxxxxxx',
key: 'xxxxxxxxxxxxxxxx'});
key: 'xxxxxxxxxxxxxxxx',
ip: 'xxx.xxx.xxx.xxx'});

tuya.resolveIds().then(() => {
tuya.get().then(status => {
console.log('Status:', status);
tuya.get().then(status => {
console.log('Status:', status);

tuya.set({set: !status}).then(result => {
console.log('Result of setting status to ' + !status + ': ' + result);
tuya.set({set: !status}).then(result => {
console.log('Result of setting status to ' + !status + ': ' + result);

tuya.get().then(status => {
console.log('New status:', status);
return;
});
tuya.get().then(status => {
console.log('New status:', status);
return;
});
});
});
Expand Down
4 changes: 2 additions & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html>
<head>
<meta charset='utf-8' />
<title>tuyapi 2.0.3 | Documentation</title>
<title>tuyapi 3.0.0 | 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' />
Expand All @@ -14,7 +14,7 @@
<div id='split-left' class='overflow-auto fs0 height-viewport-100'>
<div class='py1 px2'>
<h3 class='mb0 no-anchor'>tuyapi</h3>
<div class='mb1'><code>2.0.3</code></div>
<div class='mb1'><code>3.0.0</code></div>
<input
placeholder='Filter'
id='filter-input'
Expand Down

0 comments on commit 9b31d7c

Please sign in to comment.