Use TEMP_CELSIUS constant (#33963)

This commit is contained in:
springstan authored and GitHub committed 2020-04-10 19:17:46 +02:00
1 parent ca0648afe8
commit 78d87dc40f
24 files changed
+129 -96

No files matched your search

+2 -1
View File
@@ -6,6 +6,7 @@ from homeassistant.const import (
ATTR_FRIENDLY_NAME,
ATTR_UNIT_OF_MEASUREMENT,
DEVICE_CLASS_HUMIDITY,
TEMP_CELSIUS,
)
from .common import setup_platform
@@ -41,4 +42,4 @@ async def test_attributes(hass):
state = hass.states.get("sensor.environment_sensor_temperature")
# Abodepy device JSON reports 19.5, but Home Assistant shows 19.4
assert state.state == "19.4"
assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == "°C"
assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == TEMP_CELSIUS