[util/format] make temperature metric case insensitive

see #664
This commit is contained in:
tobi-wan-kenobi 2020-06-27 15:02:55 +02:00
parent 1484109fe0
commit 954d7545e3
2 changed files with 4 additions and 1 deletions

View file

@ -68,7 +68,7 @@ def astemperature(val, unit="metric"):
:return: temperature representation of the input value
:rtype: string
"""
return "{}°{}".format(int(val), __UNITS.get(unit, __UNITS["default"]))
return "{}°{}".format(int(val), __UNITS.get(unit.lower(), __UNITS["default"]))
def byte(val, fmt="{:.2f}"):