Add and use UNIT_DEGREE constant (#33978)

* Add and use UNIT_DEGREE constant

* Replace more occurrences

* Add and use TEMP_KELVIN

* Run isort
This commit is contained in:
springstan authored and GitHub committed 2020-04-11 16:54:11 +02:00
1 parent c18a6d5ea3
commit b893150154
19 files changed
+67 -47

No files matched your search

+2 -2
View File
@@ -6,7 +6,7 @@ import voluptuous as vol
from homeassistant.components.http import HomeAssistantView
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import CONF_EMAIL, CONF_NAME
from homeassistant.const import CONF_EMAIL, CONF_NAME, UNIT_DEGREE
from homeassistant.core import callback
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import Entity
@@ -91,7 +91,7 @@ class TorqueReceiveDataView(HomeAssistantView):
temp_unit = data[key]
if "\\xC2\\xB0" in temp_unit:
temp_unit = temp_unit.replace("\\xC2\\xB0", "°")
temp_unit = temp_unit.replace("\\xC2\\xB0", UNIT_DEGREE)
units[pid] = temp_unit
elif is_value: