From a279ae16bfa0740f093d3e5b3c134963ba5ba27e Mon Sep 17 00:00:00 2001 From: Genadi Naydenov Date: Thu, 6 Oct 2022 15:24:11 +0300 Subject: [PATCH] Add TEMP_THRESHOLD env variable. User can set a variable above which T will be shown in colour if the display supports it. --- inkyshot/update-display.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/inkyshot/update-display.py b/inkyshot/update-display.py index da1d348..df65141 100644 --- a/inkyshot/update-display.py +++ b/inkyshot/update-display.py @@ -272,6 +272,11 @@ def celcius_to_fahrenheit(temp): # Temperature scale SCALE = 'F' if "SCALE" in os.environ and os.environ["SCALE"] == 'F' else 'C' +# Temperature threshold above which T is displayed in colour +TEMP_THRESHOLD = 25 if SCALE == 'C' else celcius_to_fahrenheit(25) +if "TEMP_THRESHOLD" in os.environ: + TEMP_THRESHOLD = os.environ['TEMP_THRESHOLD'] + # Locale formatting of date LOCALE = os.environ["LOCALE"] if "LOCALE" in os.environ else 'en'