Skip to content

Commit

Permalink
Upgraded to Fitbit SDK 5.0, added Fitbit Versa 3 and Fitbit Sense com…
Browse files Browse the repository at this point in the history
…patibility and removed Fibit Ionic, Fitbit Versa, Fitbit Versa Lite and Fitbit Versa 2 compatibility. Source code cleaned.
  • Loading branch information
fxmauricard committed Jun 3, 2022
1 parent 3d354d3 commit 726cf5f
Show file tree
Hide file tree
Showing 16 changed files with 428 additions and 330 deletions.
16 changes: 12 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
**Version 2.7.0** - _03/Jun/2022_
**Version 3.0.0** - _04/Jun/2022_
- Upgraded to Fitbit SDK 5.0.
- Added Fitbit Versa 3 and Fitbit Sense compatibility.
- Removed Fibit Ionic, Fitbit Versa, Fitbit Versa Lite and Fitbit Versa 2 compatibility.

*/!\ UI not well compatible with Fitbit Versa 3 and Fitbit Sense!*

* * *

**Version 2.7.0*** - _03/Jun/2022_
- Upgraded to Fitbit SDK 4.3.
- Added Fitbit SDK CLI tools support.
- Added Fitbit Versa Lite and Fitbit Versa 2 compatibility.
- Added Fitbit Versa Lite and Fitbit Versa 2 support.;

* * *
* * *

**Version 2.6.1** - _12/Jul/2018_
- Minor optimization and stability fixes.
Expand Down
Binary file removed Poupinounours-Clock-screenshot-Ionic.png
Binary file not shown.
Binary file added Poupinounours-Clock-screenshot-Sense.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed Poupinounours-Clock-screenshot-Versa.png
Binary file not shown.
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
# Fitbit "Poupinounours' Clock"
Customized Fitbit OS 4.0 Clock Face compatible with Fitbit Ionic, Fitbit Versa, Fitbit Versa Lite and Fitbit Versa 2.
Customized Fitbit OS 5.0 Clock Face compatible with Fitbit Versa 3 and Fitbit Sense.

Download it here : https://gam.fitbit.com/gallery/clock/8aca1974-9714-4753-86a0-60fbc156c502

**Screenshot on Fitbit Ionic**<br>
![Screenshot of the Clock Face on Fitbit Ionic](https://github.com/fxmauricard/fitbit-poupinounours-clock/blob/master/Poupinounours-Clock-screenshot-Ionic.png)

**Screenshot on Fitbit Versa*, Fitbit Versa Lite and Fitbit Versa 2*<br>
![Screenshot of the Clock Face on Fitbit Versa, Fitbit Versa Lite and Fitbit Versa 2](https://github.com/fxmauricard/fitbit-poupinounours-clock/blob/master/Poupinounours-Clock-screenshot-Versa.png)
**Screenshot on Fitbit Versa 3 and Fitbit Sense**<br>
![Screenshot of the Clock Face on Fitbit Ionic](https://github.com/fxmauricard/fitbit-poupinounours-clock/blob/master/Poupinounours-Clock-screenshot-Sense.png)
3 changes: 2 additions & 1 deletion app/activity.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import document from "document";
import { goals, today } from "user-activity";
import { me as device } from "device";
import * as util from "../common/utils";

// Get a handle on the <text>, <image> and <rect> elements.
Expand Down Expand Up @@ -31,7 +32,7 @@ export function update() {

// Update the <rect> element with the goal progress.
const goalPercent = Math.min(100, Math.round(today.adjusted[leftActivity] / goals[leftActivity] * 100));
goalProgressBar.width = Math.round(util.getDevice().screen.width * goalPercent / 100);
goalProgressBar.width = Math.round(device.screen.width * goalPercent / 100);
}

function updateActivity(position, activity) {
Expand Down
2 changes: 1 addition & 1 deletion app/date.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const monthLabels = {

export function update(todayDate) {
const fullYear = todayDate.getFullYear();
const year = (util.isIonic()) ? fullYear : fullYear.toString().substr(-2);
const year = fullYear.toString().substr(-2);

// Update the <text> element with the date.
dateLabel.text = (dayLabels[locale.language][todayDate.getDay()] + ' ' + todayDate.getDate() + ' ' + monthLabels[locale.language][todayDate.getMonth()] + ' ' + year).toUpperCase();
Expand Down
14 changes: 0 additions & 14 deletions common/utils.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
import { me as device } from "device";

// Workaround for Fitbit Ionic running Fitbit OS 1.0.
if (!device.screen) device.screen = { width: 348, height: 250 };

const monospacedChar0 = String.fromCharCode(0x10);
const monospacedChar1 = String.fromCharCode(0x11);
const monospacedChar2 = String.fromCharCode(0x12);
Expand Down Expand Up @@ -76,12 +71,3 @@ function monoDigit(digit) {
return digit;
}
}

// Get "device" object with the Fitbit OS 1.0 Workaround applied.
export function getDevice() {
return device;
}
// Is the app running on Fitbit Ionic?
export function isIonic() {
return (device.screen.width === 348);
}
Loading

0 comments on commit 726cf5f

Please sign in to comment.