diff --git a/apps/coin_info/README.md b/apps/coin_info/README.md index 2d00a8030..cf67a4284 100644 --- a/apps/coin_info/README.md +++ b/apps/coin_info/README.md @@ -2,9 +2,17 @@ Crypto-Coins Infos with the help of the Binance API +## Description + +- Is a clock_info module and an app +- Updates prices with the free Binance API +- clkInfo updates after around 30 sec and then every x minutes (via settings) thereafter. +- The token you want to have tracked and compared to what currency have to be uploaded via app loader web-interface +- After that you can decide which token to display in settings + ## Creator Martin Zwigl -## Reminder for last working -- c3388b6434d2acc92f0c536a0ae9042f4fec0ced \ No newline at end of file +## Reminder for last working state +- a5a38fa055e5cd671fe87d8253f4296c767d6d93 \ No newline at end of file diff --git a/apps/coin_info/clkinfo.js b/apps/coin_info/clkinfo.js index 43c51daa9..2b8ea1c77 100644 --- a/apps/coin_info/clkinfo.js +++ b/apps/coin_info/clkinfo.js @@ -54,7 +54,7 @@ callback(); }) .catch(err => { - logFile.write("API Error: " + JSON.stringify(err)); + // logFile.write("API Error: " + JSON.stringify(err)); cache[token] = { text: "Error", img: LOAD_ICON_24 @@ -64,6 +64,7 @@ }; // Set timeout to align to the next hour and then continue updating every hour + const updateTime = settings.getRateMin * 60 * 1000; // TODO get update time from settings self.interval = setTimeout(function timerTimeout() { fetchData(() => { @@ -74,8 +75,8 @@ fetchData(() => { self.emit("redraw"); }); - }, 3600000); - }, 60000 - (Date.now() % 60000 )); + }, updateTime); + }, 30000 - (Date.now() % 30000 )); }, hide: function() { if (this.interval) { diff --git a/apps/coin_info/metadata.json b/apps/coin_info/metadata.json index a4cd3884d..8815a3b02 100644 --- a/apps/coin_info/metadata.json +++ b/apps/coin_info/metadata.json @@ -1,7 +1,7 @@ { "id": "coin_info", "name": "Crypto-Coins Info", "shortName":"Coins Info", - "version": "0.05.04", + "version": "0.05.05", "description": "Crypto-Coins Infos with the help of the Binance API", "icon": "app.png", "tags": "clkinfo",