diff --git a/tests/components/blebox/test_cover.py b/tests/components/blebox/test_cover.py index e8cf67dad01..3c77dae562a 100644 --- a/tests/components/blebox/test_cover.py +++ b/tests/components/blebox/test_cover.py @@ -8,9 +8,6 @@ import pytest from homeassistant.components.cover import ( ATTR_CURRENT_POSITION, ATTR_POSITION, - DEVICE_CLASS_DOOR, - DEVICE_CLASS_GATE, - DEVICE_CLASS_SHUTTER, STATE_CLOSED, STATE_CLOSING, STATE_OPEN, @@ -19,6 +16,7 @@ from homeassistant.components.cover import ( SUPPORT_OPEN, SUPPORT_SET_POSITION, SUPPORT_STOP, + CoverDeviceClass, ) from homeassistant.const import ( ATTR_DEVICE_CLASS, @@ -106,7 +104,7 @@ async def test_init_gatecontroller(gatecontroller, hass, config): state = hass.states.get(entity_id) assert state.name == "gateController-position" - assert state.attributes[ATTR_DEVICE_CLASS] == DEVICE_CLASS_GATE + assert state.attributes[ATTR_DEVICE_CLASS] == CoverDeviceClass.GATE supported_features = state.attributes[ATTR_SUPPORTED_FEATURES] assert supported_features & SUPPORT_OPEN @@ -136,7 +134,7 @@ async def test_init_shutterbox(shutterbox, hass, config): state = hass.states.get(entity_id) assert state.name == "shutterBox-position" - assert entry.original_device_class == DEVICE_CLASS_SHUTTER + assert entry.original_device_class == CoverDeviceClass.SHUTTER supported_features = state.attributes[ATTR_SUPPORTED_FEATURES] assert supported_features & SUPPORT_OPEN @@ -166,7 +164,7 @@ async def test_init_gatebox(gatebox, hass, config): state = hass.states.get(entity_id) assert state.name == "gateBox-position" - assert state.attributes[ATTR_DEVICE_CLASS] == DEVICE_CLASS_DOOR + assert state.attributes[ATTR_DEVICE_CLASS] == CoverDeviceClass.DOOR supported_features = state.attributes[ATTR_SUPPORTED_FEATURES] assert supported_features & SUPPORT_OPEN diff --git a/tests/components/blebox/test_sensor.py b/tests/components/blebox/test_sensor.py index 2281c4ea68c..b7f6d421a12 100644 --- a/tests/components/blebox/test_sensor.py +++ b/tests/components/blebox/test_sensor.py @@ -5,10 +5,10 @@ from unittest.mock import AsyncMock, PropertyMock import blebox_uniapi import pytest +from homeassistant.components.sensor import SensorDeviceClass from homeassistant.const import ( ATTR_DEVICE_CLASS, ATTR_UNIT_OF_MEASUREMENT, - DEVICE_CLASS_TEMPERATURE, STATE_UNKNOWN, TEMP_CELSIUS, ) @@ -45,7 +45,7 @@ async def test_init(tempsensor, hass, config): state = hass.states.get(entity_id) assert state.name == "tempSensor-0.temperature" - assert state.attributes[ATTR_DEVICE_CLASS] == DEVICE_CLASS_TEMPERATURE + assert state.attributes[ATTR_DEVICE_CLASS] == SensorDeviceClass.TEMPERATURE assert state.attributes[ATTR_UNIT_OF_MEASUREMENT] == TEMP_CELSIUS assert state.state == STATE_UNKNOWN diff --git a/tests/components/blebox/test_switch.py b/tests/components/blebox/test_switch.py index e67c0479cb3..74aeadc33bb 100644 --- a/tests/components/blebox/test_switch.py +++ b/tests/components/blebox/test_switch.py @@ -5,7 +5,7 @@ from unittest.mock import AsyncMock, PropertyMock import blebox_uniapi import pytest -from homeassistant.components.switch import DEVICE_CLASS_SWITCH +from homeassistant.components.switch import SwitchDeviceClass from homeassistant.const import ( ATTR_DEVICE_CLASS, SERVICE_TURN_OFF, @@ -54,7 +54,7 @@ async def test_switchbox_init(switchbox, hass, config): state = hass.states.get(entity_id) assert state.name == "switchBox-0.relay" - assert state.attributes[ATTR_DEVICE_CLASS] == DEVICE_CLASS_SWITCH + assert state.attributes[ATTR_DEVICE_CLASS] == SwitchDeviceClass.SWITCH assert state.state == STATE_OFF @@ -201,7 +201,7 @@ async def test_switchbox_d_init(switchbox_d, hass, config): state = hass.states.get(entity_ids[0]) assert state.name == "switchBoxD-0.relay" - assert state.attributes[ATTR_DEVICE_CLASS] == DEVICE_CLASS_SWITCH + assert state.attributes[ATTR_DEVICE_CLASS] == SwitchDeviceClass.SWITCH assert state.state == STATE_OFF # NOTE: should instead be STATE_UNKNOWN? device_registry = dr.async_get(hass) @@ -218,7 +218,7 @@ async def test_switchbox_d_init(switchbox_d, hass, config): state = hass.states.get(entity_ids[1]) assert state.name == "switchBoxD-1.relay" - assert state.attributes[ATTR_DEVICE_CLASS] == DEVICE_CLASS_SWITCH + assert state.attributes[ATTR_DEVICE_CLASS] == SwitchDeviceClass.SWITCH assert state.state == STATE_OFF # NOTE: should instead be STATE_UNKNOWN? device_registry = dr.async_get(hass)