Skip to content

Commit

Permalink
initial release
Browse files Browse the repository at this point in the history
initial release
  • Loading branch information
slametps committed Sep 20, 2020
1 parent be41062 commit 562eb7b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Tuya-based-devices Smarthome Module for MagicMirror<sup>2</sup>. By default, thi
{
module: 'MMM-TuyaSL',
position: 'top_right',
header: 'TuyaSL',
header: 'TuyaSL',
config: {
userName: 'your_smartlife_username',
password: 'your_smartlife_password',
Expand Down
5 changes: 2 additions & 3 deletions node_helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,15 +187,14 @@ module.exports = NodeHelper.create({
try {
function myDeviceItem(value, index, array) {
deviceOnline = value.data.online;
//deviceOnline = (value.data.online === "false" ? false : value.data.online);
deviceState = (value.data.state == "true" ? true : (value.data.state == "false" ? false : value.data.state));
arrDevicesItem = {alias:value.name, type:value.dev_type, online:deviceOnline, on_off:deviceState};
arrDevices.push(arrDevicesItem);
}

res.data.payload.devices.forEach(myDeviceItem);
console.log(`DEBUG: Number of Devices = ${arrDevices.length}`);
console.log(`DEBUG: Device-List ${that.dump(arrDevices)}`);
//console.log(`DEBUG: Number of Devices = ${arrDevices.length}`);
//console.log(`DEBUG: Device-List ${that.dump(arrDevices)}`);
}
catch (e) {
console.log('ERROR: ' + e.stack);
Expand Down

0 comments on commit 562eb7b

Please sign in to comment.