1
0
Fork 0

Merge pull request #1258 from BartokW/master

Adding GadgetBridge weather to the LCARS watchface
master
Gordon Williams 2022-01-11 09:06:16 +00:00 committed by GitHub
commit 6371477c4e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 6 deletions

View File

@ -4498,7 +4498,7 @@
"name": "LCARS Clock",
"shortName":"LCARS",
"icon": "lcars.png",
"version":"0.09",
"version":"0.11",
"readme": "README.md",
"supports": ["BANGLEJS2"],
"description": "Library Computer Access Retrieval System (LCARS) clock.",

View File

@ -6,4 +6,5 @@
0.06: Fix - Alarm disabled, if clock was closed.
0.07: Added settings to adjust data that is shown for each row.
0.08: Support for multiple screens. 24h graph for steps + HRM. Fullscreen Mode.
0.09: Tab anywhere to open the launcher.
0.09: Tab anywhere to open the launcher.
0.11: Added getting the gadgetbridge weather

View File

@ -1,5 +1,6 @@
const SETTINGS_FILE = "lcars.setting.json";
const Storage = require("Storage");
const weather = require('weather');
// ...and overwrite them with any saved values
@ -145,6 +146,14 @@ function printData(key, y, c){
text = "VREF";
value = E.getAnalogVRef().toFixed(2) + "V";
} else if (key == "Weather"){
text = "TEMP";
const w = weather.get();
if (!w) {
value = "ERR";
} else {
value = require('locale').temp(w.temp-273.15); // applies conversion
}
}
g.setColor(c);

View File

@ -18,14 +18,14 @@
storage.write(SETTINGS_FILE, settings)
}
var data_options = ["Battery", "Steps", "Temp.", "HRM", "VREF"];
var data_options = ["Battery", "Steps", "Temp.", "HRM", "VREF", "Weather"];
E.showMenu({
'': { 'title': 'LCARS Clock' },
'< Back': back,
'Row 1': {
value: 0 | data_options.indexOf(settings.dataRow1),
min: 0, max: 4,
min: 0, max: 5,
format: v => data_options[v],
onchange: v => {
settings.dataRow1 = data_options[v];
@ -34,7 +34,7 @@
},
'Row 2': {
value: 0 | data_options.indexOf(settings.dataRow2),
min: 0, max: 4,
min: 0, max: 5,
format: v => data_options[v],
onchange: v => {
settings.dataRow2 = data_options[v];
@ -43,7 +43,7 @@
},
'Row 3': {
value: 0 | data_options.indexOf(settings.dataRow3),
min: 0, max: 4,
min: 0, max: 5,
format: v => data_options[v],
onchange: v => {
settings.dataRow3 = data_options[v];