forked from dvmarinoff/Auuki
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
62 lines (51 loc) · 1.68 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import { xf } from './xf.js';
import { db } from './db.js';
import { Controllable } from './ble/controllable.js';
import { PowerMeter } from './ble/power-meter.js';
import { Hrb } from './ble/hrb.js';
import { Watch } from './watch.js';
import { WakeLock } from './lock.js';
import { Views } from './views.js';
import { ant, AntHrm, AntFec } from './ant/ant.js';
import { DeviceController,
FileController,
WorkoutController } from './controllers.js';
import { FileHandler } from './file.js';
import { Vibrate } from './vibrate.js';
import { DataMock } from './test/mock.js';
'use strict';
function startServiceWroker() {
if('serviceWorker' in navigator) {
navigator.serviceWorker.register('./sw.js')
.then(reg => {
console.log(`SW: register success: ${reg}`);
})
.catch(err => {
console.log(`SW: register error: ${err}`);
});
};
}
async function start() {
const hrb = new Hrb({name: 'hrb'});
const flux = new Controllable({name: 'controllable'});
const pm = new PowerMeter({name: 'pm'});
const antHrm = new AntHrm({});
const antFec = new AntFec({});
let watch = new Watch();
let lock = new WakeLock();
Views();
FileController();
WorkoutController();
DeviceController({controllable: flux,
powerMeter: pm,
watch: watch,
hrb: hrb,
antHrm: antHrm,
antFec: antFec,
});
xf.dispatch('app:start');
Vibrate({turnOn: true});
// DataMock({hr: true, pwr: true});
};
// startServiceWroker();
start();