From dab1a786a5151af567b4948244e2f7af563b03d6 Mon Sep 17 00:00:00 2001 From: Dave T <17680170+davet2001@users.noreply.github.com> Date: Thu, 16 Dec 2021 21:11:08 +0000 Subject: [PATCH] Use DeviceClass Enums in arlo tests (#62095) --- tests/components/arlo/test_sensor.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/tests/components/arlo/test_sensor.py b/tests/components/arlo/test_sensor.py index 4d6e8f6f228..1948eca14a4 100644 --- a/tests/components/arlo/test_sensor.py +++ b/tests/components/arlo/test_sensor.py @@ -6,12 +6,8 @@ import pytest from homeassistant.components.arlo import DATA_ARLO, sensor as arlo from homeassistant.components.arlo.sensor import SENSOR_TYPES -from homeassistant.const import ( - DEVICE_CLASS_BATTERY, - DEVICE_CLASS_HUMIDITY, - DEVICE_CLASS_TEMPERATURE, - PERCENTAGE, -) +from homeassistant.components.sensor import SensorDeviceClass +from homeassistant.const import PERCENTAGE def _get_named_tuple(input_dict): @@ -157,12 +153,12 @@ def test_sensor_state_default(default_sensor): def test_sensor_device_class__battery(battery_sensor): """Test the battery device_class.""" - assert battery_sensor.device_class == DEVICE_CLASS_BATTERY + assert battery_sensor.device_class == SensorDeviceClass.BATTERY def test_sensor_device_class(temperature_sensor): """Test the device_class property.""" - assert temperature_sensor.device_class == DEVICE_CLASS_TEMPERATURE + assert temperature_sensor.device_class == SensorDeviceClass.TEMPERATURE def test_unit_of_measure(default_sensor, battery_sensor): @@ -174,8 +170,8 @@ def test_unit_of_measure(default_sensor, battery_sensor): def test_device_class(default_sensor, temperature_sensor, humidity_sensor): """Test the device_class property.""" assert default_sensor.device_class is None - assert temperature_sensor.device_class == DEVICE_CLASS_TEMPERATURE - assert humidity_sensor.device_class == DEVICE_CLASS_HUMIDITY + assert temperature_sensor.device_class == SensorDeviceClass.TEMPERATURE + assert humidity_sensor.device_class == SensorDeviceClass.HUMIDITY def test_attribution(default_sensor, temperature_sensor, humidity_sensor):