Skip to content

Commit

Permalink
SDK5 support (#18)
Browse files Browse the repository at this point in the history
* Added SDK5 support

* Updated workflows

Co-authored-by: smirko-dev <smirko@arcor.de>
  • Loading branch information
smirko-dev and smirko-dev authored Oct 16, 2021
1 parent 53fcf21 commit 9f18cba
Show file tree
Hide file tree
Showing 17 changed files with 190 additions and 30 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/CodeQL.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ name: "CodeQL"

on:
push:
branches: [ main ]
branches: [ master ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ main ]
branches: [ master ]
schedule:
- cron: '41 16 * * 4'

Expand Down
43 changes: 39 additions & 4 deletions .github/workflows/FitbitBuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ name: FitbitBuild

on:
push:
branches: [ main ]
branches: [ master ]
pull_request:
branches: [ main ]
branches: [ master ]
workflow_dispatch:

jobs:
build:
name: Build
build-sdk4:
name: Build SDK4
runs-on: ubuntu-latest

steps:
Expand All @@ -24,6 +24,41 @@ jobs:
- name: Setup node
uses: actions/setup-node@v1

- name: Select SDK 4
run: cp package.sdk4.json package.json

- name: Checkout Fitbit SDK
run: npm add --also=dev @fitbit/sdk

- name: Checkout Fitbit SDK-CLI
run: npm add --also=dev @fitbit/sdk-cli

- name: Run Build
run: npx fitbit-build --if-present

- name: Upload artifact
uses: actions/upload-artifact@v2
if: ${{ success() }}
with:
path: build/app.fba
if-no-files-found: error

build-sdk5:
name: Build SDK5
runs-on: ubuntu-latest

steps:
- name: Checkout branch
uses: actions/checkout@v2
with:
lfs: true

- name: Setup node
uses: actions/setup-node@v1

- name: Select SDK 5
run: cp package.sdk5.json package.json

- name: Checkout Fitbit SDK
run: npm add --also=dev @fitbit/sdk

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
/node_modules
/build
/package-lock.json
/package.json
24 changes: 13 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

[![](https://img.shields.io/badge/Fitbit%20App%20Gallery-%2300B0B9?style=flat&logo=fitbit&logoColor=white)](https://gallery.fitbit.com/details/ae441b73-2660-407f-b796-a98d1d0583a0)
![languages](https://img.shields.io/badge/languages-JavaScript%20|%20CSS-blue)
![platform](https://img.shields.io/badge/platforms-Ionic%20|%20Versa%20|%20Versa%202%20|%20Versa%20Lite-silver)
![version](https://img.shields.io/badge/version-%201.5.1-green)
![platform](https://img.shields.io/badge/platforms-Ionic%20|%20Versa%20|%20Versa%202%20|%20Versa%20Lite%20|%20Versa%203%20|%20Sense-silver)
![version](https://img.shields.io/badge/version-%201.5.2-green)
[![](https://img.shields.io/github/license/smirko-dev/fitbit-clockface.svg)](https://github.com/smirko-dev/fitbit-clockface/blob/master/LICENSE)
[![FitbitBuild Actions Status](https://github.com/smirko-dev/fitbit-clockface/workflows/FitbitBuild/badge.svg)](https://github.com/smirko-dev/fitbit-clockface/actions)
[![CodeQL Actions Status](https://github.com/smirko-dev/fitbit-clockface/workflows/CodeQL/badge.svg)](https://github.com/smirko-dev/fitbit-clockface/actions)
Expand All @@ -28,20 +28,22 @@ Icons are from https://materialdesignicons.com/ ([Apache license version 2.0](ht

## Screenshots

### Fitbit Ionic
![Activity](screenshots/activity.png) ![Event](screenshots/event.png)

![Ionic Appointment](screenshots/ionic-event.png) ![Ionic Activity](screenshots/ionic-activity.png)

### Fitbit Versa

![Versa 2 Appointment](screenshots/versa2-event.png) ![Versa 2 Activity](screenshots/versa2-activity.png)
## How to build

### Settings
Choose SDK version

![Settings](screenshots/settings.png) ![Activities](screenshots/activities.png)
| SDK | Device |
|-----|-----------------------------------|
| 4 | Versa, Versa Lite, Versa 2, Ionic |
| 5 | Versa 3, Sense |

## How to build
```
cp package.sdkX.json package.json
```

Run Fitbit CLI build
```
git clone git@github.com:smirko-dev/fitbit-clockface.git
cd fitbit-clockface
Expand Down
File renamed without changes.
45 changes: 45 additions & 0 deletions package.sdk5.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"name": "compactclock",
"version": "1.5.2",
"license": "MIT",
"devDependencies": {
"@fitbit/sdk": "~5.0.0",
"@fitbit/sdk-cli": "^1.7.3"
},
"bugs": {
"url": "https://github.com/smirko-dev/fitbit-clockface/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/smirko-dev/fitbit-clockface.git"
},
"fitbit": {
"appUUID": "ae441b73-2660-407f-b796-a98d1d0583a0",
"appType": "clockface",
"appDisplayName": "CompactClock",
"iconFile": "resources/icon.png",
"wipeColor": "",
"requestedPermissions": [
"access_calendar",
"run_background",
"access_activity"
],
"buildTargets": [
"atlas",
"vulcan"
],
"i18n": {
"en-US": {
"name": "CompactClock"
},
"de-DE": {
"name": "CompactClock"
}
},
"defaultLanguage": "en-US"
},
"scripts": {
"build": "fitbit-build",
"debug": "fitbit"
}
}
10 changes: 10 additions & 0 deletions resources/index.view
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<svg class="background">
<text id="hourLabel" />
<text id="minuteLabel" />
<text id="dateLabel" opacity=".8" />
<textarea id="appointmentsLabel" opacity=".8" pointer-events="visible" />
<image id="batteryImage" href="battery-alert.png" x="270" y="4%" width="24" height="24" opacity=".6" class="batteryIcon" />
<text id="batteryLabel" opacity=".8" />
<image id="activityIcon" href="steps.png" x="35%" y="80%" width="32" height="32" opacity=".8" class="activityIcon" />
<text id="activityLabel" opacity=".8" />
</svg>
File renamed without changes.
72 changes: 72 additions & 0 deletions resources/styles.sdk5.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
.background {
viewport-fill: black;
}

#hourLabel {
font-size: 148;
font-family: Colfax-Thin;
text-length: 32;
text-anchor: end;
x: 60%;
y: 55%+20;
fill: #2490DD;
}

#minuteLabel {
font-size: 96;
font-family: Colfax-Thin;
text-length: 32;
text-anchor: start;
x: 60%;
y: 55%+20;
fill: white;
}

#dateLabel {
font-size: 20;
font-family: Colfax-Regular;
text-length: 32;
text-anchor: start;
x: 12%;
y: 10%;
fill: white;
}

#appointmentsLabel {
font-size: 28;
font-family: Colfax-Regular;
text-length: 128;
text-anchor: start;
x: 12%;
y: 75%;
width: 90%;
fill: white;
}

#batteryLabel {
font-size: 20;
font-family: Colfax-Regular;
text-length: 32;
text-anchor: start;
x: 85%;
y: 10%;
fill: white;
}

#activityLabel {
font-size: 28;
font-family: Colfax-Regular;
text-length: 32;
text-anchor: start;
x: 35%+30;
y: 80%+25;
fill: white;
}

.activityIcon {
fill: #2490DD
}

.batteryIcon {
fill: #FFFFFF
}
7 changes: 7 additions & 0 deletions resources/widget.defs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<svg>
<defs>
<link rel="stylesheet" href="styles.sdk5.css" />
<link rel="import" href="/mnt/sysassets/system_widget.defs" />
<link rel="import" href="/mnt/sysassets/widgets/baseview_widget.defs" />
</defs>
</svg>
2 changes: 1 addition & 1 deletion resources/widgets.gui
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<svg>
<defs>
<link rel="stylesheet" href="styles.css" />
<link rel="stylesheet" href="styles.sdk4.css" />
<link rel="import" href="/mnt/sysassets/widgets_common.gui" />
<link rel="stylesheet" href="/mnt/sysassets/widgets/dynamic_textarea.css"/>
<link rel="import" href="/mnt/sysassets/widgets/dynamic_textarea.gui"/>
Expand Down
3 changes: 0 additions & 3 deletions screenshots/activities.png

This file was deleted.

File renamed without changes
File renamed without changes
3 changes: 0 additions & 3 deletions screenshots/ionic-activity.png

This file was deleted.

3 changes: 0 additions & 3 deletions screenshots/ionic-event.png

This file was deleted.

3 changes: 0 additions & 3 deletions screenshots/settings.png

This file was deleted.

0 comments on commit 9f18cba

Please sign in to comment.