From 79ef4dea988b6eda4a914a48a96d27ee9753ee8f Mon Sep 17 00:00:00 2001 From: Dave T <17680170+davet2001@users.noreply.github.com> Date: Thu, 23 Dec 2021 22:14:10 +0000 Subject: [PATCH] Use new enums in smartthings tests (#62708) * Use new enums in smartthings tests * Convert == to is --- tests/components/smartthings/test_binary_sensor.py | 9 +++------ tests/components/smartthings/test_sensor.py | 4 ++-- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/tests/components/smartthings/test_binary_sensor.py b/tests/components/smartthings/test_binary_sensor.py index 7f4748bc215..b636cffbc2e 100644 --- a/tests/components/smartthings/test_binary_sensor.py +++ b/tests/components/smartthings/test_binary_sensor.py @@ -13,13 +13,10 @@ from homeassistant.components.binary_sensor import ( from homeassistant.components.smartthings import binary_sensor from homeassistant.components.smartthings.const import DOMAIN, SIGNAL_SMARTTHINGS_UPDATE from homeassistant.config_entries import ConfigEntryState -from homeassistant.const import ( - ATTR_FRIENDLY_NAME, - ENTITY_CATEGORY_DIAGNOSTIC, - STATE_UNAVAILABLE, -) +from homeassistant.const import ATTR_FRIENDLY_NAME, STATE_UNAVAILABLE from homeassistant.helpers import device_registry as dr, entity_registry as er from homeassistant.helpers.dispatcher import async_dispatcher_send +from homeassistant.helpers.entity import EntityCategory from .conftest import setup_platform @@ -125,4 +122,4 @@ async def test_entity_category(hass, device_factory): entry = entity_registry.async_get("binary_sensor.tamper_sensor_2_tamper") assert entry - assert entry.entity_category == ENTITY_CATEGORY_DIAGNOSTIC + assert entry.entity_category is EntityCategory.DIAGNOSTIC diff --git a/tests/components/smartthings/test_sensor.py b/tests/components/smartthings/test_sensor.py index 0e22a1facba..98464af24af 100644 --- a/tests/components/smartthings/test_sensor.py +++ b/tests/components/smartthings/test_sensor.py @@ -17,13 +17,13 @@ from homeassistant.config_entries import ConfigEntryState from homeassistant.const import ( ATTR_FRIENDLY_NAME, ATTR_UNIT_OF_MEASUREMENT, - ENTITY_CATEGORY_DIAGNOSTIC, PERCENTAGE, STATE_UNAVAILABLE, STATE_UNKNOWN, ) from homeassistant.helpers import device_registry as dr, entity_registry as er from homeassistant.helpers.dispatcher import async_dispatcher_send +from homeassistant.helpers.entity import EntityCategory from .conftest import setup_platform @@ -95,7 +95,7 @@ async def test_entity_and_device_attributes(hass, device_factory): entry = entity_registry.async_get("sensor.sensor_1_battery") assert entry assert entry.unique_id == f"{device.device_id}.{Attribute.battery}" - assert entry.entity_category == ENTITY_CATEGORY_DIAGNOSTIC + assert entry.entity_category is EntityCategory.DIAGNOSTIC entry = device_registry.async_get_device({(DOMAIN, device.device_id)}) assert entry assert entry.configuration_url == "https://account.smartthings.com"