Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
32feab4483 | ||
|
|
8c3305685f | ||
|
|
8dccc528ba | ||
|
|
5167ecd8b4 | ||
|
|
2a620d7bb8 | ||
|
|
82a6eff1c5 |
@@ -3,6 +3,7 @@
|
|||||||
Watchface with simple and useful design without any diverting factors
|
Watchface with simple and useful design without any diverting factors
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
- AOD (Always on display)
|
||||||
- Heartbeat
|
- Heartbeat
|
||||||
- Date with current month and day
|
- Date with current month and day
|
||||||
- Clocks with hours, minutes and **seconds**
|
- Clocks with hours, minutes and **seconds**
|
||||||
@@ -11,6 +12,6 @@ Watchface with simple and useful design without any diverting factors
|
|||||||
|
|
||||||
## How it looks like
|
## How it looks like
|
||||||
|
|
||||||

|

|
||||||
<img src="https://github.com/user-attachments/assets/9158e9f6-2234-40ca-b5cf-727f86ff8767" height=200>
|
<img src="https://github.com/user-attachments/assets/9158e9f6-2234-40ca-b5cf-727f86ff8767" height=200>
|
||||||
<img src="https://github.com/user-attachments/assets/2c77cb6f-9639-4c7f-8ef2-38d1e17ae81b" height=200>
|
<img src="https://github.com/user-attachments/assets/2c77cb6f-9639-4c7f-8ef2-38d1e17ae81b" height=200>
|
||||||
|
|||||||
4
app.json
4
app.json
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"configVersion": "v2",
|
"configVersion": "v2",
|
||||||
"app": {
|
"app": {
|
||||||
"appId": 24808,
|
"appId": 1065764,
|
||||||
"appName": "VHS Watch",
|
"appName": "VHS Watch",
|
||||||
"appType": "watchface",
|
"appType": "watchface",
|
||||||
"version": {
|
"version": {
|
||||||
"code": 1,
|
"code": 1,
|
||||||
"name": "1.0.4"
|
"name": "1.0.6"
|
||||||
},
|
},
|
||||||
"icon": "icon.png",
|
"icon": "icon.png",
|
||||||
"vender": "zepp",
|
"vender": "zepp",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "vhs-watch",
|
"name": "vhs-watch",
|
||||||
"version": "1.0.4",
|
"version": "1.0.6",
|
||||||
"description": "vhs watch for Zepp OS 3.0 (GTS 4)",
|
"description": "vhs watch for Zepp OS 3.0 (GTS 4)",
|
||||||
"main": "app.js",
|
"main": "app.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -1,36 +1,24 @@
|
|||||||
import { getScene, SCENE_AOD } from '@zos/app'
|
import { getScene, SCENE_AOD } from '@zos/app'
|
||||||
import * as hmSensor from '@zos/sensor'
|
|
||||||
import * as hmUI from '@zos/ui'
|
import * as hmUI from '@zos/ui'
|
||||||
import fontArray from '../fontData/secondaryFont'
|
import fontArray from '../fontData/secondaryFont'
|
||||||
|
|
||||||
let batteryWg;
|
|
||||||
const moduleX = 310
|
const moduleX = 310
|
||||||
const moduleY = 10
|
const moduleY = 10
|
||||||
export default function () {
|
export default function () {
|
||||||
console.log("[modules]: battery module init")
|
console.log("[modules]: battery module init")
|
||||||
let battery = new hmSensor.Battery()
|
if (getScene() != SCENE_AOD) {
|
||||||
updateBatteryWidget(battery.getCurrent())
|
|
||||||
battery.onChange(() => updateBatteryWidget(battery.getCurrent()))
|
|
||||||
if (getScene() != SCENE_AOD)
|
|
||||||
hmUI.createWidget(hmUI.widget.IMG, {
|
hmUI.createWidget(hmUI.widget.IMG, {
|
||||||
x: moduleX,
|
x: moduleX,
|
||||||
y: moduleY,
|
y: moduleY,
|
||||||
src: 'date/perc.PNG'
|
src: 'date/perc.PNG'
|
||||||
})
|
})
|
||||||
}
|
hmUI.createWidget(hmUI.widget.TEXT_IMG, {
|
||||||
function updateBatteryWidget(batteryPercentage) {
|
|
||||||
if (batteryWg)
|
|
||||||
hmUI.deleteWidget(batteryWg)
|
|
||||||
|
|
||||||
if (getScene() != SCENE_AOD) {
|
|
||||||
batteryWg = hmUI.createWidget(hmUI.widget.TEXT_IMG, {
|
|
||||||
x: moduleX - 85,
|
x: moduleX - 85,
|
||||||
y: moduleY,
|
y: moduleY,
|
||||||
type: hmUI.data_type.BATTERY,
|
|
||||||
font_array: fontArray,
|
font_array: fontArray,
|
||||||
h_space: 1,
|
h_space: 1,
|
||||||
align_h: hmUI.align.RIGHT,
|
align_h: hmUI.align.RIGHT,
|
||||||
text: batteryPercentage
|
type: hmUI.data_type.BATTERY
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import * as hmUI from '@zos/ui'
|
import * as hmUI from '@zos/ui'
|
||||||
import fontArray from '../fontData/secondaryFont'
|
import fontArray from '../fontData/secondaryFont'
|
||||||
const moduleX = 50
|
const moduleX = 225
|
||||||
const moduleY = 10
|
const moduleY = 50
|
||||||
|
|
||||||
export default function () {
|
export default function () {
|
||||||
console.log("[modules]: date module init")
|
console.log("[modules]: date module init")
|
||||||
|
|||||||
@@ -1,41 +1,24 @@
|
|||||||
import { getScene, SCENE_AOD } from '@zos/app'
|
import { getScene, SCENE_AOD } from '@zos/app'
|
||||||
import * as hmSensor from '@zos/sensor'
|
|
||||||
import * as hmUI from '@zos/ui';
|
import * as hmUI from '@zos/ui';
|
||||||
import secondaryFont from '../fontData/secondaryFont';
|
import secondaryFont from '../fontData/secondaryFont';
|
||||||
|
|
||||||
let distWg;
|
|
||||||
const moduleX = 50
|
const moduleX = 50
|
||||||
const moduleY = 405
|
const moduleY = 405
|
||||||
export default function () {
|
export default function () {
|
||||||
console.log("[modules]: distance module init")
|
console.log("[modules]: distance module init")
|
||||||
let distance = new hmSensor.Distance();
|
|
||||||
updateDistance(distance.getCurrent())
|
|
||||||
distance.onChange(() => updateDistance(distance.getCurrent()))
|
|
||||||
if (getScene() != SCENE_AOD) {
|
if (getScene() != SCENE_AOD) {
|
||||||
hmUI.createWidget(hmUI.widget.IMG, {
|
hmUI.createWidget(hmUI.widget.IMG, {
|
||||||
x: moduleX,
|
x: moduleX,
|
||||||
y: moduleY,
|
y: moduleY,
|
||||||
src: 'misc/dist.PNG'
|
src: 'misc/dist.PNG'
|
||||||
})
|
})
|
||||||
}
|
hmUI.createWidget(hmUI.widget.TEXT_IMG, {
|
||||||
}
|
|
||||||
|
|
||||||
function updateDistance(dist) {
|
|
||||||
if (!dist)
|
|
||||||
dist = 0
|
|
||||||
|
|
||||||
if (distWg)
|
|
||||||
hmUI.deleteWidget(distWg)
|
|
||||||
|
|
||||||
if (getScene() != SCENE_AOD) {
|
|
||||||
distWg = hmUI.createWidget(hmUI.widget.TEXT_IMG, {
|
|
||||||
x: moduleX + 150,
|
x: moduleX + 150,
|
||||||
y: moduleY,
|
y: moduleY,
|
||||||
type: hmUI.data_type.DISTANCE,
|
|
||||||
font_array: secondaryFont,
|
font_array: secondaryFont,
|
||||||
h_space: 1,
|
h_space: 1,
|
||||||
align_h: hmUI.align.LEFT,
|
align_h: hmUI.align.LEFT,
|
||||||
text: dist
|
type: hmUI.data_type.DISTANCE
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,39 +1,22 @@
|
|||||||
import { getScene, SCENE_AOD } from '@zos/app'
|
import { getScene, SCENE_AOD } from '@zos/app'
|
||||||
import * as hmSensor from '@zos/sensor'
|
|
||||||
import * as hmUI from '@zos/ui';
|
import * as hmUI from '@zos/ui';
|
||||||
import secondaryFont from '../fontData/secondaryFont';
|
import secondaryFont from '../fontData/secondaryFont';
|
||||||
|
|
||||||
let heartRateWg;
|
|
||||||
export default function () {
|
export default function () {
|
||||||
console.log("[modules]: heartrate module init")
|
console.log("[modules]: heartrate module init")
|
||||||
if (getScene() != SCENE_AOD) {
|
if (getScene() != SCENE_AOD) {
|
||||||
let heart = new hmSensor.HeartRate();
|
|
||||||
updateHeartWidget(heart.getLast())
|
|
||||||
heart.onCurrentChange(() => updateHeartWidget(heart.getCurrent()))
|
|
||||||
hmUI.createWidget(hmUI.widget.IMG, {
|
hmUI.createWidget(hmUI.widget.IMG, {
|
||||||
x: 10,
|
x: 10,
|
||||||
y: 365,
|
y: 365,
|
||||||
src: 'misc/hb.PNG'
|
src: 'misc/hb.PNG'
|
||||||
})
|
})
|
||||||
}
|
hmUI.createWidget(hmUI.widget.TEXT_IMG, {
|
||||||
}
|
|
||||||
|
|
||||||
function updateHeartWidget(hbpm) {
|
|
||||||
if (!hbpm) {
|
|
||||||
hbpm = 0
|
|
||||||
}
|
|
||||||
if (heartRateWg) {
|
|
||||||
hmUI.deleteWidget(heartRateWg)
|
|
||||||
}
|
|
||||||
if (getScene() != SCENE_AOD) {
|
|
||||||
heartRateWg = hmUI.createWidget(hmUI.widget.TEXT_IMG, {
|
|
||||||
x: 100,
|
x: 100,
|
||||||
y: 365,
|
y: 365,
|
||||||
type: hmUI.data_type.BATTERY,
|
|
||||||
font_array: secondaryFont,
|
font_array: secondaryFont,
|
||||||
h_space: 1,
|
h_space: 1,
|
||||||
align_h: hmUI.align.LEFT,
|
align_h: hmUI.align.LEFT,
|
||||||
text: hbpm
|
type: hmUI.data_type.HEART
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user