From 97a507bbf462d7fe4d52bc0e9d2dc75c262af41f Mon Sep 17 00:00:00 2001 From: David Peer Date: Wed, 3 Aug 2022 22:02:12 +0200 Subject: [PATCH] Add humidity to weather data --- apps/bwclk/ChangeLog | 3 ++- apps/bwclk/README.md | 2 +- apps/bwclk/app.js | 11 ++++++++++- apps/bwclk/metadata.json | 4 ++-- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/apps/bwclk/ChangeLog b/apps/bwclk/ChangeLog index 8a6fe4f9a..8da3319ed 100644 --- a/apps/bwclk/ChangeLog +++ b/apps/bwclk/ChangeLog @@ -10,4 +10,5 @@ 0.10: HomeAssistant integration if HomeAssistant is installed. 0.11: Performance improvements. 0.12: Implements a 2D menu. -0.13: Clicks < 24px are for widgets, if fullscreen mode is disabled. \ No newline at end of file +0.13: Clicks < 24px are for widgets, if fullscreen mode is disabled. +0.14: Adds humidity to weather data. \ No newline at end of file diff --git a/apps/bwclk/README.md b/apps/bwclk/README.md index eb5356a7e..05257b9de 100644 --- a/apps/bwclk/README.md +++ b/apps/bwclk/README.md @@ -1,5 +1,5 @@ # BW Clock -A very minimalistic clock with date and time in focus. +A very minimalistic clock to mainly show date and time. ![](screenshot.png) diff --git a/apps/bwclk/app.js b/apps/bwclk/app.js index 2d629abe8..920e9cedf 100644 --- a/apps/bwclk/app.js +++ b/apps/bwclk/app.js @@ -139,6 +139,14 @@ function imgWind () { } } +function imgHumidity () { + return { + width : 24, height : 24, bpp : 1, + transparent : 1, + buffer : require("heatshrink").decompress(atob("//7///+YCB+ICB8ACE4F/AQX9AQP54H//AOB+F/34CBj/gn8f4E+h/Aj0H4Ecg+AjED4ACE8E4gfwvEDEgICB/kHGwMP")) + } +} + function imgTimer() { return { width : 24, height : 24, bpp : 1, @@ -203,6 +211,7 @@ if(storage.readJSON('weather.json') !== undefined){ menu.push([ function(){ return [ "Weather", imgWeather() ] }, function(){ return [ getWeather().temp, imgTemperature() ] }, + function(){ return [ getWeather().hum, imgHumidity() ] }, function(){ return [ getWeather().wind, imgWind() ] }, ]); } @@ -395,7 +404,7 @@ function drawDate(){ g.setMediumFont(); g.setColor(g.theme.fg); - g.drawString(dateStr, W/2 - fullDateW / 2, y+1); + g.drawString(dateStr, W/2 - fullDateW / 2, y+2); } diff --git a/apps/bwclk/metadata.json b/apps/bwclk/metadata.json index 45d337ebf..db133a3b7 100644 --- a/apps/bwclk/metadata.json +++ b/apps/bwclk/metadata.json @@ -1,8 +1,8 @@ { "id": "bwclk", "name": "BW Clock", - "version": "0.13", - "description": "A very minimalistic clock with date and time in focus.", + "version": "0.14", + "description": "A very minimalistic clock to mainly show date and time.", "readme": "README.md", "icon": "app.png", "screenshots": [{"url":"screenshot.png"}, {"url":"screenshot_2.png"}, {"url":"screenshot_3.png"}, {"url":"screenshot_4.png"}],