Skip to content

Commit

Permalink
Merge pull request #4 from Fitbit/jonb/versa
Browse files Browse the repository at this point in the history
Updated for Versa
  • Loading branch information
Frédéric Harper authored Mar 14, 2018
2 parents 4b5eb82 + 4cac44e commit df01396
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 11 deletions.
12 changes: 6 additions & 6 deletions app/index.js
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import document from "document";
import { Barometer } from "barometer";

console.log("Altimeter starting!");

// Fetch UI elements we will need to change
var altitudeLabel = document.getElementById("altitude");
var pressureLabel = document.getElementById("pressure");

// Initialize the UI with some values
altitudeLabel.innerText = "-";
altitudeLabel.text = "--";
pressureLabel.text = "--";

// Create a new instance of the Barometer
var bar = new Barometer();

bar.onreading = function() {
altitudeLabel.innerText = altitudeFromPressure(bar.pressure / 100) + " ft";
pressureLabel.innerText = Math.round(bar.pressure / 100) + " hPa";
// Update the lavel with each reading from the sensor
bar.onreading = () => {
altitudeLabel.text = altitudeFromPressure(bar.pressure / 100) + " ft";
pressureLabel.text = Math.round(bar.pressure / 100) + " hPa";
}

// Begin monitoring the sensor
Expand Down
13 changes: 12 additions & 1 deletion package.json
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@
"fitbit": {
"appType": "app",
"appDisplayName": "Altimeter",
"wipeColor": "#03a9f4"
"iconFile": "resources/icon.png",
"wipeColor": "#03a9f4",
"requestedPermissions": [],
"buildTargets": [
"higgs",
"meson"
],
"i18n": {
"en": {
"name": "Altimeter"
}
}
}
}
6 changes: 3 additions & 3 deletions resources/index.gui
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<svg>
<text id="altitude" x="50%" y="180" class="large-value">altitude</text>
<text id="pressure" x="50%" y="230" class="small-value">pressure</text>
</svg>
<text id="altitude" x="50%" y="72%" class="large-value">altitude</text>
<text id="pressure" x="50%" y="92%" class="small-value">pressure</text>
</svg>
Empty file modified resources/styles.css
100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion resources/widgets.gui
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
<defs>
<link rel="stylesheet" href="styles.css" />
</defs>
</svg>
</svg>

0 comments on commit df01396

Please sign in to comment.