diff --git a/tests/helpers/test_condition.py b/tests/helpers/test_condition.py index c4ceff89b64..d958c633b62 100644 --- a/tests/helpers/test_condition.py +++ b/tests/helpers/test_condition.py @@ -6,7 +6,7 @@ import pytest from homeassistant.components import sun import homeassistant.components.automation as automation -from homeassistant.components.sensor import DEVICE_CLASS_TIMESTAMP +from homeassistant.components.sensor import SensorDeviceClass from homeassistant.const import ( ATTR_DEVICE_CLASS, CONF_CONDITION, @@ -854,12 +854,12 @@ async def test_time_using_sensor(hass): hass.states.async_set( "sensor.am", "2021-06-03 13:00:00.000000+00:00", # 6 am local time - {ATTR_DEVICE_CLASS: DEVICE_CLASS_TIMESTAMP}, + {ATTR_DEVICE_CLASS: SensorDeviceClass.TIMESTAMP}, ) hass.states.async_set( "sensor.pm", "2020-06-01 01:00:00.000000+00:00", # 6 pm local time - {ATTR_DEVICE_CLASS: DEVICE_CLASS_TIMESTAMP}, + {ATTR_DEVICE_CLASS: SensorDeviceClass.TIMESTAMP}, ) hass.states.async_set( "sensor.no_device_class", @@ -868,7 +868,7 @@ async def test_time_using_sensor(hass): hass.states.async_set( "sensor.invalid_timestamp", "This is not a timestamp", - {ATTR_DEVICE_CLASS: DEVICE_CLASS_TIMESTAMP}, + {ATTR_DEVICE_CLASS: SensorDeviceClass.TIMESTAMP}, ) with patch( diff --git a/tests/helpers/test_significant_change.py b/tests/helpers/test_significant_change.py index 79f3dd3fe3e..b707e369931 100644 --- a/tests/helpers/test_significant_change.py +++ b/tests/helpers/test_significant_change.py @@ -1,7 +1,7 @@ """Test significant change helper.""" import pytest -from homeassistant.components.sensor import DEVICE_CLASS_BATTERY +from homeassistant.components.sensor import SensorDeviceClass from homeassistant.const import ATTR_DEVICE_CLASS, STATE_UNAVAILABLE, STATE_UNKNOWN from homeassistant.core import State from homeassistant.helpers import significant_change @@ -26,7 +26,7 @@ async def checker_fixture(hass): async def test_signicant_change(hass, checker): """Test initialize helper works.""" ent_id = "test_domain.test_entity" - attrs = {ATTR_DEVICE_CLASS: DEVICE_CLASS_BATTERY} + attrs = {ATTR_DEVICE_CLASS: SensorDeviceClass.BATTERY} assert checker.async_is_significant_change(State(ent_id, "100", attrs)) @@ -50,7 +50,7 @@ async def test_signicant_change(hass, checker): async def test_significant_change_extra(hass, checker): """Test extra significant checker works.""" ent_id = "test_domain.test_entity" - attrs = {ATTR_DEVICE_CLASS: DEVICE_CLASS_BATTERY} + attrs = {ATTR_DEVICE_CLASS: SensorDeviceClass.BATTERY} assert checker.async_is_significant_change(State(ent_id, "100", attrs), extra_arg=1) assert checker.async_is_significant_change(State(ent_id, "200", attrs), extra_arg=1)