Use DeviceClass Enums in devolo_home_network tests (#62117)
This commit is contained in:
parent
bae82d76b5
commit
ac0f655fd6
1 changed files with 6 additions and 5 deletions
|
@ -8,10 +8,11 @@ from homeassistant.components.devolo_home_network.const import (
|
|||
LONG_UPDATE_INTERVAL,
|
||||
SHORT_UPDATE_INTERVAL,
|
||||
)
|
||||
from homeassistant.components.sensor import DOMAIN, STATE_CLASS_MEASUREMENT
|
||||
from homeassistant.const import ENTITY_CATEGORY_DIAGNOSTIC, STATE_UNAVAILABLE
|
||||
from homeassistant.components.sensor import DOMAIN, SensorStateClass
|
||||
from homeassistant.const import STATE_UNAVAILABLE
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers import entity_registry
|
||||
from homeassistant.helpers.entity import EntityCategory
|
||||
from homeassistant.util import dt
|
||||
|
||||
from . import configure_integration
|
||||
|
@ -47,7 +48,7 @@ async def test_update_connected_wifi_clients(hass: HomeAssistant):
|
|||
state = hass.states.get(state_key)
|
||||
assert state is not None
|
||||
assert state.state == "1"
|
||||
assert state.attributes["state_class"] == STATE_CLASS_MEASUREMENT
|
||||
assert state.attributes["state_class"] == SensorStateClass.MEASUREMENT
|
||||
|
||||
# Emulate device failure
|
||||
with patch(
|
||||
|
@ -89,7 +90,7 @@ async def test_update_neighboring_wifi_networks(hass: HomeAssistant):
|
|||
assert state.state == "1"
|
||||
|
||||
er = entity_registry.async_get(hass)
|
||||
assert er.async_get(state_key).entity_category == ENTITY_CATEGORY_DIAGNOSTIC
|
||||
assert er.async_get(state_key).entity_category is EntityCategory.DIAGNOSTIC
|
||||
|
||||
# Emulate device failure
|
||||
with patch(
|
||||
|
@ -131,7 +132,7 @@ async def test_update_connected_plc_devices(hass: HomeAssistant):
|
|||
assert state.state == "1"
|
||||
|
||||
er = entity_registry.async_get(hass)
|
||||
assert er.async_get(state_key).entity_category == ENTITY_CATEGORY_DIAGNOSTIC
|
||||
assert er.async_get(state_key).entity_category is EntityCategory.DIAGNOSTIC
|
||||
|
||||
# Emulate device failure
|
||||
with patch(
|
||||
|
|
Loading…
Add table
Reference in a new issue