removed fahrenheit conversion

This commit is contained in:
Johannes
2022-04-01 20:53:36 +02:00
parent 64b3f45705
commit 9fe9f6b5cc
3 changed files with 8 additions and 7 deletions

View File

@@ -43,12 +43,12 @@ def rgb_dec565(rgb_color):
# and shift them to make them a 16 bit dec value in 565 format.
return ((int(red / 255 * 31) << 11) | (int(green / 255 * 63) << 5) | (int(blue / 255 * 31)))
def convert_temperature_from_celsius(c, unit):
def convert_temperature(temp, unit):
if unit == "fahrenheit":
temp = round(((c * 1.8) + 32), 1)
#temp = round(((c * 1.8) + 32), 1)
return f"{temp}°F"
else:
return f"{c}°C"
return f"{temp}°C"
def get_attr_safe(entity, attr, default):
res = entity.attributes.get(attr, default)