Show humidity as weather circle data

master
Marco Heiming 2022-01-11 13:52:19 +01:00
parent d59db5ba38
commit d12a415740
2 changed files with 8 additions and 0 deletions

View File

@ -10,6 +10,9 @@ It can show the following information (this can be configured):
* Heart rate (automatically updates when screen is on and unlocked)
* Battery (including charging status and battery low warning)
* Weather (requires [weather app](https://banglejs.com/apps/#weather))
* Humidity as circle progress
* Temperature inside circle
* Condition as icon below circle
## Screenshots
![Screenshot dark theme](screenshot-dark.png)

View File

@ -283,6 +283,7 @@ function drawWeather(w) {
if (!w) w = getCirclePosition("weather");
const weather = getWeather();
const tempString = weather ? locale.temp(weather.temp - 273.15) : undefined;
const humidity = weather ? weather.hum : undefined;
const code = weather ? weather.code : -1;
// Draw rectangle background:
@ -292,6 +293,10 @@ function drawWeather(w) {
g.setColor(colorGrey);
g.fillCircle(w, h3, radiusOuter);
if (humidity >= 0) {
drawGauge(w, h3, humidity / 100, colorYellow);
}
g.setColor(colorBg);
g.fillCircle(w, h3, radiusInner);