mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2026-02-22 05:58:39 +01:00
removed fahrenheit conversion
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user