1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Replace the usage of unit constants by enumerations in Tests [a-e] (#85932)

This commit is contained in:
Michael
2023-01-15 14:44:01 +01:00
committed by GitHub
parent b20eb54800
commit 2850583085
17 changed files with 164 additions and 122 deletions

View File

@@ -6,7 +6,7 @@ from homeassistant.const import (
ATTR_FRIENDLY_NAME,
ATTR_UNIT_OF_MEASUREMENT,
PERCENTAGE,
TEMP_CELSIUS,
UnitOfTemperature,
)
from homeassistant.core import HomeAssistant
from homeassistant.helpers import entity_registry as er
@@ -44,4 +44,4 @@ async def test_attributes(hass: HomeAssistant) -> None:
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) == TEMP_CELSIUS
assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == UnitOfTemperature.CELSIUS