diff --git a/app/index.js b/app/index.js old mode 100755 new mode 100644 index dd75ab3..1b8ed87 --- a/app/index.js +++ b/app/index.js @@ -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 diff --git a/package.json b/package.json old mode 100755 new mode 100644 index 8593459..57b9a00 --- a/package.json +++ b/package.json @@ -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" + } + } } } \ No newline at end of file diff --git a/resources/index.gui b/resources/index.gui old mode 100755 new mode 100644 index 267cb24..6f3cfdf --- a/resources/index.gui +++ b/resources/index.gui @@ -1,4 +1,4 @@ - altitude - pressure - \ No newline at end of file + altitude + pressure + diff --git a/resources/styles.css b/resources/styles.css old mode 100755 new mode 100644 diff --git a/resources/widgets.gui b/resources/widgets.gui old mode 100755 new mode 100644 index fe8312a..d6fba01 --- a/resources/widgets.gui +++ b/resources/widgets.gui @@ -2,4 +2,4 @@ - \ No newline at end of file +