Skip to content

Commit

Permalink
Add TEMP_THRESHOLD env variable.
Browse files Browse the repository at this point in the history
User can set a variable above which T will be shown in colour
if the display supports it.
  • Loading branch information
gantonayde committed Oct 6, 2022
1 parent d33ae78 commit a279ae1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions inkyshot/update-display.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down

0 comments on commit a279ae1

Please sign in to comment.