weather: Convert Gadgetbridge temperature from Kelvin to Celsius
parent
6d07882eae
commit
c3940972b5
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
g.setColor(-1);
|
||||
|
||||
const temp = locale.temp(w.temp).match(/^(\D*\d*)(.*)$/);
|
||||
const temp = locale.temp(w.temp-273.15).match(/^(\D*\d*)(.*)$/);
|
||||
let width = g.setFont("Vector", 40).stringWidth(temp[1]);
|
||||
width += g.setFont("Vector", 20).stringWidth(temp[2]);
|
||||
g.setFont("Vector", 40).setFontAlign(-1, -1, 0);
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
require('weather').drawIcon(w.txt, this.x+10, this.y+8, 8);
|
||||
}
|
||||
if (w.temp) {
|
||||
let t = require('locale').temp(w.temp); // applies conversion
|
||||
let t = require('locale').temp(w.temp-273.15); // applies conversion
|
||||
t = t.substr(0, t.length-2); // but we have no room for units
|
||||
g.setFontAlign(0, 1); // center horizontally at bottom of widget
|
||||
g.setFont('6x8', 1);
|
||||
|
|
|
|||
Loading…
Reference in New Issue