From 7964a2992968dea7f025c3a22e0b9e085914bb1a Mon Sep 17 00:00:00 2001 From: Neythen Treloar <33317183+zcqsntr@users.noreply.github.com> Date: Mon, 21 Feb 2022 20:26:07 +0000 Subject: [PATCH 1/2] Update update.sh --- update.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/update.sh b/update.sh index 8a56e67..23a3d1e 100755 --- a/update.sh +++ b/update.sh @@ -1,3 +1,3 @@ -sudo -H -u pi git pull origin master - - +sudo -H -u pi git fetch --all --force +sudo -H -u pi git reset --hard origin/master +sudo -H -u pi git pull origin master --force From 73932bcc3839d9667273e0bbbbe61a2742d7533e Mon Sep 17 00:00:00 2001 From: Neythen Treloar Date: Tue, 22 Feb 2022 12:41:30 +0000 Subject: [PATCH 2/2] professional fixes --- server.py | 4 ++-- stockTicker.py | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/server.py b/server.py index 1cd093e..912c07a 100755 --- a/server.py +++ b/server.py @@ -206,14 +206,14 @@ def stop(): ticker.sendline('K') if not displaying_screensaver: - time.sleep(1) # give time for leds to turn off + time.sleep(0.1) # give time for leds to turn off ticker.close() else: screensaver_p.close() if not ticker_stopped: - time.sleep(1) # give time for leds to turn off + time.sleep(0.1) # give time for leds to turn off ticker.close() ticker_stopped = True diff --git a/stockTicker.py b/stockTicker.py index 59fb314..c2f8b39 100755 --- a/stockTicker.py +++ b/stockTicker.py @@ -1002,19 +1002,19 @@ class StockTicker(): for i, cb in enumerate(coin_bases): try: ticker, base = cb.split(',') - current = coin_info[cb]["current"] - change = coin_info[cb]["24hr_change"] + current = float(coin_info[cb]["current"]) + change = float(coin_info[cb]["24hr_change"]) arrow, change = self.getArrow(change, professional=True) if all_crypto_settings["point"]: # convert percent to points - change = change/100 * current - change = '%.2f' % change + change = abs(change)/100 * current + change = str(change) else: - change = '%.2f' % change +'%' + change = str(change) - current = '%.2f' % current + current = str(current) midFrame = self.textToImageProf(ticker + '(' + base + ')', current, change, arrow, font=ImageFont.load("./fonts/6x10.pil")) #IMAGE THE TEXT if all_crypto_settings['logos']: try: @@ -1151,8 +1151,8 @@ class StockTicker(): try: symbol, base = sb.split(',') - current = forex_settings[sb]['current'] - change = forex_settings[sb]['24hr_change'] + current = float(forex_settings[sb]['current']) + change = float(forex_settings[sb]['24hr_change']) @@ -1162,7 +1162,7 @@ class StockTicker(): if all_forex_settings["percent"]: # convert percent to points - change = change/current * 100 + change = abs(change)/current * 100 change = str(change) + '%' else: