Drop UNIT_ prefix for constants (#34164)
* Drop UNIT_ prefix for VOLT * Drop UNIT_ prefix for DEGREE * Drop UNIT_ prefix for CONDUCTIVITY * Drop UNIT_ prefix for UV_INDEX * Run isort
This commit is contained in:
1 parent
fbde040f59
commit
ef9d9b17bd
42 files changed
+170
-196
No files matched your search
@@ -3,7 +3,7 @@ from datetime import datetime
|
||||
from unittest.mock import patch
|
||||
|
||||
from homeassistant.bootstrap import async_setup_component
|
||||
from homeassistant.const import SPEED_METERS_PER_SECOND, UNIT_DEGREE, UNIT_PERCENTAGE
|
||||
from homeassistant.const import DEGREE, SPEED_METERS_PER_SECOND, UNIT_PERCENTAGE
|
||||
import homeassistant.util.dt as dt_util
|
||||
|
||||
from tests.common import assert_setup_component, load_fixture
|
||||
@@ -59,7 +59,7 @@ async def test_custom_setup(hass, aioclient_mock):
|
||||
assert state.state == "1009.3"
|
||||
|
||||
state = hass.states.get("sensor.yr_wind_direction")
|
||||
assert state.attributes.get("unit_of_measurement") == UNIT_DEGREE
|
||||
assert state.attributes.get("unit_of_measurement") == DEGREE
|
||||
assert state.state == "103.6"
|
||||
|
||||
state = hass.states.get("sensor.yr_humidity")
|
||||
@@ -105,7 +105,7 @@ async def test_forecast_setup(hass, aioclient_mock):
|
||||
assert state.state == "1008.3"
|
||||
|
||||
state = hass.states.get("sensor.yr_wind_direction")
|
||||
assert state.attributes.get("unit_of_measurement") == UNIT_DEGREE
|
||||
assert state.attributes.get("unit_of_measurement") == DEGREE
|
||||
assert state.state == "148.9"
|
||||
|
||||
state = hass.states.get("sensor.yr_humidity")
|
||||
|
||||
Reference in new issue
Block a user