Skip to content

Added background functionality#3

Open
MadalinaKhaji wants to merge 6 commits intoWappsto:masterfrom
MadalinaKhaji:background-functionality
Open

Added background functionality#3
MadalinaKhaji wants to merge 6 commits intoWappsto:masterfrom
MadalinaKhaji:background-functionality

Conversation

@MadalinaKhaji
Copy link
Copy Markdown
Contributor

No description provided.

Comment thread smart-home-sensors/background/main.js Outdated
.find({ type: "Report" })
.get("data");

let CO2_value = sensors.find({ name: "CO2" });
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

either you use const or change it to a small letter

Comment thread smart-home-sensors/background/main.js Outdated
panel.save(
{
data:
+Number(temp_data).toFixed(2) +
Copy link
Copy Markdown
Contributor

@mareklap mareklap Feb 12, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the end it will be converted to a string anyway since you're concatenating. You could maybe use ${...} (string interpolation).

<head>
<meta charset="utf-8">
<meta charset="utf-8" />
<title></title>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Provide some title.

Comment thread smart-home-sensors/background/main.js Outdated
@@ -0,0 +1,176 @@
let Wappsto = require("wapp-api");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use const

Comment thread smart-home-sensors/background/main.js Outdated
@@ -0,0 +1,176 @@
let Wappsto = require("wapp-api");

let wappsto = new Wappsto();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use const

Comment thread smart-home-sensors/background/main.js Outdated

let wappsto = new Wappsto();

let wappstoConsole = require("wapp-api/console");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use const or require("wapp-api/console").start()

Comment thread smart-home-sensors/background/main.js Outdated
subscribe: true
}
)
.then(function(collection) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could rewrite to the following form:
.then(collection) => {
...
}

Comment thread smart-home-sensors/background/main.js Outdated

let device, sensors, led, data;

wappsto
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you could try to use async/await

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants