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:
parent
c18a6d5ea3
commit
b893150154
19 changed files with 67 additions and 47 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue